Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp571700lqr; Wed, 5 Jun 2024 14:31:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXyd7RAN4VXPILNdmVBaQz8U+o0JrqyipwbtwaId6zUK7WnJKJZn3Dk7QcT6d9EO9F/j7r8W8h6LS+N6kOIh8vDRilIjmYkkKjtA99Z+w== X-Google-Smtp-Source: AGHT+IFD35ScYqGYoiyrIPJ09JXegLBqX4Bo+ex1PzlKiJjADtKZ6VUwlyqiV+RNMEZ7Vvytdspu X-Received: by 2002:a17:906:4154:b0:a68:e268:fa30 with SMTP id a640c23a62f3a-a6c7651ad4emr58611366b.38.1717623096685; Wed, 05 Jun 2024 14:31:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717623096; cv=pass; d=google.com; s=arc-20160816; b=vtno0pEKMYUEO8YgxdyiHCzBK3GQgfleyDtKj7TdaoYgzP7Zt5vfaon9UWScNh6RlH 3nRWYWR1zFi1YVU2gSEDAxg5zFTE4LDiilWuTG9eFTiORZVbXWd6M6Oq0Apd2WvccE/+ hr/3OPSoLOw44/sBwdCF5HPUj8ElL//UKg39fVTXBldxLFhB/RX1bt3WXGLLfKCnChVM 9q2gc23NuPR6h2OSSUxC+SHDHpuBYkTRD7mIMYIFvq46rI+7MLrIr9qRkiqr4HkMFTzA sF1GzrjVflGc+QLawQuswLiwUGSVfgc3x1hA5jsykorUyO8/i2JXDv5Pca2nJczbhTfc qw7A== 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=F5i+rNW4hjf57QJHDx14Nq4Eso4Z4OyY/LhC2i40VT4=; b=aGnZw8tt2+48gniiW7fBUnCAPoMwVKXNO3NrfFOIQ+MTqxxnT3kqO0SRgOvumyXm1s piQteSQTZa7z3YnXkswGQ7uow40Dkn28EMt56P9BFGHcWWlwmizAMJwHKEDK4SiV7xc2 Rt5p7aXuC0KeWhbW6YsxZ3x4s2zkkALxxRG2TAvB3K2loKu5vCG1aFWu+RuWizY2uBn8 mj99DPjDw16dANK71zbQCyiqiumRCmjYoyq+aYo2JOTfFln8mUwQaVv4UhMQrSZfmx8B KNtiZPCck9ZsJWGITHlI0ZCAfpUdcuvP5yLoqK1e5IQI37jQ+rFkziprfFP6defAXaM+ cWcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=sNYBpF0y; 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-203288-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203288-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-a67e6f03066si657180566b.142.2024.06.05.14.31.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:31:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203288-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=sNYBpF0y; 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-203288-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203288-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 674E81F23E3C for ; Wed, 5 Jun 2024 21:31:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CC541957EF; Wed, 5 Jun 2024 21:23:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="sNYBpF0y" 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 8BC40174EC9; Wed, 5 Jun 2024 21:23:45 +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=1717622627; cv=none; b=IcRHzmJ/zvLeE+WOUqsfPLbN/IEfzNZ3ViTKBPIYsxhYJgzD4WhEiKmp5IQ/+k2ZF+a5XRrWJmjT7n0ooVH2VuoB/i3zwIWlPGR74391LODqGis2U5AJogDKiT4hhLXQnDvKOZfxeBU7cJSbTmj7J2Luiu7ZsHmh37TiXozBCxs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717622627; c=relaxed/simple; bh=3+V1BYHv7imAhNsodfDuqzyVlub/3rC7336E+6Ul+HU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=g1/boQzdJiOn8meEO61XDSNo3lto0hZXj5oh12LVtxfFq/N5AhaTgNgKKeVTCJdDk0W4n0+XfPrp2c23VKyOgwRaCw4s6uQvkxC9XfwxWzGIFkW7RWCdc8ifyTmu2oDPAnditNuGW0E6pB14fZdsdYLGkh53jMebzjyG+gwhhrY= 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=sNYBpF0y; 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 (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 455K8Rdf009413; Wed, 5 Jun 2024 21:23:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc : content-transfer-encoding : date : from : in-reply-to : message-id : mime-version : references : subject : to; s=pp1; bh=kxSj0cj+SHG6G3CgN+VDhbwxi4I1ZjlQ60/1SQ/PgFM=; b=sNYBpF0yZJhYUumcRcGzpnM8KTcckFRjdFV9alyg8qURpJSwIfgY5oyN2gubUtRuDlIA 3aTFz+DN07nDx/DCXWg+zN4S1UmriHRX7JmS0MvBLlg2vMwrb5TrAxjrUfg5aA0aiZBp zbvipDJZ2OMD3bPAJjoywSCTUlO3KYrdE5fP4IAsBI9rqo5Q3i0mupLiVfRn0cGVBGHU rxoTd6egTkPNy82w0idL1ykIrhWFuMeuZid6CGSe1JR3SEs9RvIEoE6urHK9GSbpSb3S brBJIE8NbtZDkFVoZI4BdSLL2ufwYfM9elMgl/7B1de3b3MEq2oZ6nOmUVmrAcWeprA1 VA== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yjxse06rk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 21:23:24 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 455IZCbw031109; Wed, 5 Jun 2024 21:23:23 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3ygeyppnua-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 21:23:23 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 455LNKaI17367726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Jun 2024 21:23:22 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1E59358059; Wed, 5 Jun 2024 21:23:20 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4B2758065; Wed, 5 Jun 2024 21:23:19 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.121.242]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 5 Jun 2024 21:23:19 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: eajames@linux.ibm.com, 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, ninad@linux.ibm.com, lakshmiy@us.ibm.com Subject: [PATCH v4 22/40] fsi: aspeed: Use common master error handler Date: Wed, 5 Jun 2024 16:22:54 -0500 Message-Id: <20240605212312.349188-23-eajames@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240605212312.349188-1-eajames@linux.ibm.com> References: <20240605212312.349188-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-ORIG-GUID: NEm3V_-JbDh5Z16bQusD7g1wrzAk3zLR X-Proofpoint-GUID: NEm3V_-JbDh5Z16bQusD7g1wrzAk3zLR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-05_02,2024-06-05_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 malwarescore=0 mlxlogscore=999 mlxscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406050160 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