From patchwork Thu Aug 3 13:58:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13340087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09A3EC04A94 for ; Thu, 3 Aug 2023 13:59:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236414AbjHCN71 (ORCPT ); Thu, 3 Aug 2023 09:59:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236388AbjHCN7X (ORCPT ); Thu, 3 Aug 2023 09:59:23 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2077.outbound.protection.outlook.com [40.107.105.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39B5410D4; Thu, 3 Aug 2023 06:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VtKxs6z3d1M3zel/UYS2l9cZjF2MF9LWZpmz3Z2HrmYx13HPjBXD4NDl+yojFZBoroH+hiCKYMiwrfX0HIFvvmdWA5gTrK2RThit2Pk1ohYjW2BkEVkoges6gJrwgcxcAF4155jlw8ivcbAF+4+V7h1LkKcVoJLIAXZyEaNzDgQ/4QWRa3nHXGfsmxzeBSXtQ0nx13fnxsw6D+UsrZMlHS2Ti3aEeIN/4VLamM6TvNR1CumWzFhDDDaGJyt0NCIW9Qm8RUXo6kqwPTaPHh/V7pZe1lCK+tMh5o1+2gcx6ckk1c1fK4C3zVh+fYzBXRZQYBZVKR8yxhbHNkmlTqtNuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=tIH3D4R/X3JWuiW157ch1VpvqT34SPIdGu6sH4HO03g=; b=HMMn4eGh9NY5iY4neZtQwJsPvNz7rfUbrTIlPBr+GxSRcoHF+ZBL9gPWdp79bLowYQTzpqgqgeMSjCveKW7UbHeDymc5+EaCtYt9b4UrXkN4iDvH0ZOT+y+FXuBc5zyU0pGG6DFO+eyxSvdKbNTS2jJBlXrZTqbm9dN98Qqhi6qQ2LIY2I5kqe5O10S/FFIOYvPgUT1PnwHvXuS/+2ePyhHBCjUz7e9zV3rImhvJrn+fN/Q7wYmZvhyaNNTnWElYgmiOyGLZFDBzFzoV5p2sIqwgBd4Etthl2/NkYvrW6hjBjRXzvs796xKW6gXCdz3cD9a8fXksgdyOf3YBWhVQwA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tIH3D4R/X3JWuiW157ch1VpvqT34SPIdGu6sH4HO03g=; b=dqQxf1nMysulUQRG6dZiK+HgJ3zRCgEtEkjFoW+aEqcQH0vRU84NgboyQgilGvEO53dDoG4lnmiiIqZ73MAIs9p+p3COXTvdUj7N/GO43DNv+OoCWyOVfpdqroDIheasEEoAxTmvahwdS/kBpd5ozhsffHGged7K0hwfzgQoQn4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by DB9PR04MB8362.eurprd04.prod.outlook.com (2603:10a6:10:241::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.20; Thu, 3 Aug 2023 13:59:11 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::6074:afac:3fae:6194]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::6074:afac:3fae:6194%4]) with mapi id 15.20.6631.046; Thu, 3 Aug 2023 13:59:11 +0000 From: Vladimir Oltean To: linux-pci@vger.kernel.org, netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Bjorn Helgaas , Rob Herring , Claudiu Manoil , Michael Walle , linux-kernel@vger.kernel.org, Jianmin Lv , Liu Peibao , Binbin Zhou , Huacai Chen Subject: [PATCH v2 pci/net 1/3] PCI: move OF status = "disabled" detection to dev->match_driver Date: Thu, 3 Aug 2023 16:58:56 +0300 Message-Id: <20230803135858.2724342-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230803135858.2724342-1-vladimir.oltean@nxp.com> References: <20230803135858.2724342-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM0PR06CA0108.eurprd06.prod.outlook.com (2603:10a6:208:fa::49) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|DB9PR04MB8362:EE_ X-MS-Office365-Filtering-Correlation-Id: 1bdceadb-b188-4e60-7404-08db9429d014 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t5bmnrLzNXpHDv0M5PaHBBoVt9uWeRqrT/bTY5uZcK1aRzbrvMyXrGX0iL37G5vz6fLxR8fR73FPXEduuvBLWFyy1mtM979rqgRb2p2V11y3oSrFyKwqgcUoAOa9lD7ebLqNMDtZR8LhZbj461uq5ihZtAJBnUH7HbNvuejDZr9p+ixEHiHg6rj0HBq8PzotvmCO4XxqlX6jPOkuBhoL1VewOt4CqTtTK0R/Uq/aKEdp5xXYZ/xjlelyKucXzGLRCclwvcGyImkWyNFZeH3KUAL2Vi6cQJJFiaNsDsXqTcRMPz5DqftvLaUdo9fWMDg5lHRYEp2rdtxqmIpVmvJfbbrObOneUSqlECBmv+7l4r8oVDTur5FoiOSgh1hpyyyzqoD7yjRt+5dei5Ih+OKHQlIc42ZzUhtUn8EU2J/5vEP4PjNzzh07aOyzINUiOJiiZZJwQxwpVrcg8b+F0QuoxOqs4SpSpoccoB2z3VG3v61CfRu2MoEeCFtl6xj+j+AbOYPqbtymSaGeBZZi2I5roCX7vx6XoFRKKicoOnNcYMU9QQOATpzcgXF1cMKw8LGGIcs8S4jNaMF+DPZCraCiDnW9ICWg6rf9yUb8dU3O9J0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(39860400002)(346002)(376002)(366004)(451199021)(83380400001)(2906002)(44832011)(2616005)(86362001)(36756003)(38100700002)(38350700002)(41300700001)(6666004)(6486002)(54906003)(966005)(6512007)(66476007)(316002)(4326008)(66946007)(66556008)(26005)(1076003)(6506007)(5660300002)(52116002)(478600001)(7416002)(186003)(8676002)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mlmcJ/2FV6d1Nm8Gyb1RQc5aydGBK9ysg9gkhjOh3ttL5FWdVOMmVeVsInS7Ae2p+2rfvPoitfdZM8z57yM2c2zL1C9upnOzIViZNC3Li+wYVgtbioN9TIHHU+P852NFzTjiQqtktXezsVbs9PCAJ6X4M0poS1+X/wUO2du4KBmMyIhzJESmzLvEUsqP/GVY6Ux35BS65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L/usaKRmtqajEoAiCqRFyB/wTuqCaB+eKenEPWMW1Zn8o8LVd3Wq6LJPdGanK6Ovciawcu2hVys3UoclVgOdvllndBLlfWw1taGTXIi7KHR1mw9UzCXVDj3p5+jkI8WyYg6mwngnSyN2ls5dJ4Ac9/tAj9ysyA8KAOYSf00F+un4+AcvqkjbF3ms+orGsB/BI7V9TIMJv/cBKwIUNpOSVtR9ya1TTT9HmxbolohChu4ALos15TpUdzeUJB5OyRSpwbaIzglC0110LTvLeRIR719poEMNO/pPyPFFl9egb8K6SLabPORPvc1TX3Bz1ccuN4UvHBc9QvoPohtthVVhk7FlGCJIkb6s15Q== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bdceadb-b188-4e60-7404-08db9429d014 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2023 13:59:11.0368 (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: zFWjDsA+5SAl55PSx27l2gsr6MhQ49+yaoplYV7qMe7OXYvyNR5q+zc6qK9Px8JuUrvt2IISRbmy77kCex7jiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8362 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The blamed commit has broken probing on arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi when &enetc_port0 (PCI function 0) has status = "disabled". Background: pci_scan_slot() has logic to say that if the function 0 of a device is absent, the entire device is absent and we can skip the other functions entirely. Traditionally, this has meant that pci_bus_read_dev_vendor_id() returns an error code for that function. However, since the blamed commit, there is an extra confounding condition: function 0 of the device exists and has a valid vendor id, but it is disabled in the device tree. In that case, pci_scan_slot() would incorrectly skip the entire device instead of just that function. In the case of NXP LS1028A, status = "disabled" does not mean that the PCI function's config space is not available for reading. It is, but the Ethernet port is just not functionally useful with a particular SerDes protocol configuration (0x9999) due to pinmuxing constraints of the Soc. So, pci_scan_slot() skips all other functions on the ENETC ECAM (enetc_port1, enetc_port2, enetc_mdio_pf3 etc) when just enetc_port0 had to not be probed. There is an additional regression introduced by the change, caused by its fundamental premise. The enetc driver needs to run code for all PCI functions, regardless of whether they're enabled or not in the device tree. That is no longer possible if the driver's probe function is no longer called. But Rob recommends that we move the of_device_is_available() detection to dev->match_driver, and this makes the PCI fixups still run on all functions, while just probing drivers for those functions that are enabled. So, a separate change in the enetc driver will have to move the workarounds to a PCI fixup. Fixes: 6fffbc7ae137 ("PCI: Honor firmware's device disabled status") Link: https://lore.kernel.org/netdev/CAL_JsqLsVYiPLx2kcHkDQ4t=hQVCR7NHziDwi9cCFUFhx48Qow@mail.gmail.com/ Suggested-by: Rob Herring Signed-off-by: Vladimir Oltean --- drivers/pci/bus.c | 4 +++- drivers/pci/of.c | 5 ----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 5bc81cc0a2de..46b252bbe500 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -332,6 +333,7 @@ void __weak pcibios_bus_add_device(struct pci_dev *pdev) { } */ void pci_bus_add_device(struct pci_dev *dev) { + struct device_node *dn = dev->dev.of_node; int retval; /* @@ -344,7 +346,7 @@ void pci_bus_add_device(struct pci_dev *dev) pci_proc_attach_device(dev); pci_bridge_d3_update(dev); - dev->match_driver = true; + dev->match_driver = !dn || of_device_is_available(dn); retval = device_attach(&dev->dev); if (retval < 0 && retval != -EPROBE_DEFER) pci_warn(dev, "device attach failed (%d)\n", retval); diff --git a/drivers/pci/of.c b/drivers/pci/of.c index e51219f9f523..3c158b17dcb5 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -34,11 +34,6 @@ int pci_set_of_node(struct pci_dev *dev) if (!node) return 0; - if (!of_device_is_available(node)) { - of_node_put(node); - return -ENODEV; - } - device_set_node(&dev->dev, of_fwnode_handle(node)); return 0; } From patchwork Thu Aug 3 13:58:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13340086 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DD92C04A6A for ; Thu, 3 Aug 2023 13:59:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232387AbjHCN7Z (ORCPT ); Thu, 3 Aug 2023 09:59:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235850AbjHCN7V (ORCPT ); Thu, 3 Aug 2023 09:59:21 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2066.outbound.protection.outlook.com [40.107.20.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D19A31BE4; Thu, 3 Aug 2023 06:59:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i0PnTO6jXScR+RSt7aqNJlxUNNgfZqWuc3SO9nEl3223xRl/kAC9gJU6PbacxyTveXtdiUo3BG3+Bnyt17119QLq/Bm2vXPMYWEafwxubeIKC1Ti87GoQ9EIfH7yDrT9xV+4jRX7akAL2PUUPDxqW1TpHt5cHzjlIH6yrx9WQH5JC9kzhKDOdch4GjXGIlYdPqR9ojFEII8Y1yLYhOtcG+SXCdx21OocSY9lUBJ/87UcL74gNJb1V0aLKvGNw4bf0ZIyl1qvSnRafPJ/ziQuWJkpIpv3nk4coZmV29sTBJE+A+CHhCpo+wC6QWBAEhuNxAMv37axJm+U3YlEuY0qlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=L6G01L6TrLjRhzAatZncIBGwWrlgeNojLy26pEtIu2M=; b=nalNoOixfPzNFfGpp5VI/P/RaURuAHjPghSkDUVjzgeQmiQwm6fIH0pmMZh+llFIOsh4iHSTZLQnHjU4N2ONxsaFvBZNx10pnvIRZAxSfx0/n2f6zqwCeomBsh7ZwVI5e4cIoyo1U/ousPj+eR0+aTivFga3qX+bnORGWk9kZ/WI6/lU50tkBcQu0m+ARq+hyEjF/GmIgNpR0D6pSYgh+rgwcMzKp9J/YG1o9bh1OjNyBDbXGUthQc+/V7e8rAOPfzXOpMCS3fLunXc7GhGU/xBmNJ3aksEjDCizTLjKHEIdA61mpjZtdVzAbV2j3xAVDSKaSg1VEwkSvaM578Ok9A== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L6G01L6TrLjRhzAatZncIBGwWrlgeNojLy26pEtIu2M=; b=a6qv0Z/O/nb0/dV76OguWXi6xE1XFDjgDR418Rsxigm52MAOd0ASFSuua6E1S99DRmlB+93z5o2oIeRK/vUIyWwa4pMOBNfEVUNr3JoALroZsjGQ9P2B61XcW3s1yYtA7HGPgrodVmqGA8bL9dhFV2VQY0NmRluEkG0n9/pNUs0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by PAXPR04MB8799.eurprd04.prod.outlook.com (2603:10a6:102:20e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.47; Thu, 3 Aug 2023 13:59:12 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::6074:afac:3fae:6194]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::6074:afac:3fae:6194%4]) with mapi id 15.20.6631.046; Thu, 3 Aug 2023 13:59:12 +0000 From: Vladimir Oltean To: linux-pci@vger.kernel.org, netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Bjorn Helgaas , Rob Herring , Claudiu Manoil , Michael Walle , linux-kernel@vger.kernel.org, Jianmin Lv , Liu Peibao , Binbin Zhou , Huacai Chen Subject: [PATCH v2 pci/net 2/3] net: enetc: reimplement RFS/RSS memory clearing as PCI quirk Date: Thu, 3 Aug 2023 16:58:57 +0300 Message-Id: <20230803135858.2724342-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230803135858.2724342-1-vladimir.oltean@nxp.com> References: <20230803135858.2724342-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM0PR06CA0108.eurprd06.prod.outlook.com (2603:10a6:208:fa::49) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|PAXPR04MB8799:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ecb545f-f92b-4b4d-91e3-08db9429d0b6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ACZPbvmxehGRgFT76g0Gq0tMrUsbySLBXub1Yc8RcbOzWcQb3qGWp/RGBRR8qt8jofd+WeV9bbHCMKHih74AOUtf+hCDORJccQVn6/rIQKK8F9NlN/0UNoW2798KbEiFYBOsJmXROu2MV0jYMCqwgGGu34A9x2q1SklxQiJ+llkF+Yctcg6v/6jXzLhPp/gMkCxhjGvkR1R6K4PIHHvcsS6IAlRC629Zk41CRRnb6GJd0SUMBvNdpsPFA4eq02uC8Rol0ag9Tg18wvrZIT7amDbVzhlwdcCIJE6yrWEipQRryrGr1ZMkmDi2lfjIlx3UJMegAH6RMohLXi5wpdFa1H7qrcWf6dmOcNwG8AYMS5dvZ6+ef2kKMnIsE2RVUMn0fJlQ3VaIZ3ClmLjhQUlJMu2jzihCxip2fuCBfaywtSuAsnhjfdERqPcP4Suy4h0mw9P1k93xYxIams6ZqSDBCXI1P/QDaj2xjNLV5gHSqL4WPOmUI4WzTCnPF9WtktMLbr2ga3/53kawkuIIOTOSshHTRLVOy0aSiDB+WCW9Oh4JM6a8d9HMTqWNuYFDhq04otB0eQMkRMsW0dPFAkTCg6gwDGDEAJDSt6I5kbLOP8g= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(136003)(346002)(376002)(396003)(451199021)(7416002)(44832011)(5660300002)(8936002)(8676002)(41300700001)(66946007)(66476007)(66556008)(316002)(2906002)(4326008)(966005)(54906003)(52116002)(6486002)(6666004)(6512007)(478600001)(38350700002)(38100700002)(83380400001)(2616005)(1076003)(26005)(6506007)(86362001)(36756003)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: M3mGTBokN3JsimuoqlXTOJTEzW0eQqPOTbJ/YfcVvY1k376FugT8cqlB7RUnL+Eg7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jPNkdv7fKWMpwy9oA1EU9vAAq8adVX1VaQ5qMHLEP80paCMtmSK04bsOz/HeimQLMh6lzYOiZ1CThllVMYu7Y0y1m9qAOfx2SbqucumrSwGmT9V8gxsgm4uKfyvHpe7N2zqxbdv87ULisJvVAnjhlB7sA8m1asB+j8KEGbZY57+6Yh+WafeLupMoNZigj+f9BVKVxGgiVCAzQdlFTQQB1+Xljoyz0TXpGMJQOM/H89e3ISMaAInBNDVUdZ2exjghKgLd+2nX8gOvenopWMPQJtHe1jH3t0wyTp8ULbEJKTRJZwzgDAIq8Gx3oGie4zR9lDvRrdxBgx34wsdCfcmr28s8u6okEGWqLwYQ4qR4J7kWuruI4atOlM+Rj71EDs4h70M9sjpi9YOooSmKZs+a7gGMFQ/F4Bc3EALKnpRj52BxXoL4tzSjof7Ew7rszXTJzYeco3jPnVugsM5VCtjW46hOJNuYDpe5yET5vw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ecb545f-f92b-4b4d-91e3-08db9429d0b6 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2023 13:59:12.1121 (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: PVLLMqnaM1+oZE6tCEAR8/H5k+gH+j1TkHOtuKgTAAPhJwWttzLU8+usS/JuaMBvlK16Hq49E3wL7hHqhhF0TQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8799 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The workaround implemented in commit 3222b5b613db ("net: enetc: initialize RFS/RSS memories for unused ports too") is no longer effective after commit 6fffbc7ae137 ("PCI: Honor firmware's device disabled status"). Thus, it has introduced a regression and we see AER errors being reported again: $ ip link set sw2p0 up && dhclient -i sw2p0 && ip addr show sw2p0 fsl_enetc 0000:00:00.2 eno2: configuring for fixed/internal link mode fsl_enetc 0000:00:00.2 eno2: Link is Up - 2.5Gbps/Full - flow control rx/tx mscc_felix 0000:00:00.5 swp2: configuring for fixed/sgmii link mode mscc_felix 0000:00:00.5 swp2: Link is Up - 1Gbps/Full - flow control off sja1105 spi2.2 sw2p0: configuring for phy/rgmii-id link mode sja1105 spi2.2 sw2p0: Link is Up - 1Gbps/Full - flow control off pcieport 0000:00:1f.0: AER: Multiple Corrected error received: 0000:00:00.0 pcieport 0000:00:1f.0: AER: can't find device of ID0000 Rob's suggestion is to reimplement the enetc driver workaround as a PCI fixup, and to modify the PCI core to run the fixups for all PCI functions. This change handles the first part. We refactor the common code in enetc_psi_create() and enetc_psi_destroy(), and use the PCI fixup only for those functions for which enetc_pf_probe() won't get called. This avoids some work being done twice for the PFs which are enabled. Fixes: 6fffbc7ae137 ("PCI: Honor firmware's device disabled status") Link: https://lore.kernel.org/netdev/CAL_JsqLsVYiPLx2kcHkDQ4t=hQVCR7NHziDwi9cCFUFhx48Qow@mail.gmail.com/ Suggested-by: Rob Herring Signed-off-by: Vladimir Oltean --- .../net/ethernet/freescale/enetc/enetc_pf.c | 103 +++++++++++++----- 1 file changed, 73 insertions(+), 30 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c index 1416262d4296..d52ac0b6add6 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -1208,50 +1208,81 @@ static int enetc_pf_register_with_ierb(struct pci_dev *pdev) return enetc_ierb_register_pf(ierb_pdev, pdev); } -static int enetc_pf_probe(struct pci_dev *pdev, - const struct pci_device_id *ent) +static struct enetc_si *enetc_psi_create(struct pci_dev *pdev) { - struct device_node *node = pdev->dev.of_node; - struct enetc_ndev_priv *priv; - struct net_device *ndev; struct enetc_si *si; - struct enetc_pf *pf; int err; - err = enetc_pf_register_with_ierb(pdev); - if (err == -EPROBE_DEFER) - return err; - if (err) - dev_warn(&pdev->dev, - "Could not register with IERB driver: %pe, please update the device tree\n", - ERR_PTR(err)); - - err = enetc_pci_probe(pdev, KBUILD_MODNAME, sizeof(*pf)); - if (err) - return dev_err_probe(&pdev->dev, err, "PCI probing failed\n"); + err = enetc_pci_probe(pdev, KBUILD_MODNAME, sizeof(struct enetc_pf)); + if (err) { + dev_err_probe(&pdev->dev, err, "PCI probing failed\n"); + goto out; + } si = pci_get_drvdata(pdev); if (!si->hw.port || !si->hw.global) { err = -ENODEV; dev_err(&pdev->dev, "could not map PF space, probing a VF?\n"); - goto err_map_pf_space; + goto out_pci_remove; } err = enetc_setup_cbdr(&pdev->dev, &si->hw, ENETC_CBDR_DEFAULT_SIZE, &si->cbd_ring); if (err) - goto err_setup_cbdr; + goto out_pci_remove; err = enetc_init_port_rfs_memory(si); if (err) { dev_err(&pdev->dev, "Failed to initialize RFS memory\n"); - goto err_init_port_rfs; + goto out_teardown_cbdr; } err = enetc_init_port_rss_memory(si); if (err) { dev_err(&pdev->dev, "Failed to initialize RSS memory\n"); - goto err_init_port_rss; + goto out_teardown_cbdr; + } + + return si; + +out_teardown_cbdr: + enetc_teardown_cbdr(&si->cbd_ring); +out_pci_remove: + enetc_pci_remove(pdev); +out: + return ERR_PTR(err); +} + +static void enetc_psi_destroy(struct pci_dev *pdev) +{ + struct enetc_si *si = pci_get_drvdata(pdev); + + enetc_teardown_cbdr(&si->cbd_ring); + enetc_pci_remove(pdev); +} + +static int enetc_pf_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + struct device_node *node = pdev->dev.of_node; + struct enetc_ndev_priv *priv; + struct net_device *ndev; + struct enetc_si *si; + struct enetc_pf *pf; + int err; + + err = enetc_pf_register_with_ierb(pdev); + if (err == -EPROBE_DEFER) + return err; + if (err) + dev_warn(&pdev->dev, + "Could not register with IERB driver: %pe, please update the device tree\n", + ERR_PTR(err)); + + si = enetc_psi_create(pdev); + if (IS_ERR(si)) { + err = PTR_ERR(si); + goto err_psi_create; } if (node && !of_device_is_available(node)) { @@ -1339,15 +1370,10 @@ static int enetc_pf_probe(struct pci_dev *pdev, si->ndev = NULL; free_netdev(ndev); err_alloc_netdev: -err_init_port_rss: -err_init_port_rfs: err_device_disabled: err_setup_mac_addresses: - enetc_teardown_cbdr(&si->cbd_ring); -err_setup_cbdr: -err_map_pf_space: - enetc_pci_remove(pdev); - + enetc_psi_destroy(pdev); +err_psi_create: return err; } @@ -1370,12 +1396,29 @@ static void enetc_pf_remove(struct pci_dev *pdev) enetc_free_msix(priv); enetc_free_si_resources(priv); - enetc_teardown_cbdr(&si->cbd_ring); free_netdev(si->ndev); - enetc_pci_remove(pdev); + enetc_psi_destroy(pdev); +} + +static void enetc_fixup_clear_rss_rfs(struct pci_dev *pdev) +{ + struct device_node *node = pdev->dev.of_node; + struct enetc_si *si; + + /* Only apply quirk for disabled functions. For the ones + * that are enabled, enetc_pf_probe() will apply it. + */ + if (node && of_device_is_available(node)) + return; + + si = enetc_psi_create(pdev); + if (si) + enetc_psi_destroy(pdev); } +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_FREESCALE, ENETC_DEV_ID_PF, + enetc_fixup_clear_rss_rfs); static const struct pci_device_id enetc_pf_id_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, ENETC_DEV_ID_PF) }, From patchwork Thu Aug 3 13:58:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13340088 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47535C04A94 for ; Thu, 3 Aug 2023 13:59:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236513AbjHCN7a (ORCPT ); Thu, 3 Aug 2023 09:59:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236424AbjHCN70 (ORCPT ); Thu, 3 Aug 2023 09:59:26 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2067.outbound.protection.outlook.com [40.107.22.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 928DF1723; Thu, 3 Aug 2023 06:59:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VghXEOLiSV6QVRoL2O4AyuGHI2PVBC4X+C5mCq5nm3yXP3HNHn+/edDNhC25uJgf1FD57yckWmK/YWEZ09YMAtPJnavtSopJv5RYKlD6CEXHufmBRiv3+gPmwz2ThVB9pTEEbq8Ax4NiBumYEcz8ATmYZysespVELMf907sD+wc3d42Mzl8/ArBQDW4x0MXXDJdB9ybuXTKHfhRsBAo4FMFuUK780YATj/uNRNqf6Y9iJJzzdb6opMN5yX19egmPPuzWT4xYHEwzWbfP+MCpEp61fOVddLRHtLszOFJru6/Rb3yVXsDIhrYHHdj27g8c0YYk30MvSfarNz6rI0qMZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=n68zwqWSrkq+N7UHYvQYhDA2I1fmDsJ6lWCGNYx5WKg=; b=CB+hGOhkCFV9hDgs64ZrcaxaC4JEpY46Y86ItJkD+MSU1bBC/1Xnec3tXUiRUqeEaQoVqtd0oh9ug3gZ/lXVJyMirS8iPgDxnPDJDOiz/e+VmRAw4HcCLgxcyj4cE1euU14r9LRa63vnOE2Llat4wjQnBwpZyqFRi/Cc8AvKiGH7j9qAVTECtR5GYjUYpKTJkFk6SV1oIu007hWAzGA58InxKJ4BBW+C+bWOi658lIVK3/5i/BzdiLibBlPhHn7xSuhuQuQnh/mKBajHlZreMCOeD26LCdEG38i2YFtpVXrjgNMk6pWWtOEQmB4RQhGkiXPAf1rpa82sLYcIrlAbUQ== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n68zwqWSrkq+N7UHYvQYhDA2I1fmDsJ6lWCGNYx5WKg=; b=nwyD1vyuH730dw7DCWrgyCtq1NHiP7JhyjIkaHbHsZv81MBEUqkX9OOaUzr265ErwEwa3kEDMSDzEBOqDhwTqp9SrMwh4tNMxP5Kbw6vAoqrN25UeHuDJlNx67wmvuOLv+xsDKymxZSyBjyAkzWuSeitTb/mlNPrzd94C4ubXBE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by PAXPR04MB8799.eurprd04.prod.outlook.com (2603:10a6:102:20e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.47; Thu, 3 Aug 2023 13:59:13 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::6074:afac:3fae:6194]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::6074:afac:3fae:6194%4]) with mapi id 15.20.6631.046; Thu, 3 Aug 2023 13:59:13 +0000 From: Vladimir Oltean To: linux-pci@vger.kernel.org, netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Bjorn Helgaas , Rob Herring , Claudiu Manoil , Michael Walle , linux-kernel@vger.kernel.org, Jianmin Lv , Liu Peibao , Binbin Zhou , Huacai Chen Subject: [PATCH v2 pci/net 3/3] net: enetc: remove of_device_is_available() handling Date: Thu, 3 Aug 2023 16:58:58 +0300 Message-Id: <20230803135858.2724342-4-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230803135858.2724342-1-vladimir.oltean@nxp.com> References: <20230803135858.2724342-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM0PR06CA0108.eurprd06.prod.outlook.com (2603:10a6:208:fa::49) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|PAXPR04MB8799:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fd3422b-6c3f-4459-1224-08db9429d15b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ISsiYjelXBnUJQH83iBo3eI9xmRqhm35knwQ6bf4QHsSb1crD/hMuob7HXT56//k5BbFVANDsz3TypCoxtRkL3aZ6zReh0rQ3DyjTS3Eoa1UvBCRHYWKSVR4zDZjfxAEf5DNjtu9LiFTgm080hEQxWgs2dLV0mA16Lk2bX4ZrTbMf5ONc1MDCJ2tv57KWsag3q1M4bXfvsC9RxtffOzy8XwhofQxcPAQJH7nG/6qk9ORMnnKVITSbhUedump5aCpRHTyl3blWEDkIR0sCZx1rv+O+ti2IkO+6MwJtCrzMiHSvcSgfhbGdhfnJrHJyyzqN0g0mmR52cp3EroT7H81cYxuIn5hTMfW4aUU6e2JNFVUJfE8MwiFgJIZwPUYee2cY+qo401tY+mLH2ih9/VLnX4tcAY0h9ky+tmA/lM05HAhGWdg8HLZ06iE5ERg/urQnfC3kiwljTyOuiVXQXkbM1SKwpu57vetryo24b/ix7HLtejcMAxgBrgAtsYoY7aIqJ9AarO8cmmaxVvzl/Y3gb2+GTmMWpQgz6Den71ofudEGaKzpqYQ6h4dtAW0N/8UhW7WOEnTVJtQGdN7ARVAhmg+PXLz7EQzCj0gh2YzkKioW77vjoPVGM+f8qwgvhZL X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(136003)(346002)(376002)(396003)(451199021)(7416002)(44832011)(5660300002)(8936002)(8676002)(41300700001)(66946007)(66476007)(66556008)(316002)(2906002)(4326008)(54906003)(52116002)(6486002)(6666004)(6512007)(478600001)(38350700002)(38100700002)(83380400001)(2616005)(1076003)(26005)(6506007)(86362001)(36756003)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 66WrtLHgvDgYl8FsDdyCOH6jm8LXbV10kDQGpHATKeHQWGMddRSvw4TCNxM/PT78iJstxEhlA1HEY6pN4iX1JMOgWjTnROWlTAm0YIBF1fNWh/Gkvtji8R0IkRbS5r7jfCFC+UbjTX7syXJ7vYVwLJwHWIvdjaSqEGVb8R+IaNV7zOSs5/v8O7l/jCyw1aHt41ZTdosc0n3ZZCnvJaYglTSNNw88u5bwUSI+wtrKgl6GEWIpKSkFYJKVA5Ir+FtbaoUxCeAd4gTOoZBgdnyTrbioNNQJbOBcMUc+fja2bdhne2T476xaQBobZkMWa/gROkj8uitd+33/+Xnf31TEgc6alTmwPA1se1yVDQg/KwzRmwH5flWHck0hxEHSHmngFewaC0floVgV9bztZ4hRlXjIuY47B0X46qL19aScnQ9Tj/PvYDzOwES5Z1saRZGyzQI1ah9vxrR0jF012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zlRZF4UKtw9opdTl3Lq1WxMImUChDgsZvltsbJlr0W1neaCYa2fYCFEX5uiVIjkzQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fd3422b-6c3f-4459-1224-08db9429d15b X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2023 13:59:13.1486 (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: FFErHsG56drzKdhguREF9y+a8gY4JqFFcJf72gRqN6sNPNbNy656yhEAxxMSerHwX9TxP6jaHMcwI6cmjDV2ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8799 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Since commit 6fffbc7ae137 ("PCI: Honor firmware's device disabled status"), this is redundant and does nothing, because enetc_pf_probe() no longer even gets called. Signed-off-by: Vladimir Oltean --- drivers/net/ethernet/freescale/enetc/enetc_pf.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c index d52ac0b6add6..e0a4cb7e3f50 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -1186,14 +1186,9 @@ static int enetc_init_port_rss_memory(struct enetc_si *si) static int enetc_pf_register_with_ierb(struct pci_dev *pdev) { - struct device_node *node = pdev->dev.of_node; struct platform_device *ierb_pdev; struct device_node *ierb_node; - /* Don't register with the IERB if the PF itself is disabled */ - if (!node || !of_device_is_available(node)) - return 0; - ierb_node = of_find_compatible_node(NULL, NULL, "fsl,ls1028a-enetc-ierb"); if (!ierb_node || !of_device_is_available(ierb_node)) @@ -1285,12 +1280,6 @@ static int enetc_pf_probe(struct pci_dev *pdev, goto err_psi_create; } - if (node && !of_device_is_available(node)) { - dev_info(&pdev->dev, "device is disabled, skipping\n"); - err = -ENODEV; - goto err_device_disabled; - } - pf = enetc_si_priv(si); pf->si = si; pf->total_vfs = pci_sriov_get_totalvfs(pdev); @@ -1370,7 +1359,6 @@ static int enetc_pf_probe(struct pci_dev *pdev, si->ndev = NULL; free_netdev(ndev); err_alloc_netdev: -err_device_disabled: err_setup_mac_addresses: enetc_psi_destroy(pdev); err_psi_create: