Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp569506lqr; Wed, 5 Jun 2024 14:26:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWIX7q4CWO+X4Gz8olSN2avOiOdNdIJM/qKp2k88mBuonhcx/soRqEHNkACFfUSayy5kRhQgcHF4yWebss8MjBIvFtM33PNJ4ACcGqdRA== X-Google-Smtp-Source: AGHT+IFIi288qzB7cb9yYEynLSoglXiUwKpwlQ0a92xMZDjVbxD9Wlny3TwGtYN9cRijRiEbA7xC X-Received: by 2002:a17:906:292a:b0:a68:e230:f918 with SMTP id a640c23a62f3a-a69a028e2ddmr212634266b.66.1717622788352; Wed, 05 Jun 2024 14:26:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717622788; cv=pass; d=google.com; s=arc-20160816; b=cOv+1q71eyWPy9dE3AJ4LexVEvdxhdTy1LgPWLulDQKlgJnGl6nfnizmUDkRDqyGzZ 4oZP1KsxNkSN+Bdozwgjg5tGwRi8bMY6Q2K5RxXP4GqUXI74ZhLhPeZK/83oaCMyTIcj BXdtrZeiNUv0VZlHx12MLTvyt3YFA7GNiqUBoUGYiDYjlt67NmKgqXOP+qBkTg34GdYv ehJVMUI3BfVe9H3W5WmJ6bQ/k2ssh7rE6x0FxTExS+5loY69MFEJpTgx7ArcmF1G/s1l MvI4RPtEYKy72JKxiPxQGASopEqcv3gDqKHrpWoCY2ZTGMgDXA1V8VZGEsH2gmrtIvCE sn2w== 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=35QhAQ7kX9QHCSy8fxK00Ig3Cr+S1lp5g6DIkdhYmNw=; fh=F5i+rNW4hjf57QJHDx14Nq4Eso4Z4OyY/LhC2i40VT4=; b=Q0FcETZs4boU/N4wrsFIlHsxLWXfZvnVrGphS7kMUnPC2rOtJbtn5D+tlPO9tGyqCZ /422wUydRsyxj+Yjk2I7Wgi4nYGLV4wEFTHxx/AEZkVG1B7/7dK3G1Qp++FbV5vQcDgA x9mYXOBoPuopNNXufKygYYdfO9zS16skD01GeVrugG4lTcoYmRTsjE1L4i+9F9gCzw5f dWddY2Eumca8yMtbUDvxV9db4uszoUZKU2viPpqbnwbOtBlbfoqBIPWzMHSy5lYSUXoX Wywfhaa9aSMSSvyR8/j65T68t+pQchyHhA1i0yqvDz8quS0R4Bmrw4JSyz1yWwQrwQzs 3IkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=CAPpPLi4; 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-203264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203264-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-a6a94a37b07si101683266b.239.2024.06.05.14.26.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:26:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203264-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=CAPpPLi4; 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-203264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203264-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 15A5D1F233C1 for ; Wed, 5 Jun 2024 21:26:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A7A9172BAF; Wed, 5 Jun 2024 21:23:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="CAPpPLi4" 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 1F00715FA97; Wed, 5 Jun 2024 21:23:37 +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=1717622621; cv=none; b=t82eKomG+TaUK62czPMrFpnnxwYLQEX4psrI64rb+Ld7mdLrbKItBYEr99jcUZmJQ2Fl5AsDBYqcmeXJ2OTGLSrxut6sgEuflqBAkhNqedaL4aIj/pSu1ggwqCRjZX0RV0WGzXNZbtVe0Uel50NLLkjf0rrvzJW0znkGP53OwzQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717622621; c=relaxed/simple; bh=4ZjZj3THCOKVgY6viW7Cea0T7GWn/8Z7ggQPNe7qU2s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FniHr3s/Jgq3fSMxO3NV2DDLAmuuPZCJEu67qYQDs5MdaAfhQR95Bm19uLxv9nPaiUFhe0Ep/ymwUskxKOINOnVXTD2EMs4t4vIKsZSUerg6IZHBpRou3Zkk7lB8jRWLKA/MUkj6EwnfBZ+hJ7WYrBrMtGqkTLZYhsJcmlCrvRI= 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=CAPpPLi4; 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 455L22RL000949; Wed, 5 Jun 2024 21:23:21 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=35QhAQ7kX9QHCSy8fxK00Ig3Cr+S1lp5g6DIkdhYmNw=; b=CAPpPLi4bVRRGc//GeterL+0O98Y3jyYLFp6r0c6dCG6SdxJfZxHVW+ZemHNDydGjV/M 4j1K7LHAKhuYLktvbmxz7okeFTRSNRYiIlVULjbqGEmVaZwoOgHUzpBSDE0IU/p0WHSw O8J2dfE1+Wh53Hq1AwpiHgWBKMT16+fkwKqP9+O3qBh9bJg5i6CDJ0ajLQmdiK8iu1f0 K14upxagk3g9wEiB4k9OWFEQXQrRyCqXk65UZ57yTBiQXLv4YeZviw2TSEh370MTjCoN IfyRWvwbxZ6tALzfsC3OceELQgqpZCwi6e0LStany7AUMLmoSewZ6HmdrlYabuvKNgIS fw== 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 3yjxbg09vm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 21:23:21 +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 455IX4mD008479; Wed, 5 Jun 2024 21:23:20 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3ygec0xv56-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 21:23:20 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 455LNHeq26215124 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Jun 2024 21:23:19 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC0F95805E; Wed, 5 Jun 2024 21:23:15 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9DC5158068; Wed, 5 Jun 2024 21:23:15 +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:15 +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 08/40] fsi: core: Reset errors instead of clearing interrupts Date: Wed, 5 Jun 2024 16:22:40 -0500 Message-Id: <20240605212312.349188-9-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-GUID: 4jj5RR4L9-1uNJtIYpjzprPcMIaCAcXq X-Proofpoint-ORIG-GUID: 4jj5RR4L9-1uNJtIYpjzprPcMIaCAcXq 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 adultscore=0 clxscore=1015 malwarescore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406050160 The proper way to clear error conditions is to use the SRES register rather than simple clearing SISC. Signed-off-by: Eddie James --- drivers/fsi/fsi-core.c | 9 +++++---- drivers/fsi/fsi-slave.h | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 93bbdcf50a89a..ce9762d1bd8b0 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -166,7 +166,7 @@ static int fsi_slave_calc_addr(struct fsi_slave *slave, uint32_t *addrp, static int fsi_slave_report_and_clear_errors(struct fsi_slave *slave) { struct fsi_master *master = slave->master; - __be32 irq, stat; + __be32 irq, reset, stat; int rc, link; uint8_t id; @@ -187,9 +187,10 @@ static int fsi_slave_report_and_clear_errors(struct fsi_slave *slave) be32_to_cpu(stat), be32_to_cpu(irq)); trace_fsi_slave_error(slave, be32_to_cpu(irq), be32_to_cpu(stat)); - /* clear interrupts */ - return fsi_master_write(master, link, id, FSI_SLAVE_BASE + FSI_SISC, - &irq, sizeof(irq)); + /* reset errors */ + reset = cpu_to_be32(FSI_SRES_ERRS); + return fsi_master_write(master, link, id, FSI_SLAVE_BASE + FSI_SRES, &reset, + sizeof(reset)); } /* Encode slave local bus echo delay */ diff --git a/drivers/fsi/fsi-slave.h b/drivers/fsi/fsi-slave.h index fabc0b66d5bf3..e9fd4be6f3760 100644 --- a/drivers/fsi/fsi-slave.h +++ b/drivers/fsi/fsi-slave.h @@ -24,6 +24,7 @@ #define FSI_SSI1M 0x1c /* S : Set slave interrupt 1 mask */ #define FSI_SCI1M 0x20 /* C : Clear slave interrupt 1 mask */ #define FSI_SLBUS 0x30 /* W : LBUS Ownership */ +#define FSI_SRES 0x34 /* W : Reset */ #define FSI_SRSIC0 0x68 /* C : Clear remote interrupt condition */ #define FSI_SRSIC4 0x6c /* C : Clear remote interrupt condition */ #define FSI_SRSIM0 0x70 /* R/W: Remote interrupt mask */ @@ -90,6 +91,11 @@ */ #define FSI_SLBUS_FORCE 0x80000000 /* Force LBUS ownership */ +/* + * SRES fields + */ +#define FSI_SRES_ERRS 0x40000000 /* Reset FSI slave errors */ + /* * LLMODE fields */ -- 2.39.3