Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp475878lqo; Thu, 16 May 2024 11:28:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdl5173fpoRoRj6nwh5QkpirjeP1aaCvuXh6kJomiVp1hXMSpC+1mQM1ARyh6BCGWPHSnCjayebCA1ezlxAgUUDvr3Er+/w2rePlzQ+g== X-Google-Smtp-Source: AGHT+IHGsAonLHhMS1GS5JJz78Px5IrCFzrIg4yALZu6Gpkk+Aoc29HareIpLgQHIZ9Vzz1t8stC X-Received: by 2002:a17:906:27c7:b0:a59:a48e:34 with SMTP id a640c23a62f3a-a5a2d57acf6mr1917731966b.32.1715884085512; Thu, 16 May 2024 11:28:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715884085; cv=pass; d=google.com; s=arc-20160816; b=Ge71/UgmZamGN55+d4Fe72YfakI/OlzuzI75qSoBkiM0lANu0c4+AZ2tHaAkih8ZgG vvVfyHofIFqvzghrx+Y8nFugvkHerTxYqvn8Bk0cItMrhzRmahzcZweGvaxFDfA+P1TB OXvxqmAc+x6yfIqYhhKGAHKm4I0lqfieg+USr0Dix8/xbmC17iUKYjqpSxNir2+4Lm7l Uug/3EFW4KzfkeTmYBFP5SxTOYE2M9/U3mwWn2/j1vDGyx+6pE1UyZiFp603teyn87BA nDwuxHrqr+njCwV7+y+MMO/xtBUmD0vHkp0J60kwgQ33SkMJYkQmPEgaoYAmQFUTeVuE fR1Q== 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=kxSj0cj+SHG6G3CgN+VDhbwxi4I1ZjlQ60/1SQ/PgFM=; fh=r7jucx4EDwcx4QmKdJY/B/BWs7eG+xdxvoZ3FO/I2uA=; b=OgmFp39SewY8ikvdXyEHxPX81oreAJmTFfDdN92WHCrqszzIKe7039iiHkvp9Depm7 iEX4+G6hfPZ/5+Mj901qRI/9M1Gg/xBXDSfoqE3rK1NUPeDzlDv+LTlEy+KJ0p/3fxpb K3ZhaGyGq4igjBdFbrmzhts3As7asJO0e9epg31GTCY0LM3CS099S5pfUEHbLjy/3YUB nW1TtgkZvqdfpnYHUYie5Wwe8Tj2blkf25Ohsju26D0M5WtT4ewdZueFPQgLknOdkpaG NxgBMmsYGrwAIemvatiuTkN3on8XEQ6Nebs77k6EstZEkYEAyuj6GVU1xjSlcqRsbHse 3Bbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=S6JHHJzz; 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-181464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c2b6f9si909333566b.910.2024.05.16.11.28.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 11:28:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=S6JHHJzz; 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-181464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181464-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3FA961F2260B for ; Thu, 16 May 2024 18:28:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3CDFE15F3F4; Thu, 16 May 2024 18:19:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="S6JHHJzz" 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 DD74215ECE8; Thu, 16 May 2024 18:19:47 +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=1715883589; cv=none; b=iBl9opR9kjuM0jzJVcM+zoG2M2MLiw2Yxd4m/fhVWWpk1XZL9MKYUJC0dICjpeMbu7Hy844EZvq8zMJsJxT0thMCbyeET2QbkLhchgXfs9fiwWmyU8ubKqCYNyADFgVQc3hMuHhVOJ4eAGa2+kHqQ1Z3i8xZvNQx9AyqS8RS7L8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715883589; c=relaxed/simple; bh=3+V1BYHv7imAhNsodfDuqzyVlub/3rC7336E+6Ul+HU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=roQLl+pWiRKjJGenpQPo+Y3qFCrU06IfcZgQFVMzq0v00QUX8HcKiKU8XCUyKheHSdiguu3C/m2XQ6HTSdNYBp51MSxkwNnTyknvrxytMNKLsY2bbvjmvKbIVLGvO59uk8XpepAn6PQrDaWln1FLmmoYXf/IS6grYvSaktJPQps= 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=S6JHHJzz; 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 (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44GHPJ0B028004; Thu, 16 May 2024 18:19:18 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=kxSj0cj+SHG6G3CgN+VDhbwxi4I1ZjlQ60/1SQ/PgFM=; b=S6JHHJzz6KAnXYx712hsIj2stJW0R9yomexkW9PX4jxFnuH2HAZj9UhQupQ6ti2OQiJR 9CDTGbIEVCO4dRNxK+VpTMLg+FECT60CgmtDpLYTx3MFaDjQJgzEvGAi37rnHQpYK8qD fmrZDF/7FoFCx+j8ArOi2hB+dzjobGrZJPxPanTpgBV6Up4JPB+DL0EcCxoVtfNMRyDr DK0xmDbI2RrHGi51s2+45/0j79rsMZNykN/4G94zyrVuYQXiX4xGXh3XXVLKUTuRcG3i 0yk5BnmwDwmCYColkivezpQ8RtxN4BKdhZZ6fXx8vdKphW8SWx8wWUVKbG7OFQb/4Qa2 qg== 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 3y5mce8frp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 May 2024 18:19:17 +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 44GHVOC7020165; Thu, 16 May 2024 18:19:16 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([172.16.1.74]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3y2kd0bmck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 May 2024 18:19:16 +0000 Received: from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com [10.241.53.104]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 44GIJEeC21496474 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 May 2024 18:19:16 GMT Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2DC5D58074; Thu, 16 May 2024 18:19:14 +0000 (GMT) Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E373858076; Thu, 16 May 2024 18:19:13 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.107.19]) by smtpav05.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 16 May 2024 18:19:13 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, broonie@kernel.org, andi.shyti@kernel.org, joel@jms.id.au, alistair@popple.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, linux-aspeed@lists.ozlabs.org, eajames@linux.ibm.com Subject: [PATCH v3 22/40] fsi: aspeed: Use common master error handler Date: Thu, 16 May 2024 13:18:49 -0500 Message-Id: <20240516181907.3468796-23-eajames@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240516181907.3468796-1-eajames@linux.ibm.com> References: <20240516181907.3468796-1-eajames@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: mNQb2WIZQn7bcU-F0x82aAhQb5jhTRBU X-Proofpoint-ORIG-GUID: mNQb2WIZQn7bcU-F0x82aAhQb5jhTRBU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-16_07,2024-05-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 phishscore=0 adultscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 bulkscore=0 mlxscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405160132 This will do the correct mmode manipulation to do the master reset. Signed-off-by: Eddie James --- 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 c9f6d84e1a372..eecd64bc29512 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -226,27 +226,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) { @@ -277,7 +256,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; @@ -313,7 +293,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; -- 2.39.3