Message ID | 20240226165321.91976-22-eajames@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-81970-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2221143dyb; Mon, 26 Feb 2024 09:24:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVj7upaRNaqvgNl53tuQX2sCYExYsczm3Du0fwyqyjCCjvk1H+tnoiNKGy/TBLMNn9jnVtJU3Z/p0ypsV4bC2aXTkhxBA== X-Google-Smtp-Source: AGHT+IHTyw2ay3iLZe4mS078fRGmhEV0a5LUkOPeK4cUpIDaIxX8alhTDHPNsmbOoB7JqSoczw0M X-Received: by 2002:a17:902:a3cc:b0:1dc:a5fb:3544 with SMTP id q12-20020a170902a3cc00b001dca5fb3544mr2292696plb.1.1708968292214; Mon, 26 Feb 2024 09:24:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708968292; cv=pass; d=google.com; s=arc-20160816; b=0Up/5GqfaDNNbYsCtlkvz9dPEvj7PWUnCU7dVIOPc1JDrPDDHckvp9a5cHBrWejRhJ 2JSwS8zE8kDcSGu9n8OqZrcOWhUfjq+Cx598/IQNSL8EEa1ENwU1409Q4s+M1K4KD8Rc 4AwLHzjvgTfTJcoV8PIR9CVbNsPIxMr4rjESE09eDDef/R+ilpWgLT7bwwsIMmkRmB6q koNEyuLXktgIPBLXkEazI/vWLPR9YMQdlaN+3tegSLdEEFEjZdk0SRZtV/vxNjznGJm+ fHX1uYcDly6zAbAnWc2+Q2ndTwpbdMEZTt6ho0F6rnnG+67zUriLWTjoIdOnf2D0AWCq E2CQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=YFVgmE6fC8McLNPQMyrQ9AZdJJ8T1N9YLZ9PrKcr1ZY=; fh=hD87NRI2uXFKH7lntJG4G4naYHSrGp3lxTKSbIyEdj8=; b=BFTBE5iRjimo6ooxOQK1E5VTv34IS0FxtyAEAd5q3Hbw0iVDc0Wz85A/aEUI7g/+M4 04Nu57JSzxz+B5GNCEljX79XSdsueUiYmUMVqMqR0dUff5JEnWLgpfGnwJbHA08Zu+If UfP0Vhv8fNvrGa5sdveS2+ktreqnBseDbx1VDxoc/qFVxkBG290e3Lc/Nv3uPotkLmoJ AwmAgPfzRvCPsEM0k8ph9Xdweyh/9fkcVmWje1q/8FlVoyowEjgZTqgXXYlG1aH/Owxs wcP7HsAHTLEWailimOmQV7/1cnl+LZTK2LHeJk6P418sKwvp3CHJPEFQloNLZnxddTH9 H5Mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=oJ4T4a3v; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-81970-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81970-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id p6-20020a170902e74600b001dbfaa6d4absi4103812plf.596.2024.02.26.09.24.51 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 09:24:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81970-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=oJ4T4a3v; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-81970-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81970-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6CA35B2EED6 for <ouuuleilei@gmail.com>; Mon, 26 Feb 2024 17:01:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFFC613541D; Mon, 26 Feb 2024 16:54:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="oJ4T4a3v" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB9F5133431; Mon, 26 Feb 2024 16:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708966437; cv=none; b=FF/ZmkczEWZSZ45lpPLQR0uzIHPtATo+8YusrExrQdiUYpWe+jp80d95sagN0QWV+WnoO7rTsAfubUh5SYgNHifxZ4eKXAH/1SnyHMNO0+56cRfHWqg93JsgwGVQuZx2SDwg9ZWZjTK0CRMxgPBicCOyXl8NFwYoYQRYLwUTER8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708966437; c=relaxed/simple; bh=Nitj0lZrrDkxeMQ8i5VV2Bwzuo49UpxkAe+abtxsgAI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CAAmYMivh7FG/chMJY3qV2ZLTQDfqbK89gFEgp+QKxWcVp3jenmF0IXJYgZbfs8zMbD5Tni13xi79790ZidZH/+VpRQxlwvdqflnB1HvJmrpZ1XuLmsGW8RoKM2KktTRKjfvaSVUonC0PCnVxUfGWLQI+Iv6Jxe1sBz+eFFg5Cs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=oJ4T4a3v; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41QGph80021815; Mon, 26 Feb 2024 16:53:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=YFVgmE6fC8McLNPQMyrQ9AZdJJ8T1N9YLZ9PrKcr1ZY=; b=oJ4T4a3v9xMoqBnSCMhKB6aak7W+Ona2rO3E+W6BTGgPa5dUMU0iaVtex3I/H8zJP5mo 9PN/+iKwY0gg0iAlWO8KalmLqZ4+ocvN1TeJLYmKx1BmB6gUnEwRuo1xu1wzn6vYCTqy wzwB898jrACA1Oh7tfUg8jI98K6ycYalQ3vheW2vkqggKYoNd3z5QCQEQ7nzxpkBvmt2 56Rt7cdq97TXgz8j7dKHAZMPhuOubqXMA4E7xFx+tBJV3YKq9EuWMKPyuUztc/oe3Vsw R7JTqbu4ic6OFAw3Ijp2U23qpbMk4ZeemQs9zvd29nyyso3FtuU0ERzTeSSZjtSZ74uP ZQ== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wgvp6bkdb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Feb 2024 16:53:43 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41QGFrrB021762; Mon, 26 Feb 2024 16:53:42 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3wfu5ytkrt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Feb 2024 16:53:42 +0000 Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41QGrdIZ7209920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Feb 2024 16:53:42 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B3E4358061; Mon, 26 Feb 2024 16:53:39 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 07B0458053; Mon, 26 Feb 2024 16:53:39 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.57.130]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 26 Feb 2024 16:53:38 +0000 (GMT) From: Eddie James <eajames@linux.ibm.com> To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, andi.shyti@kernel.org, eajames@linux.ibm.com, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, lakshmiy@us.ibmcom Subject: [PATCH v2 21/31] fsi: aspeed: Use common master error handler Date: Mon, 26 Feb 2024 10:53:11 -0600 Message-Id: <20240226165321.91976-22-eajames@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240226165321.91976-1-eajames@linux.ibm.com> References: <20240226165321.91976-1-eajames@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: NALELMYsCZ3eQc4Sgz_1MA4rnSSIpAy7 X-Proofpoint-GUID: NALELMYsCZ3eQc4Sgz_1MA4rnSSIpAy7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-26_11,2024-02-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 adultscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 malwarescore=0 bulkscore=0 suspectscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402260128 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791983135880511092 X-GMAIL-MSGID: 1791983135880511092 |
Series |
fsi: Interrupt support
|
|
Commit Message
Eddie James
Feb. 26, 2024, 4:53 p.m. UTC
This will do the correct mmode manipulation to do the master
reset.
Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
drivers/fsi/fsi-master-aspeed.c | 27 ++++-----------------------
1 file changed, 4 insertions(+), 23 deletions(-)
diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c index 92b47bc9917a..ac8835e4d1f8 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -220,27 +220,6 @@ static int opb_readb(struct fsi_master_aspeed *aspeed, uint32_t addr, u8 *out) return __opb_read(aspeed, addr, XFER_BYTE, (void *)out); } -static int check_errors(struct fsi_master_aspeed *aspeed, int err) -{ - int ret; - - if (err == -EIO) { - /* Check MAEB (0x70) ? */ - - /* Then clear errors in master */ - ret = opb_writel(aspeed, ctrl_base + FSI_MRESP0, - cpu_to_be32(FSI_MRESP_RST_ALL_MASTER)); - if (ret) { - /* TODO: log? return different code? */ - return ret; - } - /* TODO: confirm that 0x70 was okay */ - } - - /* This will pass through timeout errors */ - return err; -} - static int aspeed_master_read(struct fsi_master *master, int link, uint8_t id, uint32_t addr, void *val, size_t size) { @@ -271,7 +250,8 @@ static int aspeed_master_read(struct fsi_master *master, int link, goto done; } - ret = check_errors(aspeed, ret); + if (ret == -EIO) + fsi_master_error(&aspeed->master, link); done: spin_unlock_irqrestore(&aspeed->lock, flags); return ret; @@ -307,7 +287,8 @@ static int aspeed_master_write(struct fsi_master *master, int link, goto done; } - ret = check_errors(aspeed, ret); + if (ret == -EIO) + fsi_master_error(&aspeed->master, link); done: spin_unlock_irqrestore(&aspeed->lock, flags); return ret;