Message ID | 20240215220759.976998-23-eajames@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-67751-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp153043dyb; Thu, 15 Feb 2024 14:14:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUXuIjVOP3r8h1VO1kNZcbtax4T0ekG6BXCuh04zhNUseODKDb0KKR3Is1JrL+PYON9tcAuaJPqwAOASlFmX/FhVBj6fw== X-Google-Smtp-Source: AGHT+IEfMK+dYzrLwI1toM4g/7hADFz8C6GVdVEAciglr8NmCfS5seay0gQHUBSe8VKgtIgr6C6K X-Received: by 2002:a05:6e02:ee1:b0:363:c4b9:d931 with SMTP id j1-20020a056e020ee100b00363c4b9d931mr3148261ilk.20.1708035268621; Thu, 15 Feb 2024 14:14:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708035268; cv=pass; d=google.com; s=arc-20160816; b=aGaUBAdmYFvo+6mLckUHZSacVpQGceWDYQvgaP9CrsaS/frbt6kO91gW5KmMYE5A/K SPvU/V8ezOZTYRPsD5KU6MPmBs+TXk5IoFd6cHS3zrgSDgargss4Qgyk7TkOHTPuqLmG wqAwYJ5jhERo0rUl+/SIQi8NmK0Stg2/76iZ/wCzOSL93F5J9f2zqL1M7XQ4h1pwhepQ OBgFfkKJLMP7QmePiEWrH9g+kSEYAyl8LJ4gC7HUylBXPFjMTfOxHnuxkNDiesC3EmpO UaF+bFtxUWLUM0Pxvakk9IpHdvp1tI701zO99MSAkiXODEhj0TMsgtGHg9zyAi/bUISD IYqQ== 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=Usz7XAB1EI7Q/DdLEXd449E1MLGpSzqdCCNe5XKh9R0=; b=Rhi49AzBzK2cyqTE7KolmvgVa7KB8GPLpWTTPRX4dsuVZpeVl700FwTuJSRXerjJrG peNaLQv5+jfPnSwpEhbknuUJ4fzgdxfZ/iTGCZXV+b3M9bmA+cvfOOCKdZDu/o9M8n7x kIfMPqVIXwGqRlfPKTNjP8nmwBsnNWMzXVAvSp29WzFq8pVxybAgFabJQxVTQj6/nqty vgU2gj/2YQRtCEiJ9zDrZrve3WvbqNG7kUrSbqFb9SlMT/MxJswaBueg4+q1ozgeL7R7 Jl9m0WbYQi35sigDgCX5vEg20/pPF5DzrUjzOte/gQpjyhy3vTjxuj3+zb9J026Lbplv Kxsg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=L4l0zTZR; 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-67751-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67751-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t23-20020a639557000000b005cdf88fbc11si1702516pgn.48.2024.02.15.14.14.28 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 14:14:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67751-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=L4l0zTZR; 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-67751-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67751-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 66F8D2830A4 for <ouuuleilei@gmail.com>; Thu, 15 Feb 2024 22:14:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF2B5145336; Thu, 15 Feb 2024 22:08:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="L4l0zTZR" 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 299941474C1; Thu, 15 Feb 2024 22:08:27 +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=1708034910; cv=none; b=GF83lywmInAtd5W5TXvLtDlZhekAaalMqyOf4zRyhhPryKdY2u46TQsQxyLTvtvK1QeowX/+ODY8JWt7Q4jPaS3/6jT3EAhyMXTZqgNX5i0lncORny6H+DDC9IocD91YDWlSwnthqkbnyhUjc0cZhH4f1uEpu8tlC47AAUBFNHo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708034910; c=relaxed/simple; bh=Nitj0lZrrDkxeMQ8i5VV2Bwzuo49UpxkAe+abtxsgAI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XRGKu+6gkT9vuPEBFAQ9Di+2H8Ke/qoM53K12m3AtJk+xez2/mktq8ogfd949xopR/hpncRZKYpqm0hbpbi76PROdQEmS+TOPptd71AlXLXARatv+1/xiFCqfANfBLyIf+3OGZspFg5OEY7d3etLEbxHHPyUpSSKN1Ox+0/iUYc= 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=L4l0zTZR; 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 (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41FLkHcq016092; Thu, 15 Feb 2024 22:08:15 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=L4l0zTZRh0Sx/5nKaY4Sje5WkSOWOX0n/IkkDz/88sMoxuPL9J+a5MGuX664FZC3Sn/k l80mWaTFJsKJLkT6opv1vtMdmcVO4IsOo73xGFHVCneB9WCu7uloNfhHTx1hjY0q0p2H tAGfvTv7axRTTtgC6DjZj/FSKW8le4MqipxnIlZjRlZRHPpg/Fqt03YtKi2sCvLckypk TV0fUUUTYoB3BHBHCq453KicWrV50Og/I/wtxvtLJFIHhztKCk35UM21+U8eRGqj4Q7n dkzPfov5bAgaX+PFKJSsPBOmVJM+b5hpSyZMSaB+L1i94el6yzndsrcFPZNGIz2LvwQk qw== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w9tmf8n28-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Feb 2024 22:08:15 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41FLB5um010083; Thu, 15 Feb 2024 22:08:14 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3w6npm781v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Feb 2024 22:08:14 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41FM8BP325166376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 22:08:13 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C14125806F; Thu, 15 Feb 2024 22:08:09 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7613858064; Thu, 15 Feb 2024 22:08:09 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.14.18]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 15 Feb 2024 22:08:09 +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, linux-clk@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, sboyd@kernel.org, mturquette@baylibre.com, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Subject: [PATCH 22/33] fsi: aspeed: Use common master error handler Date: Thu, 15 Feb 2024 16:07:48 -0600 Message-Id: <20240215220759.976998-23-eajames@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240215220759.976998-1-eajames@linux.ibm.com> References: <20240215220759.976998-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-GUID: 8YXFbKlVAKmhtnmB7Gcf3aK36PmZktfK X-Proofpoint-ORIG-GUID: 8YXFbKlVAKmhtnmB7Gcf3aK36PmZktfK 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-15_20,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 malwarescore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150171 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791004789809748833 X-GMAIL-MSGID: 1791004789809748833 |
Series |
fsi: Interrupt support
|
|
Commit Message
Eddie James
Feb. 15, 2024, 10:07 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;