From nobody Fri Nov 29 16:35:43 2024 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 12608188A24 for ; Tue, 17 Sep 2024 17:17:03 +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=1726593426; cv=none; b=ojlDJT9MmaVOhv6GFepzocFNKbYjZk4zrcAbiHQwmOlUP12KMh8DmH4s96mz/qzjPVJJKEE+lXIlH01R/c1m1ZGXI5qux2BNDgGymSUyLwjgekU55VJQf3JZcSiggFy8/1YJO5wgFUHkZ6PHpn4IcGN79iEizaolQTIi4wmoMl8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593426; c=relaxed/simple; bh=pcaPH5Ml70DzQQiV10Q0FbRbKfH/Qiby0VbENfxPW+M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JttfsShWctOE4nHxS5vJfca3Q9L33ztRlsdy1BZOXtb/wMuIVWGxNghkp3lm8PPiOiKEM1XNFnK5eLIkiFFdUNXZfCflBFPgR28Xn+CZ3zfjbYGXHRcNIKD+C1oH9EYv7fWbrUepyc+dg5o8VLMmZiqpctNlm6qbXWz4XZPdql0= 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=iDdFbaeX; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="iDdFbaeX" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48H8APJr006402; Tue, 17 Sep 2024 17:16:51 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=X1uQkj2ybvtAU 5zyG4+kAarHL2hC9hYMaou7f5b+m2k=; b=iDdFbaeXvouWPhmQbFFXhH8rV7hQS Oyv1pHTAot5rQeGhO4+i9xCZR6xoM+3Vm1xDKSV0OVoVgjEOY2357+8BbDTnmr1d vJzTNv39IdNw+jLFyFs0ahqnqqWVnEehITaO1icPviCJUhAd+guGXySWPhRGZ5kj /z2sdCHeg6UUgPFqLCf/rNyXgClYa4zFQ9UjxmZA3a6U2BekitNDab1Vj5HhbiqT nnAHaNcf/ksAtVvQPFkcUVC0CdD+AUfovDJwzl2ATAL94PKWRvrIoFv/7zW3lw2N Xxztft9hGd1QUdmIj8areTwZumzaZA58fwg7ei0bzujMCZkQa14VebWlQ== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 41n41agwbt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:50 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HH175I001860; Tue, 17 Sep 2024 17:16:50 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([172.16.1.74]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 41nqh3p4ms-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:50 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGmcE55640430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:48 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 30DCC58057; Tue, 17 Sep 2024 17:16:48 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EEB6258063; Tue, 17 Sep 2024 17:16:47 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:47 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 01/15] fsi: hub: Set master index to link number plus one Date: Tue, 17 Sep 2024 12:16:33 -0500 Message-ID: <20240917171647.1403910-2-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: phjYRyY6kR5uU5DRK8U9r_lulInoWZqx X-Proofpoint-ORIG-GUID: phjYRyY6kR5uU5DRK8U9r_lulInoWZqx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 suspectscore=0 mlxscore=0 mlxlogscore=903 bulkscore=0 impostorscore=0 phishscore=0 priorityscore=1501 spamscore=0 clxscore=1015 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" This makes the hub master indexing more deterministic. Signed-off-by: Eddie James --- drivers/fsi/fsi-master-hub.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c index 6568fed7db3c..3bfd0cea6f77 100644 --- a/drivers/fsi/fsi-master-hub.c +++ b/drivers/fsi/fsi-master-hub.c @@ -12,6 +12,7 @@ #include =20 #include "fsi-master.h" +#include "fsi-slave.h" =20 #define FSI_ENGID_HUB_MASTER 0x1c =20 @@ -229,6 +230,7 @@ static int hub_master_probe(struct device *dev) hub->master.dev.release =3D hub_master_release; hub->master.dev.of_node =3D of_node_get(dev_of_node(dev)); =20 + hub->master.idx =3D fsi_dev->slave->link + 1; hub->master.n_links =3D links; hub->master.read =3D hub_master_read; hub->master.write =3D hub_master_write; --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 861C8176FB6 for ; Tue, 17 Sep 2024 17:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593424; cv=none; b=HvF6mvViBl4aBcm0/fWbNsH8i6TuU5227Ru4rlBjzMDKkSG0QQkurFT1gRfy5EVeIDaIOYpT0ej5hf4X8pJkJFM8i0cQzniNpOL4B08N8EXLNqYn1LxIOluEcvzwh87Y40BXxJO96fXd0KbcthOAOk8VfRup9iK6THuNW5mIHZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593424; c=relaxed/simple; bh=xVmxFtkpWlJU238eAzvHKx/JYWmLAnS81rCYjR7YsxA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GtZh1noNUCH8Eb+bOn++btwW9LoWp5C0EQaaQ5e6SpN0c+4haOmuVXpQjzzHEvxySjr0Mxw+3TJ1s6HIort7zhJ1MNiafjY+P4Cav3YENOqCUFvEx6vhR0mYiM2MhKqfkK3i9MI9T3yuxeYg7oQoOzyuUN+eu7rHa9OQer2uBOc= 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=RvUQ9H/9; arc=none smtp.client-ip=148.163.156.1 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="RvUQ9H/9" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48H8muXd007650; Tue, 17 Sep 2024 17:16:51 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=NdgjyTP5bHuWM KxG+Dyf8Kp5l871ZAgSYlDsb5N07Vw=; b=RvUQ9H/9OBBQa78JwTJkbiXlnK36B ehvLTJsTIBhEdKAAtnHUjJ1bzDJ1d4+qeRWn/sB2D2MgggJCd+po607M3WoaH80V JNVHQ4YE8zBXjGsXIb7S3RIg9N0r7tZ5n9HTW0im8JacJSczgvqWNGiZEc8bEte6 iW2Zi8WTnl14iOhBBh7boRnaF43TrcUmTfVkMy1lHyyoBhu8mQYE1GGRFrawrmp0 qqqQK31QBks3ivuKRbVM7Z8fXR5NEyb0cfoxwSPyc0MDGe3gUzu5iCjZgKrE+CAL 46tOo+3K5eGOlgkw5h7+mh5KjKH12biTxW98Y5jg1oAxSz/Oa+FbSRpyQ== 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 41n3vdhjrm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:51 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HFhBrY001184; Tue, 17 Sep 2024 17:16:49 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([172.16.1.74]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 41nntq6erk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:49 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGmmb27263694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:48 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6401A58059; Tue, 17 Sep 2024 17:16:48 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 37CFD5805D; Tue, 17 Sep 2024 17:16:48 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:48 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 02/15] fsi: Move slave definitions to fsi-slave.h Date: Tue, 17 Sep 2024 12:16:34 -0500 Message-ID: <20240917171647.1403910-3-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: YnQZDxjEU6GbGhZa8OIZ1tu2krDZSPEv X-Proofpoint-GUID: YnQZDxjEU6GbGhZa8OIZ1tu2krDZSPEv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 clxscore=1015 mlxscore=0 malwarescore=0 mlxlogscore=980 priorityscore=1501 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" Master drivers may need access to the slave definitions. Signed-off-by: Eddie James --- drivers/fsi/fsi-core.c | 35 ----------------- drivers/fsi/fsi-slave.h | 84 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 35 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index e2e1e9df6115..b50ed849f924 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -45,41 +45,6 @@ =20 static const int engine_page_size =3D 0x400; =20 -#define FSI_SLAVE_BASE 0x800 - -/* - * FSI slave engine control register offsets - */ -#define FSI_SMODE 0x0 /* R/W: Mode register */ -#define FSI_SISC 0x8 /* R/W: Interrupt condition */ -#define FSI_SSTAT 0x14 /* R : Slave status */ -#define FSI_SLBUS 0x30 /* W : LBUS Ownership */ -#define FSI_LLMODE 0x100 /* R/W: Link layer mode register */ - -/* - * SMODE fields - */ -#define FSI_SMODE_WSC 0x80000000 /* Warm start done */ -#define FSI_SMODE_ECRC 0x20000000 /* Hw CRC check */ -#define FSI_SMODE_SID_SHIFT 24 /* ID shift */ -#define FSI_SMODE_SID_MASK 3 /* ID Mask */ -#define FSI_SMODE_ED_SHIFT 20 /* Echo delay shift */ -#define FSI_SMODE_ED_MASK 0xf /* Echo delay mask */ -#define FSI_SMODE_SD_SHIFT 16 /* Send delay shift */ -#define FSI_SMODE_SD_MASK 0xf /* Send delay mask */ -#define FSI_SMODE_LBCRR_SHIFT 8 /* Clk ratio shift */ -#define FSI_SMODE_LBCRR_MASK 0xf /* Clk ratio mask */ - -/* - * SLBUS fields - */ -#define FSI_SLBUS_FORCE 0x80000000 /* Force LBUS ownership */ - -/* - * LLMODE fields - */ -#define FSI_LLMODE_ASYNC 0x1 - #define FSI_SLAVE_SIZE_23b 0x800000 =20 static DEFINE_IDA(master_ida); diff --git a/drivers/fsi/fsi-slave.h b/drivers/fsi/fsi-slave.h index 1d63a585829d..dba65bd4e083 100644 --- a/drivers/fsi/fsi-slave.h +++ b/drivers/fsi/fsi-slave.h @@ -7,6 +7,90 @@ #include #include =20 +#define FSI_SLAVE_BASE 0x800 + +/* + * FSI slave engine control register offsets + */ +#define FSI_SMODE 0x0 /* R/W: Mode register */ +#define FSI_SISC 0x8 /* R : Interrupt condition */ +#define FSI_SCISC 0x8 /* C : Clear interrupt condition */ +#define FSI_SISM 0xc /* R/W: Interrupt mask */ +#define FSI_SISS 0x10 /* R : Interrupt status */ +#define FSI_SSISM 0x10 /* S : Set interrupt mask */ +#define FSI_SCISM 0x14 /* C : Clear interrupt mask */ +#define FSI_SSTAT 0x14 /* R : Slave status */ +#define FSI_SI1S 0x1c /* R : Slave interrupt 1 status */ +#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_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 */ +#define FSI_SRSIM4 0x74 /* R/W: Remote interrupt mask */ +#define FSI_SRSIS0 0x78 /* R : Remote interrupt status */ +#define FSI_SRSIS4 0x7c /* R : Remote interrupt status */ +#define FSI_LLMODE 0x100 /* R/W: Link layer mode register */ + +/* + * SMODE fields + */ +#define FSI_SMODE_WSC 0x80000000 /* Warm start done */ +#define FSI_SMODE_ECRC 0x20000000 /* Hw CRC check */ +#define FSI_SMODE_SID_SHIFT 24 /* ID shift */ +#define FSI_SMODE_SID_MASK 3 /* ID Mask */ +#define FSI_SMODE_ED_SHIFT 20 /* Echo delay shift */ +#define FSI_SMODE_ED_MASK 0xf /* Echo delay mask */ +#define FSI_SMODE_SD_SHIFT 16 /* Send delay shift */ +#define FSI_SMODE_SD_MASK 0xf /* Send delay mask */ +#define FSI_SMODE_LBCRR_SHIFT 8 /* Clk ratio shift */ +#define FSI_SMODE_LBCRR_MASK 0xf /* Clk ratio mask */ + +/* + * SISS fields + */ +#define FSI_SISS_CRC_ERROR BIT(31) +#define FSI_SISS_PROTO_ERROR BIT(30) +#define FSI_SISS_LBUS_PARITY_ERROR BIT(29) +#define FSI_SISS_LBUS_PROTO_ERROR BIT(28) +#define FSI_SISS_ACCESS_ERROR BIT(27) +#define FSI_SISS_LBUS_OWNERSHIP_ERROR BIT(26) +#define FSI_SISS_LBUS_OWNERSHIP_CHANGE BIT(25) +#define FSI_SISS_ASYNC_MODE_ERROR BIT(14) +#define FSI_SISS_OPB_ACCESS_ERROR BIT(13) +#define FSI_SISS_OPB_FENCED BIT(12) +#define FSI_SISS_OPB_PARITY_ERROR BIT(11) +#define FSI_SISS_OPB_PROTO_ERROR BIT(10) +#define FSI_SISS_OPB_TIMEOUT BIT(9) +#define FSI_SISS_OPB_ERROR_ACK BIT(8) +#define FSI_SISS_MFSI_MASTER_ERROR BIT(3) +#define FSI_SISS_MFSI_PORT_ERROR BIT(2) +#define FSI_SISS_MFSI_HP BIT(1) +#define FSI_SISS_MFSI_CR_PARITY_ERROR BIT(0) +#define FSI_SISS_ALL 0xfe007f00 + +/* + * SI1S fields + */ +#define FSI_SI1S_SLAVE_BIT 31 +#define FSI_SI1S_SHIFT_BIT 30 +#define FSI_SI1S_SCOM_BIT 29 +#define FSI_SI1S_SCRATCH_BIT 28 +#define FSI_SI1S_I2C_BIT 27 +#define FSI_SI1S_SPI_BIT 26 +#define FSI_SI1S_SBEFIFO_BIT 25 +#define FSI_SI1S_MBOX_BIT 24 + +/* + * SLBUS fields + */ +#define FSI_SLBUS_FORCE 0x80000000 /* Force LBUS ownership */ + +/* + * LLMODE fields + */ +#define FSI_LLMODE_ASYNC 0x1 + struct fsi_master; =20 struct fsi_slave { --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 231DC17C233 for ; Tue, 17 Sep 2024 17:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593424; cv=none; b=dbyIGriIEMgPaCX9+a8nNIOThXjhyD5H4Xl/kPenvLKTvaG+OpIQywnGumsvxPn/TQHTsG/QxCMYIkxejgworipfWLh2G9HXja0QOADCdQu2mbirSQkqh/ukbx7OFAbTS1fe/TPmDywl75/S24pVk2vOW+twP5a5xcTTK4RlbhM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593424; c=relaxed/simple; bh=jIaC/3kfv4DQbKkjmLaklwnY++rNXUjoS+mUY01jZpg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SBMkOHbbHdanTM3C3xS1P6tHOwLVnereHjFAo7V2Etj7b6O6+psd5rFRlUpqueTHANHXz9MvvQEjTMc9SG3E2WBhRLasnmpvXBXOpj6/m0FtjVau9PfNZwDvPnD9ivlhYrBWAUI7T+HvLOyPE8rMpx/biC5hXkzVmOkJ3U5o1No= 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=f1PduCTI; arc=none smtp.client-ip=148.163.156.1 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="f1PduCTI" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48HAf9rO031857; Tue, 17 Sep 2024 17:16:52 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=PY6/6DQFhjh9L oZY7SORITDwla3GRt+CRdzMs4nef5I=; b=f1PduCTIecfofUBMWwiQMBr/2s10L ZVnWdFIuvRvOFI4YTTb4qRdSJXUkSsdH6Oj8Faww6KWYEchTFyFcY95rN8UxC5rT yvvUc2A1SoCZEbelFKaUyD4tSXcXUf2sSRSHFb6v4fjzdnq8EazDgw/ttEieg+Wg LUjyJYZFzXMjpGrqblelw/dHJ+sL2Rhhz1QoIbNyxIgYU56jeV3yemZKNbCfjTs7 cPDzysK7ne5M7ONeNKdyd/AyFtO9x+w6/clvR8ziXs4ueicRJVjZ9B/uR/fD2dWB X6TmE9H13bOzH1D82Y9uCF0aQb9NPXCB3cZQ2nFSR89PUk5C3pIRr9MWw== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 41n3uj9h8m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:52 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HE7QHZ001871; Tue, 17 Sep 2024 17:16:50 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([172.16.1.74]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 41nqh3p4mu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:50 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGmYt55640432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:49 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9782A58058; Tue, 17 Sep 2024 17:16:48 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B68158065; Tue, 17 Sep 2024 17:16:48 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:48 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 03/15] fsi: Fix slave addressing after break command Date: Tue, 17 Sep 2024 12:16:35 -0500 Message-ID: <20240917171647.1403910-4-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: CmG5ph2IzbWfp2HQLwWEWeuDybu_0usl X-Proofpoint-GUID: CmG5ph2IzbWfp2HQLwWEWeuDybu_0usl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=999 adultscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 suspectscore=0 mlxscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" After a break command, the slave ID is set to 0x3, which means the FSI driver should use that ID when communicating with the slave, until SMODE is programmed with the new ID (forced to 0 for 23 bit addressing in the current implementation). This worked previously due to a feature of newer FSI slaves that don't enforce this requirement. Since hub masters and I2C responders cannot address non-zero slave IDs, disable this behavior for slaves off those masters. Fixes: 2b545cd8e1b2 ("drivers/fsi: Implement slave initialisation") Signed-off-by: Eddie James --- drivers/fsi/fsi-core.c | 20 ++++++++++---------- drivers/fsi/fsi-master-hub.c | 1 + drivers/fsi/fsi-master-i2cr.c | 1 + drivers/fsi/fsi-master.h | 1 + drivers/fsi/fsi-slave.h | 1 + 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index b50ed849f924..788b721a7d60 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -217,7 +217,7 @@ static uint32_t fsi_slave_smode(int id, u8 t_senddly, u= 8 t_echodly) | fsi_smode_lbcrr(0x8); } =20 -static int fsi_slave_set_smode(struct fsi_slave *slave) +static int fsi_slave_set_smode(struct fsi_slave *slave, uint8_t id) { uint32_t smode; __be32 data; @@ -228,8 +228,7 @@ static int fsi_slave_set_smode(struct fsi_slave *slave) smode =3D fsi_slave_smode(slave->id, slave->t_send_delay, slave->t_echo_d= elay); data =3D cpu_to_be32(smode); =20 - return fsi_master_write(slave->master, slave->link, slave->id, - FSI_SLAVE_BASE + FSI_SMODE, + return fsi_master_write(slave->master, slave->link, id, FSI_SLAVE_BASE + = FSI_SMODE, &data, sizeof(data)); } =20 @@ -281,7 +280,7 @@ static int fsi_slave_handle_error(struct fsi_slave *sla= ve, bool write, slave->t_send_delay =3D send_delay; slave->t_echo_delay =3D echo_delay; =20 - rc =3D fsi_slave_set_smode(slave); + rc =3D fsi_slave_set_smode(slave, FSI_SMODE_SID_BREAK); if (rc) return rc; =20 @@ -773,7 +772,7 @@ static ssize_t slave_send_echo_store(struct device *dev, slave->t_send_delay =3D val; slave->t_echo_delay =3D val; =20 - rc =3D fsi_slave_set_smode(slave); + rc =3D fsi_slave_set_smode(slave, slave->id); if (rc < 0) return rc; if (master->link_config) @@ -945,6 +944,8 @@ EXPORT_SYMBOL_GPL(fsi_free_minor); =20 static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id) { + const uint8_t break_id =3D (master->flags & FSI_MASTER_FLAG_NO_BREAK_SID)= ? 0 : + FSI_SMODE_SID_BREAK; uint32_t cfam_id; struct fsi_slave *slave; uint8_t crc; @@ -957,7 +958,7 @@ static int fsi_slave_init(struct fsi_master *master, in= t link, uint8_t id) if (id !=3D 0) return -EINVAL; =20 - rc =3D fsi_master_read(master, link, id, 0, &data, sizeof(data)); + rc =3D fsi_master_read(master, link, break_id, 0, &data, sizeof(data)); if (rc) { dev_dbg(&master->dev, "can't read slave %02x:%02x %d\n", link, id, rc); @@ -981,9 +982,8 @@ static int fsi_slave_init(struct fsi_master *master, in= t link, uint8_t id) */ if (master->flags & FSI_MASTER_FLAG_SWCLOCK) { llmode =3D cpu_to_be32(FSI_LLMODE_ASYNC); - rc =3D fsi_master_write(master, link, id, - FSI_SLAVE_BASE + FSI_LLMODE, - &llmode, sizeof(llmode)); + rc =3D fsi_master_write(master, link, break_id, FSI_SLAVE_BASE + FSI_LLM= ODE, &llmode, + sizeof(llmode)); if (rc) dev_warn(&master->dev, "can't set llmode on slave:%02x:%02x %d\n", @@ -1028,7 +1028,7 @@ static int fsi_slave_init(struct fsi_master *master, = int link, uint8_t id) "can't set slbus on slave:%02x:%02x %d\n", link, id, rc); =20 - rc =3D fsi_slave_set_smode(slave); + rc =3D fsi_slave_set_smode(slave, break_id); if (rc) { dev_warn(&master->dev, "can't set smode on slave:%02x:%02x %d\n", diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c index 3bfd0cea6f77..40a288b7342b 100644 --- a/drivers/fsi/fsi-master-hub.c +++ b/drivers/fsi/fsi-master-hub.c @@ -232,6 +232,7 @@ static int hub_master_probe(struct device *dev) =20 hub->master.idx =3D fsi_dev->slave->link + 1; hub->master.n_links =3D links; + hub->master.flags =3D FSI_MASTER_FLAG_NO_BREAK_SID; hub->master.read =3D hub_master_read; hub->master.write =3D hub_master_write; hub->master.send_break =3D hub_master_break; diff --git a/drivers/fsi/fsi-master-i2cr.c b/drivers/fsi/fsi-master-i2cr.c index 40f1f4d231e5..61e55740946b 100644 --- a/drivers/fsi/fsi-master-i2cr.c +++ b/drivers/fsi/fsi-master-i2cr.c @@ -273,6 +273,7 @@ static int i2cr_probe(struct i2c_client *client) i2cr->master.dev.release =3D i2cr_release; =20 i2cr->master.n_links =3D 1; + i2cr->master.flags =3D FSI_MASTER_FLAG_NO_BREAK_SID; i2cr->master.read =3D i2cr_read; i2cr->master.write =3D i2cr_write; =20 diff --git a/drivers/fsi/fsi-master.h b/drivers/fsi/fsi-master.h index 967622c1cabf..a0d7ad0f0f7c 100644 --- a/drivers/fsi/fsi-master.h +++ b/drivers/fsi/fsi-master.h @@ -111,6 +111,7 @@ =20 /* fsi-master definition and flags */ #define FSI_MASTER_FLAG_SWCLOCK 0x1 +#define FSI_MASTER_FLAG_NO_BREAK_SID 0x2 =20 /* * Structures and function prototypes diff --git a/drivers/fsi/fsi-slave.h b/drivers/fsi/fsi-slave.h index dba65bd4e083..f6cca04131a9 100644 --- a/drivers/fsi/fsi-slave.h +++ b/drivers/fsi/fsi-slave.h @@ -39,6 +39,7 @@ #define FSI_SMODE_ECRC 0x20000000 /* Hw CRC check */ #define FSI_SMODE_SID_SHIFT 24 /* ID shift */ #define FSI_SMODE_SID_MASK 3 /* ID Mask */ +#define FSI_SMODE_SID_BREAK 3 /* ID after break command */ #define FSI_SMODE_ED_SHIFT 20 /* Echo delay shift */ #define FSI_SMODE_ED_MASK 0xf /* Echo delay mask */ #define FSI_SMODE_SD_SHIFT 16 /* Send delay shift */ --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 5E3568248C for ; Tue, 17 Sep 2024 17:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593424; cv=none; b=bHo9W+GpOx5rK/LC6CjpXiYzg6pAM5wpo+dHe/hI4OrQ2zOrbe+ZH3vpOlIfrXAmmAuoL/r3BFqPzgt2obhfkKQS/bl+Bfo+cbgU/pMOG1P6Kxspuuht1hHKtQB1ymyAP0DdfQuTJM94R1Iqq/40eQLKDrD+/8uKuiUpC80JSy4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593424; c=relaxed/simple; bh=4OTQw0h9H/yoof5Xg5qCdnpWj75jxgcB/HR/anjpiMU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kE+Tm+5DAY+m3H/ICdh/ljsswqspBYtuutg1pDinqSCzERZHLJMl0uPxSGMlkJhX5NuptVa3CAMDkp8v+AU2YpoOWPbPOReb6YcUytVmzVX3pwwweCdUsTxoBQMHZGp9+T2n4ggLdZKKuCxg6mbh/71OSqrizuFdhDlwmk18Ttg= 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=gjg/VqjV; arc=none smtp.client-ip=148.163.156.1 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="gjg/VqjV" Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48HAZ2gf022504; Tue, 17 Sep 2024 17:16:51 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=4CA/GbBpZcW7x BCC/dhWueIg7omYTIpwTZqviEF8mh8=; b=gjg/VqjVSivIFuRjdhzA/L0+AQHtO 8MerM7lIlKIZoiiq/xa5c48cNxBH+ySYFQDC66YOBG2iqRa03YzUPsFYrzETyxIS 2DY2FxNLMDp3mCX0PNjrTM7tzqfH6aT3DIGeJ1aRZ/uJxN+R2MFBNlBMpzBHTxhf gAEHhcqExPgOG9wpcXAKJRxfgWDNEM1cXYR95Ib4lQVSJ9t69FEy+J1JSgRCpfXA KkqK08tSVO4jpo+d1XiOxqGbA9MKomjHr+gfsiYu/HeeC2f+LjRbfDOt60ceno0L qZCFFfNTqb8hePbgkAynW+lDi40kJsiCn/0p0E258LKz9TZnk7N/fjxUg== 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 41n3ud9hgh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:51 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HG0bdj000765; Tue, 17 Sep 2024 17:16:50 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([172.16.1.74]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 41nntq6erm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:50 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGmdD27263696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:49 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CBBB758065; Tue, 17 Sep 2024 17:16:48 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E84C58061; Tue, 17 Sep 2024 17:16:48 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:48 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 04/15] fsi: core: Use a defined value for default echo delay Date: Tue, 17 Sep 2024 12:16:36 -0500 Message-ID: <20240917171647.1403910-5-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: uj8m_XFtxUkVY3lRHQytmOS2vYWE4KD1 X-Proofpoint-ORIG-GUID: uj8m_XFtxUkVY3lRHQytmOS2vYWE4KD1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 phishscore=0 impostorscore=0 spamscore=0 priorityscore=1501 suspectscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" Avoid hardcoding '16' several times. Signed-off-by: Eddie James --- drivers/fsi/fsi-core.c | 6 +++--- drivers/fsi/fsi-slave.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 788b721a7d60..3ddf518c6a19 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -1008,8 +1008,8 @@ static int fsi_slave_init(struct fsi_master *master, = int link, uint8_t id) slave->link =3D link; slave->id =3D id; slave->size =3D FSI_SLAVE_SIZE_23b; - slave->t_send_delay =3D 16; - slave->t_echo_delay =3D 16; + slave->t_send_delay =3D FSI_SMODE_SD_DEFAULT; + slave->t_echo_delay =3D FSI_SMODE_ED_DEFAULT; =20 /* Get chip ID if any */ slave->chip_id =3D -1; @@ -1160,7 +1160,7 @@ static int fsi_master_break(struct fsi_master *master= , int link) if (master->send_break) rc =3D master->send_break(master, link); if (master->link_config) - master->link_config(master, link, 16, 16); + master->link_config(master, link, FSI_SMODE_SD_DEFAULT, FSI_SMODE_ED_DEF= AULT); =20 return rc; } diff --git a/drivers/fsi/fsi-slave.h b/drivers/fsi/fsi-slave.h index f6cca04131a9..45190b06fa02 100644 --- a/drivers/fsi/fsi-slave.h +++ b/drivers/fsi/fsi-slave.h @@ -42,8 +42,10 @@ #define FSI_SMODE_SID_BREAK 3 /* ID after break command */ #define FSI_SMODE_ED_SHIFT 20 /* Echo delay shift */ #define FSI_SMODE_ED_MASK 0xf /* Echo delay mask */ +#define FSI_SMODE_ED_DEFAULT 16 /* Default echo delay */ #define FSI_SMODE_SD_SHIFT 16 /* Send delay shift */ #define FSI_SMODE_SD_MASK 0xf /* Send delay mask */ +#define FSI_SMODE_SD_DEFAULT 16 /* Default send delay */ #define FSI_SMODE_LBCRR_SHIFT 8 /* Clk ratio shift */ #define FSI_SMODE_LBCRR_MASK 0xf /* Clk ratio mask */ =20 --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 F11FD17BEBA for ; Tue, 17 Sep 2024 17:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593423; cv=none; b=mZ+jR4yvOLRTQ8F5shr1gYCkB7ejy4T+YTLTq+CnlFHWc1LzR1rDkwZIYaXyXg7yUUQJPDDcxznRbLJqYv/iHUFnuexOh/iR3srYt/N6fS+/Vnr8RqHmKOOnk5SxwfDSXHoPXC3KZ4T5soL2BYR4wGwg7b7vDib3iTDTjJc/wRU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593423; c=relaxed/simple; bh=R6vNDlxzpMjd4cvNhR1VF2VKpShfW1QT8piehDHAltc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lYxxYAGyhd9IxXjvLt/vSYuUE21b3CfSSNeIAGMkteo/JpknreOd8vo3o72cjX12PvRowIyzEqsLIUaTHu9evY75smdRkFu5izjImNcpTuoSTHXyEssMcgrS/671V9RkyXW+A+cyMZo0aMXNWumwHZL0wIUQXk8YVegC5Ey32fM= 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=iZhHQGwb; arc=none smtp.client-ip=148.163.156.1 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="iZhHQGwb" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48HAYVlU031830; Tue, 17 Sep 2024 17:16:51 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=MYiVufXi3qpzg AtUiMomcTpK4a9Yv9RJse/0tR7G80Q=; b=iZhHQGwbeC7GN32LXxlrms5ZIN1XH 5G0K0aZ8nEPojaP4oNSlIDAfsJ5zzUnshALC+cIejnRxgJYq4nKccMzXnah2yHHk kYxhM5IBSC3rhuJnWqzEcALKX15/6M6KAf9jL8tRfedX/OVfsKfc+dMgX5r7JH5O puRoUpO8L13nRfueTKHFIcx026CWz+Ptt0aGMCz/B5Qw2l8xIU9bGDgPd1mKz5G7 iaLuRiV9IEl325ormVGMmjPtKuvaHWxNiYKdzAhrUrsCEImt/0dqRKNr/Vn/qHyS HufwMfoknWChjgsNYUEhcSMEmxg61B3zbpogtb1X1DC1UvQoPrY+7RyCA== 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 41n3uj9h8g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:51 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HF6KR7000641; Tue, 17 Sep 2024 17:16:50 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 41nn716mxd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:50 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGnQF47317286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:49 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A6365805D; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D29A058068; Tue, 17 Sep 2024 17:16:48 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:48 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 05/15] fsi: core: Calculate local bus clock frequency Date: Tue, 17 Sep 2024 12:16:37 -0500 Message-ID: <20240917171647.1403910-6-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: cc3oy5Bgyjd3qEgzuQM9pP0lb9BcP-RK X-Proofpoint-GUID: cc3oy5Bgyjd3qEgzuQM9pP0lb9BcP-RK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=999 adultscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 suspectscore=0 mlxscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" Instead of a hardcoded local bus clock divider, calculate the responder local bus frequency from the FSI bus frequency. This will allow FSI engine drivers to set and calculate their bus (I2C, SPI, etc) frequencies. Signed-off-by: Eddie James --- drivers/fsi/fsi-core.c | 22 +++++++++++++++++++--- drivers/fsi/fsi-master.h | 1 + drivers/fsi/fsi-slave.h | 2 ++ include/linux/fsi.h | 1 + 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 3ddf518c6a19..1abbde4a9783 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -109,6 +109,12 @@ int fsi_device_peek(struct fsi_device *dev, void *val) return fsi_slave_read(dev->slave, addr, val, sizeof(uint32_t)); } =20 +unsigned long fsi_device_local_bus_frequency(struct fsi_device *dev) +{ + return dev->slave->master->clock_frequency / dev->slave->clock_div; +} +EXPORT_SYMBOL_GPL(fsi_device_local_bus_frequency); + static void fsi_device_release(struct device *_device) { struct fsi_device *device =3D to_fsi_dev(_device); @@ -209,12 +215,12 @@ static inline uint32_t fsi_smode_sid(int x) return (x & FSI_SMODE_SID_MASK) << FSI_SMODE_SID_SHIFT; } =20 -static uint32_t fsi_slave_smode(int id, u8 t_senddly, u8 t_echodly) +static uint32_t fsi_slave_smode(int id, int div, u8 t_senddly, u8 t_echodl= y) { return FSI_SMODE_WSC | FSI_SMODE_ECRC | fsi_smode_sid(id) | fsi_smode_echodly(t_echodly - 1) | fsi_smode_senddly(t_senddly - 1) - | fsi_smode_lbcrr(0x8); + | fsi_smode_lbcrr(div - 1); } =20 static int fsi_slave_set_smode(struct fsi_slave *slave, uint8_t id) @@ -225,7 +231,8 @@ static int fsi_slave_set_smode(struct fsi_slave *slave,= uint8_t id) /* set our smode register with the slave ID field to 0; this enables * extended slave addressing */ - smode =3D fsi_slave_smode(slave->id, slave->t_send_delay, slave->t_echo_d= elay); + smode =3D fsi_slave_smode(slave->id, slave->clock_div, slave->t_send_dela= y, + slave->t_echo_delay); data =3D cpu_to_be32(smode); =20 return fsi_master_write(slave->master, slave->link, id, FSI_SLAVE_BASE + = FSI_SMODE, @@ -950,6 +957,7 @@ static int fsi_slave_init(struct fsi_master *master, in= t link, uint8_t id) struct fsi_slave *slave; uint8_t crc; __be32 data, llmode, slbus; + u32 clock; int rc; =20 /* Currently, we only support single slaves on a link, and use the @@ -1003,6 +1011,7 @@ static int fsi_slave_init(struct fsi_master *master, = int link, uint8_t id) slave->dev.of_node =3D fsi_slave_find_of_node(master, link, id); slave->dev.release =3D fsi_slave_release; device_initialize(&slave->dev); + slave->clock_div =3D FSI_SMODE_LBCRR_DEFAULT; slave->cfam_id =3D cfam_id; slave->master =3D master; slave->link =3D link; @@ -1020,6 +1029,10 @@ static int fsi_slave_init(struct fsi_master *master,= int link, uint8_t id) =20 } =20 + if (master->clock_frequency && !device_property_read_u32(&slave->dev, "cl= ock-frequency", + &clock) && clock) + slave->clock_div =3D DIV_ROUND_UP(master->clock_frequency, clock); + slbus =3D cpu_to_be32(FSI_SLBUS_FORCE); rc =3D fsi_master_write(master, link, id, FSI_SLAVE_BASE + FSI_SLBUS, &slbus, sizeof(slbus)); @@ -1289,6 +1302,9 @@ int fsi_master_register(struct fsi_master *master) if (!dev_name(&master->dev)) dev_set_name(&master->dev, "fsi%d", master->idx); =20 + if (master->flags & FSI_MASTER_FLAG_SWCLOCK) + master->clock_frequency =3D 100000000; // POWER reference clock + master->dev.class =3D &fsi_master_class; =20 mutex_lock(&master->scan_lock); diff --git a/drivers/fsi/fsi-master.h b/drivers/fsi/fsi-master.h index a0d7ad0f0f7c..ff23983ea84c 100644 --- a/drivers/fsi/fsi-master.h +++ b/drivers/fsi/fsi-master.h @@ -121,6 +121,7 @@ =20 struct fsi_master { struct device dev; + unsigned long clock_frequency; int idx; int n_links; int flags; diff --git a/drivers/fsi/fsi-slave.h b/drivers/fsi/fsi-slave.h index 45190b06fa02..fabc0b66d5bf 100644 --- a/drivers/fsi/fsi-slave.h +++ b/drivers/fsi/fsi-slave.h @@ -48,6 +48,7 @@ #define FSI_SMODE_SD_DEFAULT 16 /* Default send delay */ #define FSI_SMODE_LBCRR_SHIFT 8 /* Clk ratio shift */ #define FSI_SMODE_LBCRR_MASK 0xf /* Clk ratio mask */ +#define FSI_SMODE_LBCRR_DEFAULT 2 /* Default clk ratio */ =20 /* * SISS fields @@ -104,6 +105,7 @@ struct fsi_slave { int id; /* FSI address */ int link; /* FSI link# */ u32 cfam_id; + u32 clock_div; int chip_id; uint32_t size; /* size of slave address space */ u8 t_send_delay; diff --git a/include/linux/fsi.h b/include/linux/fsi.h index 8c5eef808788..bf27b50652a5 100644 --- a/include/linux/fsi.h +++ b/include/linux/fsi.h @@ -24,6 +24,7 @@ extern int fsi_device_read(struct fsi_device *dev, uint32= _t addr, extern int fsi_device_write(struct fsi_device *dev, uint32_t addr, const void *val, size_t size); extern int fsi_device_peek(struct fsi_device *dev, void *val); +extern unsigned long fsi_device_local_bus_frequency(struct fsi_device *dev= ); =20 struct fsi_device_id { u8 engine_type; --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 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 A862518950D for ; Tue, 17 Sep 2024 17:17:04 +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=1726593426; cv=none; b=h2e39W0BTLc+rlJC115caEmVMhykTNsZaAWgfEw/lPxjyIBjJkiT3hYFgCAgWNbnq7lgZFftzkf5N0feb30Tzkqo/H/6SAFt2hWzFHs5Oc7Qgxs19PubVFo7B8Ss5exQmDLer0UuaBRQovBSnSPWhMFRhcjIp1Bs9aX34PB4MmY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593426; c=relaxed/simple; bh=S0auuSOh/oi04h/vbNPcg+E+3quYBQV0hgcbzxknLtc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V7v+5Z3F7wgf2itCvYJ2AJg2/V9tL0sjBFX/0AHXEBvAwQsnVW5m1A9OdusY2mwoOri0hT39RKrVMnjFkdrjP7Fw1oogatdcpD22f/ZxTBy1CbmfwAbjvJgO0noLjrEL8jZmEQv2EK9aoi7ITdQmC1tlEE5evh5InfDuxckQscc= 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=jMC9Md/m; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="jMC9Md/m" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48H905Wx006129; Tue, 17 Sep 2024 17:16:51 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=HgYlD5+Ra+xIx 1Im47aMRh3RzyMTiHzBaPtfxKNouIs=; b=jMC9Md/m8ue0tYEoUg3SXTeTzxKVJ PPxqH5710NISP6bOuX9IsuOmPsg1n4PTstrJ1Qmvl/lv7q/eGQb/JfX+/6jOImzc yQGkZPanaO+SqPA4JGqfILiySerC9SUJXXFbKGfoolgd3+3zceX/qsUIp+HONQ/S 6C/pzpmAgZekuUa5mcLwrhDywOCGrBKQ9sIKd7ChdFvz8fksjWWW150ZRVVC8/KK +u3UyJxnQc3EhPdM93y3IWPo69xgNTUegKxD5Xld9aT+tKT5DyfPXMOGTyvcxTlj DnRC6VLtcpbcdxzMeDK+WBKOw3oWjaO2SSQCk2pbFtm78KE79DEHGBr4g== 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 41n41agwbs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:50 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HGtiWB024672; Tue, 17 Sep 2024 17:16:50 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 41nq1mx7u7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:50 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGn5J49873244 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:49 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3D2CC58059; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11BB158062; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 06/15] fsi: core: Improve master read/write/error traces Date: Tue, 17 Sep 2024 12:16:38 -0500 Message-ID: <20240917171647.1403910-7-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Tqr49ybq_XUZw8o5MV3Vd8y-EgO4sWIV X-Proofpoint-ORIG-GUID: Tqr49ybq_XUZw8o5MV3Vd8y-EgO4sWIV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 suspectscore=0 mlxscore=0 mlxlogscore=740 bulkscore=0 impostorscore=0 phishscore=0 priorityscore=1501 spamscore=0 clxscore=1011 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" Consolidate the master read and write traces into one trace and change the result trace into an error trace for less spam. Signed-off-by: Eddie James --- drivers/fsi/fsi-core.c | 26 +++++---- include/trace/events/fsi.h | 112 ++++++++++++------------------------- 2 files changed, 51 insertions(+), 87 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 1abbde4a9783..5200078af8fd 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -1116,14 +1116,15 @@ static int fsi_master_read(struct fsi_master *maste= r, int link, { int rc; =20 - trace_fsi_master_read(master, link, slave_id, addr, size); - rc =3D fsi_check_access(addr, size); - if (!rc) + if (!rc) { rc =3D master->read(master, link, slave_id, addr, val, size); - - trace_fsi_master_rw_result(master, link, slave_id, addr, size, - false, val, rc); + if (rc) + trace_fsi_master_error(master->idx, link, slave_id, addr, size, val, rc, + true); + else + trace_fsi_master_xfer(master->idx, link, slave_id, addr, size, val, tru= e); + } =20 return rc; } @@ -1133,14 +1134,15 @@ static int fsi_master_write(struct fsi_master *mast= er, int link, { int rc; =20 - trace_fsi_master_write(master, link, slave_id, addr, size, val); - rc =3D fsi_check_access(addr, size); - if (!rc) + if (!rc) { rc =3D master->write(master, link, slave_id, addr, val, size); - - trace_fsi_master_rw_result(master, link, slave_id, addr, size, - true, val, rc); + if (rc) + trace_fsi_master_error(master->idx, link, slave_id, addr, size, val, rc, + false); + else + trace_fsi_master_xfer(master->idx, link, slave_id, addr, size, val, fal= se); + } =20 return rc; } diff --git a/include/trace/events/fsi.h b/include/trace/events/fsi.h index 5ff15126ad9d..fed8835f438e 100644 --- a/include/trace/events/fsi.h +++ b/include/trace/events/fsi.h @@ -8,101 +8,63 @@ =20 #include =20 -TRACE_EVENT(fsi_master_read, - TP_PROTO(const struct fsi_master *master, int link, int id, - uint32_t addr, size_t size), - TP_ARGS(master, link, id, addr, size), +TRACE_EVENT(fsi_master_xfer, + TP_PROTO(int master_idx, int link, int id, uint32_t addr, size_t size, co= nst void *data, + bool read), + TP_ARGS(master_idx, link, id, addr, size, data, read), TP_STRUCT__entry( - __field(int, master_idx) - __field(int, link) - __field(int, id) - __field(__u32, addr) - __field(size_t, size) + __field(int, master_idx) + __field(int, link) + __field(int, id) + __field(uint32_t, addr) + __field(int, size) + __field(uint32_t, data) + __field(bool, read) ), TP_fast_assign( - __entry->master_idx =3D master->idx; + __entry->master_idx =3D master_idx; __entry->link =3D link; __entry->id =3D id; __entry->addr =3D addr; - __entry->size =3D size; - ), - TP_printk("fsi%d:%02d:%02d %08x[%zu]", - __entry->master_idx, - __entry->link, - __entry->id, - __entry->addr, - __entry->size - ) -); - -TRACE_EVENT(fsi_master_write, - TP_PROTO(const struct fsi_master *master, int link, int id, - uint32_t addr, size_t size, const void *data), - TP_ARGS(master, link, id, addr, size, data), - TP_STRUCT__entry( - __field(int, master_idx) - __field(int, link) - __field(int, id) - __field(__u32, addr) - __field(size_t, size) - __field(__u32, data) - ), - TP_fast_assign( - __entry->master_idx =3D master->idx; - __entry->link =3D link; - __entry->id =3D id; - __entry->addr =3D addr; - __entry->size =3D size; + __entry->size =3D (int)size; __entry->data =3D 0; memcpy(&__entry->data, data, size); + __entry->read =3D read; ), - TP_printk("fsi%d:%02d:%02d %08x[%zu] <=3D {%*ph}", - __entry->master_idx, - __entry->link, - __entry->id, - __entry->addr, - __entry->size, - (int)__entry->size, &__entry->data - ) + TP_printk("fsi%d:%02d:%02d %s %08x {%*ph}", __entry->master_idx, __entry-= >link, + __entry->id, __entry->read ? "read" : "write", __entry->addr, __entry-= >size, + &__entry->data) ); =20 -TRACE_EVENT(fsi_master_rw_result, - TP_PROTO(const struct fsi_master *master, int link, int id, - uint32_t addr, size_t size, - bool write, const void *data, int ret), - TP_ARGS(master, link, id, addr, size, write, data, ret), +TRACE_EVENT(fsi_master_error, + TP_PROTO(int master_idx, int link, int id, uint32_t addr, size_t size, co= nst void *data, + int ret, bool read), + TP_ARGS(master_idx, link, id, addr, size, data, ret, read), TP_STRUCT__entry( - __field(int, master_idx) - __field(int, link) - __field(int, id) - __field(__u32, addr) - __field(size_t, size) - __field(bool, write) - __field(__u32, data) - __field(int, ret) + __field(int, master_idx) + __field(int, link) + __field(int, id) + __field(uint32_t, addr) + __field(int, size) + __field(uint32_t, data) + __field(int, ret) + __field(bool, read) ), TP_fast_assign( - __entry->master_idx =3D master->idx; + __entry->master_idx =3D master_idx; __entry->link =3D link; __entry->id =3D id; __entry->addr =3D addr; - __entry->size =3D size; - __entry->write =3D write; + __entry->size =3D (int)size; __entry->data =3D 0; - __entry->ret =3D ret; - if (__entry->write || !__entry->ret) + if (!read) memcpy(&__entry->data, data, size); + __entry->ret =3D ret; + __entry->read =3D read; ), - TP_printk("fsi%d:%02d:%02d %08x[%zu] %s {%*ph} ret %d", - __entry->master_idx, - __entry->link, - __entry->id, - __entry->addr, - __entry->size, - __entry->write ? "<=3D" : "=3D>", - (int)__entry->size, &__entry->data, - __entry->ret - ) + TP_printk("fsi%d:%02d:%02d %s %08x {%*ph} %d", __entry->master_idx, __ent= ry->link, + __entry->id, __entry->read ? "read" : "write", __entry->addr, __entry-= >size, + &__entry->data, __entry->ret) ); =20 TRACE_EVENT(fsi_master_break, --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 F11B417A918 for ; Tue, 17 Sep 2024 17:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593422; cv=none; b=Nc1HrNXjSwB/TY61TSGDmUH6SNBEFQF2Ju/2Q6ec1+0zVbf5C92cU/7ImQS7flW8OwnQZasJW72te3zwQ1k95HxM2JRuYrC8+xRoDYmD/W8B7E6OtBIhmfu0M4sXuiZgFsIcDgrZ6/sDwNfaNuw/XJMXrJWZgu5oTM/y91NhU8U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593422; c=relaxed/simple; bh=bkdsRhmgJqDVzC7XHM6BWMkO04lzz7E8Zz71sTsljlo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F+OzsBojS4DVONhF7gIlF/4qgjsKhsiP+zr/Zbn+PoFymPGw2hb5tD5SO31J8CIi2tD4zJ+CBjJckLmzFC01QdxE6V568rY53+IJ4tsZMgeqfDrYeZ1fRMFcuX6wvW6Eh4PXOXZe9jjo44DlML9kc5fhBiQl0X4Rl7ts+xLZdYA= 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=roCiRuUy; arc=none smtp.client-ip=148.163.156.1 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="roCiRuUy" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48HAWcAb007563; Tue, 17 Sep 2024 17:16:52 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=auvVqVcKz5YeE RFMqylcHHB6e1RaNYyOqCXDawt1Ph4=; b=roCiRuUyFUGWr6ImV6/5TXubK2Zqr z3aGTVX20e/n/fprdkTKCNWXHvUCn2T6DqOxqxD8wLXvWabO/U6rpKneO++9Bpor 5HOcLxyq/u4RtOZNaSvrUw72F/sljwdd7aHE9DTIoxGses+YvSuljL7DktR/i/LJ lZjBY8fV7A175V4XxDGNGkfhtViBQgRtnWIO0+yyp+7ycX7JvLhlQ2y3Hc5YwIKW CwkRNulFd38yszk7k+eEwJr6wOE8KS7SHboSUSShsgj8/cCDrqxA97TLnuy3FEdJ h7+Po+ZfugJ9dsfNXRHv5PriPuqaEOjbHHqOGqIA8hfTK+OGA0hZ7fo2A== 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 41n3vdhjrp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:51 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HFvnsl000731; Tue, 17 Sep 2024 17:16:50 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 41nntq6ern-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:50 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGnYR49021322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:49 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6791E58062; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 44A585805D; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 07/15] fsi: core: Add slave error trace Date: Tue, 17 Sep 2024 12:16:39 -0500 Message-ID: <20240917171647.1403910-8-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 0TwwxtEgLqv4PglX27NKUHu98DVfFiwN X-Proofpoint-GUID: 0TwwxtEgLqv4PglX27NKUHu98DVfFiwN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 clxscore=1015 mlxscore=0 malwarescore=0 mlxlogscore=791 priorityscore=1501 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" Trace out the FSI slave status and interrupt status. Signed-off-by: Eddie James --- drivers/fsi/fsi-core.c | 1 + include/trace/events/fsi.h | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 5200078af8fd..8ce187bbaf22 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -185,6 +185,7 @@ static int fsi_slave_report_and_clear_errors(struct fsi= _slave *slave) =20 dev_dbg(&slave->dev, "status: 0x%08x, sisc: 0x%08x\n", be32_to_cpu(stat), be32_to_cpu(irq)); + trace_fsi_slave_error(slave, be32_to_cpu(irq), be32_to_cpu(stat)); =20 /* clear interrupts */ return fsi_master_write(master, link, id, FSI_SLAVE_BASE + FSI_SISC, diff --git a/include/trace/events/fsi.h b/include/trace/events/fsi.h index fed8835f438e..5509afc98ee8 100644 --- a/include/trace/events/fsi.h +++ b/include/trace/events/fsi.h @@ -115,6 +115,25 @@ TRACE_EVENT(fsi_master_unregister, TP_printk("fsi%d (%d links)", __entry->master_idx, __entry->n_links) ); =20 +TRACE_EVENT(fsi_slave_error, + TP_PROTO(const struct fsi_slave *slave, uint32_t sisc, uint32_t sstat), + TP_ARGS(slave, sisc, sstat), + TP_STRUCT__entry( + __field(int, master_idx) + __field(int, link) + __field(uint32_t, sisc) + __field(uint32_t, sstat) + ), + TP_fast_assign( + __entry->master_idx =3D slave->master->idx; + __entry->link =3D slave->link; + __entry->sisc =3D sisc; + __entry->sstat =3D sstat; + ), + TP_printk("fsi%d:%02d sisc:%08x sstat:%08x", __entry->master_idx, __entry= ->link, + __entry->sisc, __entry->sstat) +); + TRACE_EVENT(fsi_slave_init, TP_PROTO(const struct fsi_slave *slave), TP_ARGS(slave), --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 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 125B2188A23 for ; Tue, 17 Sep 2024 17:17:03 +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=1726593425; cv=none; b=Jj3Z70tumR3W+5LFL8yytc3yuzF4RCWJu1ATCmyhz8ZwIkDRECYbQPsi+dDtMx9DW2j2YPBVagtRboLwRYNGPKDcYvn6wdU0kCNcdne6ixLg95NqxMLs92av6Ignpb5UlWg957VE2r+vBcT2YoL9JvkvAUc9baUu7x5dKjy/4eY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593425; c=relaxed/simple; bh=EKWfqaeq7NpDWzfi0whJPvRuRD+M+3iTC2yU70sQPdI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HCJdXwWTXV4wilh0OnHBQX1N4lOZPJm13uaZaQDZjDPlXxei82dJT/zMEBhP5RoXmUZcZEqPv+tBgbwF6DLdsj3GvpPu8MmNyEsQPgfWUnpUr2SwMK2AXY10usBKxQe6x68+Di24KhWYhLz1DAD3At89QAnAqstOFY2lVW3X++A= 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=VVzMlCbo; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="VVzMlCbo" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48H7tlwM030209; Tue, 17 Sep 2024 17:16:51 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=sV761vlSy4p44 1y09pi1WCNRwViJB3aPpG45NTlUP54=; b=VVzMlCboQIcu3ZS35pbR30/Nw+ovK ui8g6ho/jXvHbXGACanhXMMJmPZ2U1QaEby89ck9VScx/SukNngWkfVheK1YQpzh /PUzGQ3J/KVEZYm+E4hXtL2yTcleQJG2tOQmR0hibsbjBTSPCnwd1TICJ05a0BAa aIVS4nNyF8qdMHpaQLqNF/8KCt5cVNxI3IFNf+VPxFthk33CI8uTYhkcBwCXbp7f 6PGmOzKpHSkwQDuSY3bIQxCEZGphqNhmp8FUh4rQfcFVyYp6i5dGGLOckejnsnJG 7SWAnJOQSnqcMThmFXZuXZBF7fJ12Ks2/pGAXsfUeLXb6Fh27PkqyZHjQ== 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 41pht8gf1w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:51 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HGjMLx025044; Tue, 17 Sep 2024 17:16:50 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 41nq1mx7ua-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:50 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGnQj36045262 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:49 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A3FA158058; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7857058065; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 08/15] fsi: core: Reset errors instead of clearing interrupts Date: Tue, 17 Sep 2024 12:16:40 -0500 Message-ID: <20240917171647.1403910-9-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: kMpBuDM1E9wFY5eOZKpsEKVg6gdDFhsE X-Proofpoint-ORIG-GUID: kMpBuDM1E9wFY5eOZKpsEKVg6gdDFhsE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 adultscore=0 mlxlogscore=857 mlxscore=0 clxscore=1015 malwarescore=0 spamscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" 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 8ce187bbaf22..53d61ea46a4f 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 =3D slave->master; - __be32 irq, stat; + __be32 irq, reset, stat; int rc, link; uint8_t id; =20 @@ -187,9 +187,10 @@ static int fsi_slave_report_and_clear_errors(struct fs= i_slave *slave) be32_to_cpu(stat), be32_to_cpu(irq)); trace_fsi_slave_error(slave, be32_to_cpu(irq), be32_to_cpu(stat)); =20 - /* clear interrupts */ - return fsi_master_write(master, link, id, FSI_SLAVE_BASE + FSI_SISC, - &irq, sizeof(irq)); + /* reset errors */ + reset =3D cpu_to_be32(FSI_SRES_ERRS); + return fsi_master_write(master, link, id, FSI_SLAVE_BASE + FSI_SRES, &res= et, + sizeof(reset)); } =20 /* Encode slave local bus echo delay */ diff --git a/drivers/fsi/fsi-slave.h b/drivers/fsi/fsi-slave.h index fabc0b66d5bf..e9fd4be6f376 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 */ =20 +/* + * SRES fields + */ +#define FSI_SRES_ERRS 0x40000000 /* Reset FSI slave errors */ + /* * LLMODE fields */ --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 6D6BB17C98A for ; Tue, 17 Sep 2024 17:17:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593423; cv=none; b=FvsZvMLE6yuvM65z/ArgdJMIPg4wBvBseNKBZmQQbzDpsF65fVf4kVOM3jxVuJalTA1BhfpJ4naH1hSrnKgiLhodDuu6VHJ9VJdQ5DYPVW56gVOW3cpxMhpOPn/sF6E1qE/K3u+e7KSDM7EOR1jvIVXPQOXTLdkQYfjJV9qZwBA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593423; c=relaxed/simple; bh=/nIB/QSSATM8hY+vOeI+bRFa7+zFuBKnc45geBoPBMc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aji4/Y4Cxa4HB2LsbACxkpSCUTKGVfcinhASnTHxAF/nRiDQdRo+zWNG2WNDSWREYzivnnnu8dwqIeHhSwbCGa/1iUOkAqvpyXH0zQtyqWGSoGnzVerFjl7Dcj1anocM1DaKrhUjvUU9mWJQAqVGa4azI22uRXaDTUtYDFT81uM= 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=pXFvitiM; arc=none smtp.client-ip=148.163.156.1 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="pXFvitiM" Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48H8p1lv023532; Tue, 17 Sep 2024 17:16:52 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=fPZ8BVVO6vmpc HjuevIah+NTe3Dl5evEWfNVLAjy8SI=; b=pXFvitiMYjG5zAxI5LpBaCCA2QRTt +/WlW6CJ4BQnC1X0GnlFZ8Iy0OPttKt9P70M70Xou+/hbv1isAclbXh22oCHkgT3 98yU2MisDSXWfSswmBTJL+JYUzUXATh3PUlzMVF0SbO1C5zvU2votzXXct4O5frU LCc2GCeoQHdC7+k3JK8SqhYp0ufRAm1yPTwD2q/uHTu3CmWC2+lOZmizwk2g9Pdb 2LJoPXSs6wr270gvD9oB+EAoPvRNcNR99PB0Z8W0lluDsMbYaRlZBD9Zif7zkFd/ jDeJSwP2SuC6/oR3C/zOwDEMwUsKaXTp0ZV8u9vH9YH86WvgQcenRNREg== 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 41n3ud9hgk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:52 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HFhBrZ001184; Tue, 17 Sep 2024 17:16:51 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 41nntq6erp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:50 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGncI49021326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:50 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D71B258057; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AAE3E58061; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 09/15] fsi: core: Add slave spinlock Date: Tue, 17 Sep 2024 12:16:41 -0500 Message-ID: <20240917171647.1403910-10-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Pnwa12ELFhFQJXCw-d2TR3cctcfKhf8z X-Proofpoint-ORIG-GUID: Pnwa12ELFhFQJXCw-d2TR3cctcfKhf8z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 phishscore=0 impostorscore=0 spamscore=0 priorityscore=1501 suspectscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=961 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" FSI slave operations were not locked, meaning that during slave error recovery operations, other slave accesses may take place, resulting in incorrect recovery and additional errors. Make the slave access and error recovery atomic with a spinlock. Don't use a mutex for future interrupt handling support. Signed-off-by: Eddie James --- drivers/fsi/fsi-core.c | 7 +++++++ drivers/fsi/fsi-slave.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 53d61ea46a4f..eea5bbdb00b6 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -304,6 +304,7 @@ static int fsi_slave_handle_error(struct fsi_slave *sla= ve, bool write, int fsi_slave_read(struct fsi_slave *slave, uint32_t addr, void *val, size_t size) { + unsigned long flags; uint8_t id =3D slave->id; int rc, err_rc, i; =20 @@ -311,6 +312,7 @@ int fsi_slave_read(struct fsi_slave *slave, uint32_t ad= dr, if (rc) return rc; =20 + spin_lock_irqsave(&slave->lock, flags); for (i =3D 0; i < slave_retries; i++) { rc =3D fsi_master_read(slave->master, slave->link, id, addr, val, size); @@ -321,6 +323,7 @@ int fsi_slave_read(struct fsi_slave *slave, uint32_t ad= dr, if (err_rc) break; } + spin_unlock_irqrestore(&slave->lock, flags); =20 return rc; } @@ -329,6 +332,7 @@ EXPORT_SYMBOL_GPL(fsi_slave_read); int fsi_slave_write(struct fsi_slave *slave, uint32_t addr, const void *val, size_t size) { + unsigned long flags; uint8_t id =3D slave->id; int rc, err_rc, i; =20 @@ -336,6 +340,7 @@ int fsi_slave_write(struct fsi_slave *slave, uint32_t a= ddr, if (rc) return rc; =20 + spin_lock_irqsave(&slave->lock, flags); for (i =3D 0; i < slave_retries; i++) { rc =3D fsi_master_write(slave->master, slave->link, id, addr, val, size); @@ -346,6 +351,7 @@ int fsi_slave_write(struct fsi_slave *slave, uint32_t a= ddr, if (err_rc) break; } + spin_unlock_irqrestore(&slave->lock, flags); =20 return rc; } @@ -1007,6 +1013,7 @@ static int fsi_slave_init(struct fsi_master *master, = int link, uint8_t id) if (!slave) return -ENOMEM; =20 + spin_lock_init(&slave->lock); dev_set_name(&slave->dev, "slave@%02x:%02x", link, id); slave->dev.type =3D &cfam_type; slave->dev.parent =3D &master->dev; diff --git a/drivers/fsi/fsi-slave.h b/drivers/fsi/fsi-slave.h index e9fd4be6f376..0468ec1c60db 100644 --- a/drivers/fsi/fsi-slave.h +++ b/drivers/fsi/fsi-slave.h @@ -6,6 +6,7 @@ =20 #include #include +#include =20 #define FSI_SLAVE_BASE 0x800 =20 @@ -107,6 +108,7 @@ struct fsi_slave { struct device dev; struct fsi_master *master; struct cdev cdev; + spinlock_t lock; /* atomic access and error recovery */ int cdev_idx; int id; /* FSI address */ int link; /* FSI link# */ --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 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 6B6BD18D64D for ; Tue, 17 Sep 2024 17:17:06 +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=1726593428; cv=none; b=GJd5uQPwvPyDot29eiwDSbUehLT8SaU0yRJevF1oOLzI8a8B+wTesAn2w9chPOG5DwLokrYPPujYeo+8SHdA3LZlHXCNam6cWnrF7fxv9skg2GezbMNwdt+ZoienR4CvR0byl0qtq65bfkdwAPbrfzJFhhAV4N5Pu18+PqI9e4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593428; c=relaxed/simple; bh=aDmN+JDJ2BIpO+GaUDF44DoE6sgvIZY/19vRTtDzI1Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nzjTbSCVk0Ue0/wFw0rZieQ256gWHeSiz4p7kXFIcjL517c7Q82T2twSINyQc7RUH5kmFkIRX+jtSlyhyvxD69Ieb8OHnEyBSdytiTvWptfGyNWXfNT2jAMLTmmhlNtYkJZgua9qdasPK6OY+HrYnDFFyoIenVvpkJ4pEiImX4g= 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=FdpkyxSx; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="FdpkyxSx" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48H8NeA0031131; Tue, 17 Sep 2024 17:16:52 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=0FCe65XpXW3TT 8WBepFrTafqyrJDuXoxXws8M69C6rQ=; b=FdpkyxSx2b6T0gullaxtchAQNcAn6 WQCGEKQxkkDW8k0d9DDrjgXTChfhnS45xFiE+54JN5kYOFHXMTDmR21KwSOUsAOT vGS2nSmoX0G5WN+yLexNpxrAOlk+XNL+LZMmnSVFQFuPPOZDPdOfz4MeiZu3WadZ Z8fdsrm/BhvbL6CISqmMJCjJ1+NZtPQ3/KHkfFNf3JuleBOmauJkkKUlCt6yRJjR zGAHpaJOqJ4gxvmyax3kcInfYwhbOSHys18h8MIRpoPIlPU2gmuYOqsVphq358XT +/UeBXdlBi4Nsk16j4/1FiRDtqB7D1kPJhAfSkl5ofMJx/7uLQScNYsbw== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 41n3vnrxu4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:51 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HF9XOD001918; Tue, 17 Sep 2024 17:16:50 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 41nmtupq76-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:50 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGosT61210934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:50 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 15BB158057; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DE18E58058; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:49 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 10/15] fsi: core: Allow cfam device type aliases Date: Tue, 17 Sep 2024 12:16:42 -0500 Message-ID: <20240917171647.1403910-11-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: N6BNQRlsPRh9CR984pyBHIAXiBqqzU2n X-Proofpoint-GUID: N6BNQRlsPRh9CR984pyBHIAXiBqqzU2n X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 clxscore=1015 malwarescore=0 bulkscore=0 impostorscore=0 spamscore=0 suspectscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" Other FSI devices can uses aliases for the device numbering, so modify the function to get a new minor to allow the cfam type to use aliases too. Signed-off-by: Eddie James --- drivers/fsi/fsi-core.c | 59 +++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index eea5bbdb00b6..7e73dd035b4e 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -884,12 +884,37 @@ static int fsi_adjust_index(int index) #endif } =20 -static int __fsi_get_new_minor(struct fsi_slave *slave, enum fsi_dev_type = type, - dev_t *out_dev, int *out_index) +static const char *const fsi_dev_type_names[] =3D { + "cfam", + "sbefifo", + "scom", + "occ", +}; + +static int __fsi_get_new_minor(struct fsi_slave *slave, struct device_node= *np, + enum fsi_dev_type type, dev_t *out_dev, int *out_index) { int cid =3D slave->chip_id; int id; =20 + if (np && type < 4) { + int aid =3D of_alias_get_id(np, fsi_dev_type_names[type]); + + if (aid >=3D 0) { + /* Use the same scheme as the legacy numbers. */ + id =3D (aid << 2) | type; + id =3D ida_alloc_range(&fsi_minor_ida, id, id, GFP_KERNEL); + if (id >=3D 0) { + *out_index =3D aid; + *out_dev =3D fsi_base_dev + id; + return 0; + } + + if (id !=3D -ENOSPC) + return id; + } + } + /* Check if we qualify for legacy numbering */ if (cid >=3D 0 && cid < 16 && type < 4) { /* @@ -918,36 +943,10 @@ static int __fsi_get_new_minor(struct fsi_slave *slav= e, enum fsi_dev_type type, return 0; } =20 -static const char *const fsi_dev_type_names[] =3D { - "cfam", - "sbefifo", - "scom", - "occ", -}; - int fsi_get_new_minor(struct fsi_device *fdev, enum fsi_dev_type type, dev_t *out_dev, int *out_index) { - if (fdev->dev.of_node) { - int aid =3D of_alias_get_id(fdev->dev.of_node, fsi_dev_type_names[type]); - - if (aid >=3D 0) { - /* Use the same scheme as the legacy numbers. */ - int id =3D (aid << 2) | type; - - id =3D ida_alloc_range(&fsi_minor_ida, id, id, GFP_KERNEL); - if (id >=3D 0) { - *out_index =3D aid; - *out_dev =3D fsi_base_dev + id; - return 0; - } - - if (id !=3D -ENOSPC) - return id; - } - } - - return __fsi_get_new_minor(fdev->slave, type, out_dev, out_index); + return __fsi_get_new_minor(fdev->slave, fdev->dev.of_node, type, out_dev,= out_index); } EXPORT_SYMBOL_GPL(fsi_get_new_minor); =20 @@ -1059,7 +1058,7 @@ static int fsi_slave_init(struct fsi_master *master, = int link, uint8_t id) } =20 /* Allocate a minor in the FSI space */ - rc =3D __fsi_get_new_minor(slave, fsi_dev_cfam, &slave->dev.devt, + rc =3D __fsi_get_new_minor(slave, slave->dev.of_node, fsi_dev_cfam, &slav= e->dev.devt, &slave->cdev_idx); if (rc) goto err_free; --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 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 127E3188A26 for ; Tue, 17 Sep 2024 17:17:03 +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=1726593425; cv=none; b=r9yatNQdo9VuwNfEDDqfJCORISFTtjz0HoefiDJOrSG+SkWbVUZK7m8mJ1SiPpBYR8ac+povS8UFMxF8qMAYQY4WrYtpeeiYRMn+pTolNSU3yDHT3pzvpbapdeAA+oDpOm4BezYgZx+a/qc8DVuYpsnnA2CqEpet+oeCcZ2N4LY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593425; c=relaxed/simple; bh=6TdFma9aRy1vcP8LH45ag4P1Opkky2758LJqc9/2hLo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qrtRPyez8axvibas3mNV+cUROgdKmZVn/e+uyeYUE0v8LnVmbw58o09Wd60c6WSTmk28BxUXOSJ+aWbrEg+c9x2/64Iac7H5wusH2olbE5Ehjlj2ZEoH0diUpZxRonAReUsacJO4U7QKK9tH3iC3hbYgEfcJtCGXORfs1y6hq18= 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=LsWCpker; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="LsWCpker" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48H8eXLc006164; Tue, 17 Sep 2024 17:16:52 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=ugH+Qd7xUHLQ4 eYpCxT7RB/vaTjhXjlfHzuz5ZAN7KM=; b=LsWCpkerLjYWLmLPgjLX4C6Wu7KY3 tHgCLMF+DD9J+IjQZi4PHdXWiusziFkiQZ6f5g7Bhlc9JZo/O9/vFAhE5OgfXEOy 0PFy1vCrwwdRVwZYsa3togdYeVo0xP9Osa3M+b8Dr42lzG6NhMSewcwb9KKhq+Sr Wa5bypiO+/8a3t9n6YMuzvEW0eDVluFJ29gIIRx+bWIlPQY2te0kgDLoqmd/M+66 FuWebWCzH/A/aJQXK3kH0zOc4YWdBxu1ZZMOnZZzQsF3vYmbjNqB5tp+tieCDpPN zVELhPLZEp8/JYh+yccCtKGQ5a1zZhGqnA1/FiwFJX93AzGjAdWb711BQ== 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 41n41agwbw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:51 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HGVuB2025033; Tue, 17 Sep 2024 17:16:51 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 41nq1mx7ub-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:51 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGoqr61210936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:50 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 52B3158057; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1D52B58059; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 11/15] fsi: scom: Update compatible string to match documentation Date: Tue, 17 Sep 2024 12:16:43 -0500 Message-ID: <20240917171647.1403910-12-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: jUQHSJwwGJUFDCWuhjLVw1fatHYw2O5x X-Proofpoint-ORIG-GUID: jUQHSJwwGJUFDCWuhjLVw1fatHYw2O5x X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 suspectscore=0 mlxscore=0 mlxlogscore=879 bulkscore=0 impostorscore=0 phishscore=0 priorityscore=1501 spamscore=0 clxscore=1015 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" Use p9-scom instead of fsi2pib. Signed-off-by: Eddie James Reviewed-by: Ninad Palsule --- drivers/fsi/fsi-scom.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c index 411ddc018cd8..8f27bccb8746 100644 --- a/drivers/fsi/fsi-scom.c +++ b/drivers/fsi/fsi-scom.c @@ -590,6 +590,7 @@ static int scom_remove(struct device *dev) =20 static const struct of_device_id scom_of_ids[] =3D { { .compatible =3D "ibm,fsi2pib" }, + { .compatible =3D "ibm,p9-scom" }, { } }; MODULE_DEVICE_TABLE(of, scom_of_ids); --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 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 242F21925A5 for ; Tue, 17 Sep 2024 17:17:07 +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=1726593429; cv=none; b=YMezZ+lC4iL4fYakkG2zOR1RIBAa+e9Sv5GgXAZloaqCkredeGxpeQRZVEcS0tkkL+a1xgIEzIDmvN01bBSWlTcwPfjAflexLLQK+LPCCwL2mzah0E3kv6/tgLt2VuwOCmcRX5DwuN0E+pWQK/5Wxon+kjae4sMOLKTGRg0BBMk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593429; c=relaxed/simple; bh=+yJC/p6XNwewOkXIWJWuYKfwRHsUv8ia1k7GVdBmPaY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QRecA9yOdGWU9YvPbVHYQNt5vOkEbWZjnqgps9aTGALyYumkkN24s7hE9z6bFJ3U4jmIvQGXfIykk85az0ycwjibhwQ0fwcjr9SO+ycaslgdEl0kwJ9u3yeGtixFYZbJ44325EXrB9m6lKabBwtZA/5a/OC884bvSps5AYo/WNg= 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=LstmdZ7h; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="LstmdZ7h" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48HA55GU031215; Tue, 17 Sep 2024 17:16:52 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=7UOjM9K8xNlhd u9GjXxWAossWVeWr/0FC+3SauZ3KMg=; b=LstmdZ7hKQzE0BDuNWHYa+BgQnxWa VjyeT4IMapTogyWp6ZMemlq5nhOZQqoc7neGuPo38YfihoZgBSsE4Ux9S6wArnl2 tBaeCxwm++00KvQZ++/Z14y5O+fcqIX/gDYtC4KZTz+lvJC1Xz0qOR3EsOtbdzsu ovMHPk6Y19PAjLe2SQR4GkeV4sovntCkK5IwdA8+9FlTNY7Axv3LAWMdENP7q5k6 Lvjl7cTiuLW9051mt5ThsWt7xlr3EhYQMZ7FQS9cXSjKovfKdgYu5mWoiSPiH0XC wxF02jafW2ZV06R3SugSp7UVx9+EOoyizYYozI/A7fIuo6CVPmOpssYWQ== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 41n3vnrxu5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:52 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HH3YhA001819; Tue, 17 Sep 2024 17:16:51 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 41nqh3p4mw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:51 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGoG352756762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:50 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 86E5958057; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A0FF5805D; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 12/15] fsi: occ: Get device number from FSI minor number API Date: Tue, 17 Sep 2024 12:16:44 -0500 Message-ID: <20240917171647.1403910-13-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: s773dODt-BaGlUrBsUJc_gph7jvhBMIa X-Proofpoint-GUID: s773dODt-BaGlUrBsUJc_gph7jvhBMIa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 clxscore=1015 malwarescore=0 bulkscore=0 impostorscore=0 spamscore=0 suspectscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" Remove the IDA indexing for OCC devices and instead use the FSI minor number API. This will make the OCC numbering consistent with other FSI engines and make the "reg" device tree property unnecessary. Signed-off-by: Eddie James Reviewed-by: Ninad Palsule --- drivers/fsi/fsi-occ.c | 48 ++++++++++--------------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c index f58b158d097c..11e090da0590 100644 --- a/drivers/fsi/fsi-occ.c +++ b/drivers/fsi/fsi-occ.c @@ -4,9 +4,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -44,6 +44,7 @@ struct occ { struct device *sbefifo; char name[32]; int idx; + dev_t devt; bool platform_hwmon; u8 sequence_number; void *buffer; @@ -75,8 +76,6 @@ struct occ_client { =20 #define to_client(x) container_of((x), struct occ_client, xfr) =20 -static DEFINE_IDA(occ_ida); - static int occ_open(struct inode *inode, struct file *file) { struct occ_client *client =3D kzalloc(sizeof(*client), GFP_KERNEL); @@ -622,7 +621,6 @@ static int occ_unregister_of_child(struct device *dev, = void *data) static int occ_probe(struct platform_device *pdev) { int rc; - u32 reg; char child_name[32]; struct occ *occ; struct platform_device *hwmon_dev =3D NULL; @@ -637,6 +635,10 @@ static int occ_probe(struct platform_device *pdev) if (!occ) return -ENOMEM; =20 + rc =3D fsi_get_new_minor(to_fsi_dev(dev->parent), fsi_dev_occ, &occ->devt= , &occ->idx); + if (rc) + return rc; + /* SBE words are always four bytes */ occ->buffer =3D kvmalloc(OCC_MAX_RESP_WORDS * 4, GFP_KERNEL); if (!occ->buffer) @@ -651,23 +653,6 @@ static int occ_probe(struct platform_device *pdev) */ occ->sequence_number =3D (u8)((jiffies % 0xff) + 1); mutex_init(&occ->occ_lock); - - if (dev->of_node) { - rc =3D of_property_read_u32(dev->of_node, "reg", ®); - if (!rc) { - /* make sure we don't have a duplicate from dts */ - occ->idx =3D ida_alloc_range(&occ_ida, reg, reg, - GFP_KERNEL); - if (occ->idx < 0) - occ->idx =3D ida_alloc_min(&occ_ida, 1, - GFP_KERNEL); - } else { - occ->idx =3D ida_alloc_min(&occ_ida, 1, GFP_KERNEL); - } - } else { - occ->idx =3D ida_alloc_min(&occ_ida, 1, GFP_KERNEL); - } - platform_set_drvdata(pdev, occ); =20 snprintf(occ->name, sizeof(occ->name), "occ%d", occ->idx); @@ -679,7 +664,7 @@ static int occ_probe(struct platform_device *pdev) rc =3D misc_register(&occ->mdev); if (rc) { dev_err(dev, "failed to register miscdevice: %d\n", rc); - ida_free(&occ_ida, occ->idx); + fsi_free_minor(occ->devt); kvfree(occ->buffer); return rc; } @@ -718,7 +703,9 @@ static void occ_remove(struct platform_device *pdev) else device_for_each_child(&pdev->dev, NULL, occ_unregister_of_child); =20 - ida_free(&occ_ida, occ->idx); + fsi_free_minor(occ->devt); + + return 0; } =20 static const struct of_device_id occ_match[] =3D { @@ -743,20 +730,7 @@ static struct platform_driver occ_driver =3D { .remove_new =3D occ_remove, }; =20 -static int occ_init(void) -{ - return platform_driver_register(&occ_driver); -} - -static void occ_exit(void) -{ - platform_driver_unregister(&occ_driver); - - ida_destroy(&occ_ida); -} - -module_init(occ_init); -module_exit(occ_exit); +module_platform_driver(occ_driver); =20 MODULE_AUTHOR("Eddie James "); MODULE_DESCRIPTION("BMC P9 OCC driver"); --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 9706417C990 for ; Tue, 17 Sep 2024 17:17:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593423; cv=none; b=CXywNwrcfAg+eE+uM3YjqvUlRetD8xCTQdwbe7n8cQAflBAWXdKF35ugWD2/HwKNBwLKdGZfIbD4WN9I3tc5x9mRAwlb2nDtYu+t6oS/1IXs+xTZSYEyicMQ50QKYDKsAhnkyCC/tZeM+UjCRF80/TYeXSSxWeHhCsKDm2o1ww0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593423; c=relaxed/simple; bh=1FBUfSTRFuIYcIz20ZV+CA40A8SSn7fVyJHHIUcqmN8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DwPCmJkqZysWrA495zy4AHEztjd2vERabT1ROaUHpacaZqOzydMBYlx5MsA3rX2uprJbIyVwVeHUnlXF2dVh8LOUh3vPpFK/uB9e4enZ/99eOec68wzVGKee2UtDV8RU4m/ffAlFN05s2X+ZLeumn6zdjPunE1j3R2nheTwvHM0= 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=kkVbzZ4H; arc=none smtp.client-ip=148.163.156.1 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="kkVbzZ4H" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48H8i76L007562; Tue, 17 Sep 2024 17:16:52 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=lT2Rd3p9atLYr Vb3Pbl+bWcgfVo3Dh6J68otSjumcF4=; b=kkVbzZ4HN/xfLiTU6GJtyodwxFMac cbtN5tNYrddF8HfQLacfDWLt2bJ/dY1Nh7tNErzWkkSPD5o26VrRrPAJgvXxzfw9 6P00FGLGoFwbgejE9eBTOktnNK5HXEagkauTsy9+CnyJrHaYx9I/lEmAmcGBHpKz czTsajWcM9qa2s3krTEHqkc2yiKKg1XysVVSd/x9RNJdVEDUcG+ax6fljz9hCTLs fXDjzmyf+dp74hp1gLoXMuk2zeZh/G0f2thkoFu42qVYTvJkLTRUJev3Wy08BV9C E5C4AjUpZgrF2ph2CGSlEQM/VcmvauFfyZ0WtORpEJXKOM6zHvxRs6oHA== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 41n3vdhjrr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:52 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HF9XOE001918; Tue, 17 Sep 2024 17:16:51 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 41nmtupq78-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:51 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGoqf52756764 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:50 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C3B8C5805D; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E39E58061; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 13/15] fsi: occ: Find next available child rather than node name match Date: Tue, 17 Sep 2024 12:16:45 -0500 Message-ID: <20240917171647.1403910-14-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: CfJoqX0oFJjTMocOaOjFpp9pcJgDuwK2 X-Proofpoint-GUID: CfJoqX0oFJjTMocOaOjFpp9pcJgDuwK2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 clxscore=1015 mlxscore=0 malwarescore=0 mlxlogscore=723 priorityscore=1501 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" There's no reason to restrict the creation of the hwmon device to a matching child node name. Just get the first available one. There should only be one child node anyway. Signed-off-by: Eddie James Reviewed-by: Ninad Palsule --- drivers/fsi/fsi-occ.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c index 11e090da0590..d3feba43c029 100644 --- a/drivers/fsi/fsi-occ.c +++ b/drivers/fsi/fsi-occ.c @@ -669,7 +669,7 @@ static int occ_probe(struct platform_device *pdev) return rc; } =20 - hwmon_node =3D of_get_child_by_name(dev->of_node, hwmon_dev_info.name); + hwmon_node =3D of_get_next_available_child(dev->of_node, NULL); if (hwmon_node) { snprintf(child_name, sizeof(child_name), "%s.%d", hwmon_dev_info.name, o= cc->idx); hwmon_dev =3D of_platform_device_create(hwmon_node, child_name, dev); --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 77A7C17C99B for ; Tue, 17 Sep 2024 17:17:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593424; cv=none; b=lYqLl4wyIAWGg72l8kM7Jp3lmzjBzEtV9t5Rf2rlyA7mYm17ZKoOUslZcOc21t6DF1JUAmPbhzm4gXWGqv+CoD1bICJdCanMDzmNk7+21KiblFT+20nBcufkwSF5quKjcyqWLUWWv7e9R6t3/iZjXbw4zS3NFF7pEJ/2OSORBl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593424; c=relaxed/simple; bh=B59B1hvMFhQ4pRxzqnm4r9AC0CPE1pZ7ayekXS9/wSU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mpqPkWgfGL4wfZREu6PBbGzfC9S6BWEseyOt8agYwQ0H8/TQvL8upJWHBWNNVSyFy5yYt5cGxnKwp8IeqLz531lEbMCysm7tzVXOzheAm5U7CBqnkMa6iWQ/Q3Pz6mCZJhwXsShsY73CwK2NSthVCmiB/jVK2dJ19CnWbDkh7r8= 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=Peye8FGv; arc=none smtp.client-ip=148.163.156.1 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Peye8FGv" Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48HA0XeR022514; Tue, 17 Sep 2024 17:16:53 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=1VCxXdruCaUDQ BMQk8TopRbIOf+wHKRxlSwLZu4+S64=; b=Peye8FGvA3ZnDJlizp0wO42+kX+ud tGwqf5nh696e9Zf0wlGxIQN665pa4DSpYAe0C3ziYjYEwGnjcgB6i5XpjbU1ef8l jNT/+DsyWJ+YdxPNxbs0Mq/H8H1mBxHhtc9RMzFmbWZhKgkwuAXWoJy4sgqRit/E HVmbyXoIAnOHAEYYWn2Amu7PcVFlI+XetLI2PwMyW2ivozcdDKvI3BEmRpeiwJiJ ZJEwBAgHxaBRdW89aSgniIIYwcmZ1yVUQNN2oq1JDV2Wc9Gr0RP7zRy8QBW3idgH +Bb6bNU/k4Fwsk5TjdkJWif/bhLBSJ7o4RA3lurLQEQ9oDXXLDi2uCBtQ== 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 41n3ud9hgp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:53 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HFvnsm000731; Tue, 17 Sep 2024 17:16:52 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 41nntq6eru-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:52 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGpcs42336750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:51 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0296C58058; Tue, 17 Sep 2024 17:16:51 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CAD7258062; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 14/15] fsi: sbefifo: Prevent async FFDC collection for Odyssey SBEFIFOs Date: Tue, 17 Sep 2024 12:16:46 -0500 Message-ID: <20240917171647.1403910-15-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 1RVPjz0OFHe79Lb0cStWP9LKROMqZene X-Proofpoint-ORIG-GUID: 1RVPjz0OFHe79Lb0cStWP9LKROMqZene X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 phishscore=0 impostorscore=0 spamscore=0 priorityscore=1501 suspectscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" Newer SBEs will return any async FFDC in the next transaction, so collecting the FFDC is unnecessary and results in unexpected behavior. Turn off the async collection for newer SBEFIFOs. Signed-off-by: Eddie James --- drivers/fsi/fsi-sbefifo.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c index 0385476bfb03..b8add20e05ec 100644 --- a/drivers/fsi/fsi-sbefifo.c +++ b/drivers/fsi/fsi-sbefifo.c @@ -125,6 +125,7 @@ struct sbefifo { struct mutex lock; bool broken; bool dead; + bool need_async; bool async_ffdc; bool timed_out; u32 timeout_in_cmd_ms; @@ -141,6 +142,10 @@ struct sbefifo_user { u32 read_timeout_ms; }; =20 +struct sbefifo_data { + bool need_async; +}; + static DEFINE_MUTEX(sbefifo_ffdc_mutex); =20 static ssize_t timeout_show(struct device *dev, struct device_attribute *a= ttr, @@ -317,6 +322,10 @@ static int sbefifo_check_sbe_state(struct sbefifo *sbe= fifo) return -ESHUTDOWN; } =20 + /* Newer SBEFIFOs don't need async FFDC collection */ + if (!sbefifo->need_async) + return 0; + /* Is there async FFDC available ? Remember it */ if (sbm & CFAM_SBM_SBE_ASYNC_FFDC) sbefifo->async_ffdc =3D true; @@ -1031,6 +1040,7 @@ static void sbefifo_free(struct device *dev) =20 static int sbefifo_probe(struct device *dev) { + const struct sbefifo_data *md =3D of_device_get_match_data(dev); struct fsi_device *fsi_dev =3D to_fsi_dev(dev); struct sbefifo *sbefifo; struct device_node *np; @@ -1044,6 +1054,11 @@ static int sbefifo_probe(struct device *dev) if (!sbefifo) return -ENOMEM; =20 + if (md) + sbefifo->need_async =3D md->need_async; + else + sbefifo->need_async =3D true; + /* Grab a reference to the device (parent of our cdev), we'll drop it lat= er */ if (!get_device(dev)) { kfree(sbefifo); @@ -1128,6 +1143,27 @@ static int sbefifo_remove(struct device *dev) return 0; } =20 +static const struct sbefifo_data p9_sbefifo_data =3D { + .need_async =3D true, +}; + +static const struct sbefifo_data odyssey_sbefifo_data =3D { + .need_async =3D false, +}; + +static const struct of_device_id sbefifo_of_ids[] =3D { + { + .compatible =3D "ibm,p9-sbefifo", + .data =3D &p9_sbefifo_data, + }, + { + .compatible =3D "ibm,odyssey-sbefifo", + .data =3D &odyssey_sbefifo_data, + }, + { } +}; +MODULE_DEVICE_TABLE(of, sbefifo_of_ids); + static const struct fsi_device_id sbefifo_ids[] =3D { { .engine_type =3D FSI_ENGID_SBE, @@ -1141,6 +1177,7 @@ static struct fsi_driver sbefifo_drv =3D { .drv =3D { .name =3D DEVICE_NAME, .bus =3D &fsi_bus_type, + .of_match_table =3D sbefifo_of_ids, .probe =3D sbefifo_probe, .remove =3D sbefifo_remove, } --=20 2.43.0 From nobody Fri Nov 29 16:35:43 2024 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 4FDBA181339 for ; Tue, 17 Sep 2024 17:17:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593423; cv=none; b=URJO4WL0pisJBXLYYQTbpCV7tGDEXY5hUkzMlndedoBncE+6gRElLnP36eKO5cWbgDMSWWxOA+AO9XQQIKhFQey+RPgRikmC6qvhNceqxatRdboO4+0W1Z3EFSAnwnT6URfYv4RbHHGZhplrWDpZf+DxqN7whj95yHutS4Pfqaw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593423; c=relaxed/simple; bh=v9lP3LDc0A27jTbdyuIFtQjxcl9DZISNvo/u3EtcGIA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ork30OgJJh7oFFlNZxne4ByNc7nVXzYUWQOGQfU501Qd4rp8UAbEWoF28aSHq/GuifA9MPdwhLNf33C68nIjg+tehsScNC6nmA+Dj42orONyAZ5mf4Nfbew7tmaA471xN8cJafETCjGz4xra55oG7aO8n0dta4UWlCqqBZj0fG4= 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=Xg+cFc3B; arc=none smtp.client-ip=148.163.156.1 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Xg+cFc3B" Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48H9pkd7022492; Tue, 17 Sep 2024 17:16:53 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=dnGqzXOeX4T8Q hvF6PDp/id4OxgamrxvQO99vsDWvIc=; b=Xg+cFc3Bhy3bq3PNYOapIfw4KW8eZ ow8KN07jmcs7X6y5/Tk8JbtnqDmWpqcOEqHqKkUXN50/9+pHeEtdZ13L8/11MGMh qJcj03+r4ZcM3kvk/4G+asLcVnFFf3mO/OWh1BOXnO8Fiwgv2pAiKJHBjZemqu2Z GMrIzsa2Kk2CJh3KHrF1lNJQ9x+77w+UaykOXC42heyvwOlz87BSZGNGhvAxYFmk qegQbGeNw89SRi2N2oGuMwttGztOA1QHevRDJRTPpwzizPn/gi9hl8Nv7GRJB+qz evP75WFhsMQNzwK7C8XYU4OBcGQI3UM43+8xQ20IM3kJW/DleShp4zo9g== 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 41n3ud9hgn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:53 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HGVuB3025033; Tue, 17 Sep 2024 17:16:52 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 41nq1mx7ud-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:52 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGpeA23658906 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:51 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3EDDF58057; Tue, 17 Sep 2024 17:16:51 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 09B0A58059; Tue, 17 Sep 2024 17:16:51 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com Subject: [PATCH 15/15] fsi: i2cr: Reduce status checks for read operations Date: Tue, 17 Sep 2024 12:16:47 -0500 Message-ID: <20240917171647.1403910-16-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-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: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: eguy6qpgCxaVN2TdNyw2OM6_Z2OcTuhe X-Proofpoint-ORIG-GUID: eguy6qpgCxaVN2TdNyw2OM6_Z2OcTuhe X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 phishscore=0 impostorscore=0 spamscore=0 priorityscore=1501 suspectscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=896 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 Content-Type: text/plain; charset="utf-8" As an optimization, only check the status register if the eight byte i2c read operation returns 0xffffffffffffffff. This indicates that the I2C Responder operation failed and the status register will provide the reason. Otherwise, the operation was successful, so no status check is necessary. Signed-off-by: Eddie James --- drivers/fsi/fsi-master-i2cr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/fsi/fsi-master-i2cr.c b/drivers/fsi/fsi-master-i2cr.c index 61e55740946b..44dbc7029942 100644 --- a/drivers/fsi/fsi-master-i2cr.c +++ b/drivers/fsi/fsi-master-i2cr.c @@ -145,9 +145,11 @@ int fsi_master_i2cr_read(struct fsi_master_i2cr *i2cr,= u32 addr, u64 *data) if (ret) goto unlock; =20 - ret =3D i2cr_check_status(i2cr->client); - if (ret) - goto unlock; + if (*data =3D=3D 0xffffffffffffffffull) { + ret =3D i2cr_check_status(i2cr->client); + if (ret) + goto unlock; + } =20 trace_i2cr_read(i2cr->client, command, data); =20 --=20 2.43.0