From nobody Tue Nov 26 05:41:19 2024 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2060.outbound.protection.outlook.com [40.107.21.60]) (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 A1AD315443F; Tue, 22 Oct 2024 06:08:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729577295; cv=fail; b=IUA+nibqJedOgdB/rpLNM/xh6CVJ7xxCWHb6A+PTKyPxlFwWK48V634GRjJ5l/bwojiR++wwCbpZoc8lv3jChyOXUUyToM8Yh3rLyObkEkHfi/SD8pj5Rp8y+svbXiJthoz6A26psNz2vj07WuSiyO/NJvtM3sZiyYreimB774s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729577295; c=relaxed/simple; bh=Eu1BS74ANXomq1hCfFdsvWbebq6Ai6cbLT+ZoMUG2R8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=WF/5Ymt3vZvH7pp878ANB00HRKU/HlRsSKP47n70Yh1iaGXVMVij0LunLYGx3MRf73gyL1J+ER4dmwflBdV0exM97AvumZclErzY4nSHKc9X+9uF4YQyvYE7NbXywETYrKsWHme0F8BTYrEn6p34+0PibRsXaNAu1xJuveD5ixc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=OoKCgA1e; arc=fail smtp.client-ip=40.107.21.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="OoKCgA1e" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FG1yi77qY2KK9Ww5nhVVf9QpPFS8aHJIR0IHgBn1wOKrafuAQsfLF2JV91jks3vxvNMi5QklMP9GneRRhKZX1FqpZCpl/U+T7F3DgEQSBFnJXGLisoxvBeRo89sm9nxVnE2KT6i04Lld5dUAw8721ULQUaIcyetugIBlF5XUBxz1m9tDo4JsU62hDHBvFA9PAlinTQEZLVGeCtJWS7kIGCizY1rVRhKQF3JLnRYbbnJ1YWz8jTwG5rnGbS2PXjSAGx4hSHv+f5VwKufasGQFwxw40k9pjkeKgAbTtz08QhBMZAVLy7pnMF3R5lOXpPLWNUypOROHigspI000zLcrXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SbJbsgnVqfcvlmsoZu6lwfabIjlblR/gyIDOgIZ+eQM=; b=uU/aJbMTEiT+4ZIyWWb4OErDUaj5/ODygAq1Z5MSsJIG8uU3Gm3S1Ix/McM6YG4MLh4x4aQ5DKgTtVILF5JvklN6IQks+3yuRd7oipLYtqhKwIRAeUcipo0/BrIci21v6wpa1JFNHAvSOcFF2I9q0Z8F7/PnEfTKxIjkCTIssUgBVk8q3vo8MuMAEMOq4e6Lf0xWzXIezIFQ1yen9rgENcjxumADuApFR55g/J3MJcwNpLlemJhfq9wHic2EPXDgZz5KbTMtJp2/AUrR5y2JXEYPoFrnxy3/MsiS36AqrayOVWJI8oe567ky21+6dfQTAVOgnfJRYi/jNRZF40+hYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SbJbsgnVqfcvlmsoZu6lwfabIjlblR/gyIDOgIZ+eQM=; b=OoKCgA1ebC0Z8BdWNua8k3WX4f6vCGaw8RoRgHDL85V5SKnmbi8ak2Mt1Om6VM61nJn6uPXLnI4DkDHs983ZMaYGL6I5aUiLavKWCHTeYt5v0a1NLsZpk2mAffhVdQHWWQnY1J7N4QBOSIfYSFOSZtzFuRTkrgnezd7fPeWVEXWMkDokeuHoCoJKtPUyv7rbYBJiBHQdmDxW9Q45CWcFQW0gaGvlp2dZiX6cfc9GdPOahO4C3sFKdz7gNLXOVvWq9SmLrvV7RFIyv/b+fw+edgWHCbzbF9QKOQ3oNu1bZMJoOImzSUDQpuGhuY6ZnzHBvU6VL1Ng2US6TCfEuj+H+A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by PA1PR04MB10178.eurprd04.prod.outlook.com (2603:10a6:102:463::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Tue, 22 Oct 2024 06:08:10 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8069.027; Tue, 22 Oct 2024 06:08:10 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, alexander.stein@ew.tq-group.com Subject: [PATCH v4 net-next 07/13] net: enetc: remove ERR050089 workaround for i.MX95 Date: Tue, 22 Oct 2024 13:52:17 +0800 Message-Id: <20241022055223.382277-8-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022055223.382277-1-wei.fang@nxp.com> References: <20241022055223.382277-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SG2PR02CA0044.apcprd02.prod.outlook.com (2603:1096:3:18::32) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|PA1PR04MB10178:EE_ X-MS-Office365-Filtering-Correlation-Id: 38dbd55f-66c4-4fbd-a87a-08dcf25fe795 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?QgsOG0sQ4v0j9QAYJNRMCEP6VPZHwoN4A3o/1Yrwef1RTXCcr3LaKsGoiENu?= =?us-ascii?Q?B+Iocf9+yPAEFCxHZFWaF0E8tN3PF9hmdci3XtnpOX5ttd8ToSTYSgmbw5mF?= =?us-ascii?Q?w8o4VTCW7WGT65ylzEAGgwg4efs6jSv31Hqqo5wqoapbvCU+zmfqlHBXxehI?= =?us-ascii?Q?eR6Gl9uHgA+7ZO18EIXIjQ3FO0FPSlMFrJahnaa8Hoet6iBX299+ttO6Lsnf?= =?us-ascii?Q?zfKHN4ooiYUg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ydsysnwSOft/Wh3q0?= =?us-ascii?Q?AgaZzMbUQVQyg1WNgpeX7SoYhGDT39HyBuGtGjccOK74JVozPazxlvrmH1qQ?= =?us-ascii?Q?bnynB7w9+dlraq69XZnd+3c3S5I07FGxHYs5g5ReeK5qmj40OhreVlV57GZM?= =?us-ascii?Q?vVAoRPh2tkWRXz1czx/E/Xk+G+x8uS1tsci5GVyPCQWDxHPX4B9Sfqrx7+IC?= =?us-ascii?Q?AtzAoi88qlLd2g9SndaxJ/gigY2edBhOtvRj5w/OAsqV2BG7hflMYUBRAICg?= =?us-ascii?Q?tzAuxkSV/62YZ0NEIKf2u+RHlL4s?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(7416014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HrNMfxJ3rHUqIeFDJ1jHY6EKYurNQ8H4gpY2ZB9aEaJP8/Nd3ltt9diQsvFe?= =?us-ascii?Q?ZJi9o7GqR+4cbgv2rZu7tFSAUs5eSyiqLBFpoZH27eWaCl2nwwbQS5OKZAyL?= =?us-ascii?Q?mFRTbQ44CzQRqVods6WGLyox47N6QIrmow7/4N4RA6SJS/65F8AtmhHSsM5G?= =?us-ascii?Q?VfWpshu2K6AyDEyBeFnaHKMZG2ftXbAsUBUgzdPTdRil1B4NkbAVSafsMMBY?= =?us-ascii?Q?h6bFyB3I9Uiv84vj5GeYI8UheMPqRoY2rhQ6sLJqYiHkPbpOw9Fr8HxuNxya?= =?us-ascii?Q?JKS+MCPghqLa+rrLSeHnvIn+K39rTS3kuFXDdfqstpr7SYsFRQiao5dygVEA?= =?us-ascii?Q?rsROk/4q3zbjCCui6y2Fa/3tijf8hvvr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q?Gp62ODciNwRosYinz1/H1YsStRrYiRG8vdtjg8KF/7HyRhbORNZyXl132uPS?= =?us-ascii?Q?QkPIJOkXm/Vlzy6zUPvxxAWoZ0c/M/8GO/TOwrhWjBW9rVMxHbQWcw/IX9xe?= =?us-ascii?Q?D7+R7mur5d9YcVdBCkAK+sK27o5w91aud83mKLYBktVOM+kkHjeF73XX6/J9?= =?us-ascii?Q?bfYsr18ttTYoi3Jjs0WKoRDdDo6wyhmNr1nI+BkbaQIqQc1iytGdb5oJK8XQ?= =?us-ascii?Q?ezfGDqu20MF4fzv+H4GOIUe5lg6aDrG7AW6d298gC5xSZwMo2QVUUQ+71nF2?= =?us-ascii?Q?pShZp9tX1DqEt30UfzQCSh2EB9XnF+Ws44+bEqkv?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38dbd55f-66c4-4fbd-a87a-08dcf25fe795 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 06:08:10.7412 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MjJAgmhWbsnskJMBWvf+WNeQFoUPgUXLIJqymv5I+MoFmsyBDlamoG60gXsnj5umRwnbjsw2iIWrMb76XuoCbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10178 Content-Type: text/plain; charset="utf-8" From: Vladimir Oltean The ERR050089 workaround causes performance degradation and potential functional issues (e.g., RCU stalls) under certain workloads. Since new SoCs like i.MX95 do not require this workaround, use a static key to compile out enetc_lock_mdio() and enetc_unlock_mdio() at runtime, improving performance and avoiding unnecessary logic. Signed-off-by: Vladimir Oltean Signed-off-by: Wei Fang Reviewed-by: Frank Li --- v2 changes: no changes v3 changes: Change the title and refactor the commit message. v4: no changes. --- .../net/ethernet/freescale/enetc/enetc_hw.h | 34 +++++++++++++------ .../ethernet/freescale/enetc/enetc_pci_mdio.c | 17 ++++++++++ 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_hw.h b/drivers/net/= ethernet/freescale/enetc/enetc_hw.h index 1619943fb263..6a7b9b75d660 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h +++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h @@ -396,18 +396,22 @@ struct enetc_hw { */ extern rwlock_t enetc_mdio_lock; =20 +DECLARE_STATIC_KEY_FALSE(enetc_has_err050089); + /* use this locking primitive only on the fast datapath to * group together multiple non-MDIO register accesses to * minimize the overhead of the lock */ static inline void enetc_lock_mdio(void) { - read_lock(&enetc_mdio_lock); + if (static_branch_unlikely(&enetc_has_err050089)) + read_lock(&enetc_mdio_lock); } =20 static inline void enetc_unlock_mdio(void) { - read_unlock(&enetc_mdio_lock); + if (static_branch_unlikely(&enetc_has_err050089)) + read_unlock(&enetc_mdio_lock); } =20 /* use these accessors only on the fast datapath under @@ -416,14 +420,16 @@ static inline void enetc_unlock_mdio(void) */ static inline u32 enetc_rd_reg_hot(void __iomem *reg) { - lockdep_assert_held(&enetc_mdio_lock); + if (static_branch_unlikely(&enetc_has_err050089)) + lockdep_assert_held(&enetc_mdio_lock); =20 return ioread32(reg); } =20 static inline void enetc_wr_reg_hot(void __iomem *reg, u32 val) { - lockdep_assert_held(&enetc_mdio_lock); + if (static_branch_unlikely(&enetc_has_err050089)) + lockdep_assert_held(&enetc_mdio_lock); =20 iowrite32(val, reg); } @@ -452,9 +458,13 @@ static inline u32 _enetc_rd_mdio_reg_wa(void __iomem *= reg) unsigned long flags; u32 val; =20 - write_lock_irqsave(&enetc_mdio_lock, flags); - val =3D ioread32(reg); - write_unlock_irqrestore(&enetc_mdio_lock, flags); + if (static_branch_unlikely(&enetc_has_err050089)) { + write_lock_irqsave(&enetc_mdio_lock, flags); + val =3D ioread32(reg); + write_unlock_irqrestore(&enetc_mdio_lock, flags); + } else { + val =3D ioread32(reg); + } =20 return val; } @@ -463,9 +473,13 @@ static inline void _enetc_wr_mdio_reg_wa(void __iomem = *reg, u32 val) { unsigned long flags; =20 - write_lock_irqsave(&enetc_mdio_lock, flags); - iowrite32(val, reg); - write_unlock_irqrestore(&enetc_mdio_lock, flags); + if (static_branch_unlikely(&enetc_has_err050089)) { + write_lock_irqsave(&enetc_mdio_lock, flags); + iowrite32(val, reg); + write_unlock_irqrestore(&enetc_mdio_lock, flags); + } else { + iowrite32(val, reg); + } } =20 #ifdef ioread64 diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c b/driver= s/net/ethernet/freescale/enetc/enetc_pci_mdio.c index a1b595bd7993..2445e35a764a 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c @@ -9,6 +9,9 @@ #define ENETC_MDIO_BUS_NAME ENETC_MDIO_DEV_NAME " Bus" #define ENETC_MDIO_DRV_NAME ENETC_MDIO_DEV_NAME " driver" =20 +DEFINE_STATIC_KEY_FALSE(enetc_has_err050089); +EXPORT_SYMBOL_GPL(enetc_has_err050089); + static int enetc_pci_mdio_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -62,6 +65,12 @@ static int enetc_pci_mdio_probe(struct pci_dev *pdev, goto err_pci_mem_reg; } =20 + if (pdev->vendor =3D=3D PCI_VENDOR_ID_FREESCALE && + pdev->device =3D=3D ENETC_MDIO_DEV_ID) { + static_branch_inc(&enetc_has_err050089); + dev_info(&pdev->dev, "Enabled ERR050089 workaround\n"); + } + err =3D of_mdiobus_register(bus, dev->of_node); if (err) goto err_mdiobus_reg; @@ -88,6 +97,14 @@ static void enetc_pci_mdio_remove(struct pci_dev *pdev) struct enetc_mdio_priv *mdio_priv; =20 mdiobus_unregister(bus); + + if (pdev->vendor =3D=3D PCI_VENDOR_ID_FREESCALE && + pdev->device =3D=3D ENETC_MDIO_DEV_ID) { + static_branch_dec(&enetc_has_err050089); + if (!static_key_enabled(&enetc_has_err050089.key)) + dev_info(&pdev->dev, "Disabled ERR050089 workaround\n"); + } + mdio_priv =3D bus->priv; iounmap(mdio_priv->hw->port); pci_release_region(pdev, 0); --=20 2.34.1