From patchwork Wed Jul 12 00:20:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13309466 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 E9909360 for ; Wed, 12 Jul 2023 00:20:50 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2084.outbound.protection.outlook.com [40.107.220.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C2BB171C for ; Tue, 11 Jul 2023 17:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XgNV7dM0S7Rcz3/4/pvDRNgtHMfIUP4taZE0b5bKEKVl8ylBx/ewlCUu3MG8Kow/UuR1AtktHAl2fQ6bEEHsEjzlNNmbBh7tKTD76fpnzHJIo53ASndQhli5q+0NzjvxRoudvHzhVMVvKcyVZea0kYTvYY1zOBwdwf5gAldMBgrQ58Al1VpFOKVAqHdQknXKJQ2/tkPJWwhnROB1AgOMjNkx2f9i9YUOlUwEZYy0cpTSHjy6JeWRJpM7oS7A6eTHLIS4RadTIEg25gfFLeRVT/cHQSHViEa3mHsy2hkLdAgfIKSIcqbcDItIJTTwVjXtq5sfmG/BGZ3WxlAcq/o3ww== 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=FiKRpcunudOFTbYRCNEIZTvQ0BA8R+g9Wr0JwvBPWEo=; b=c5RpMeMdcpF83XOfEpLSya4EEdLjfYGD7QrPk4I6I0HzC2vOh+GgnwEw+tV4HtXPljOPTTW38QZc9wTl2Tlf1M4FIY9Sv5J3UuJxCewsx6fbpJOq2LEnfvaBM6/Hhbm0dgf3W4F7XPZJOsMw5I3OIMXbyVNlYoOZ0178E6OHj6HqJOsedW1sGMil7qfvKAS60M6VwRfm3E3qF4mMPTY3zM4e3om9CiBVSzJ7FJ/Xmx87MlA+uEtUMLDMMLk1bDO3BUa8aH1/OGo+ZADIHeRFvXKV7ogfMv/IwpQiU9rqq2lEv9s+TS63ferfVOMJHKSDHKfJHjd5hRxDzIT19OPpOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FiKRpcunudOFTbYRCNEIZTvQ0BA8R+g9Wr0JwvBPWEo=; b=0BPhRl2DJ0W/7s1rgIr1WQ6GnXNNCM2Ni0RvXZpWeZC9d4G/761zRtmFAruvQlcasrjhfyIU5px4sjpGGZjWfhF7ILWwb6TQ9lGdhxoJP3juLsN4Z7wQXnfhSHMoxrG2cRDhyryVLBsHmPDUQ/c9WvcHdFFnkqei9mGUUi4J0x4= Received: from BN9P222CA0029.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::34) by BL3PR12MB6450.namprd12.prod.outlook.com (2603:10b6:208:3b9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul 2023 00:20:46 +0000 Received: from BN8NAM11FT014.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10c:cafe::c4) by BN9P222CA0029.outlook.office365.com (2603:10b6:408:10c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 00:20:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT014.mail.protection.outlook.com (10.13.177.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 00:20:46 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul 2023 19:20:45 -0500 From: Shannon Nelson To: , , CC: , , Shannon Nelson Subject: [PATCH net-next 1/5] ionic: remove dead device fail path Date: Tue, 11 Jul 2023 17:20:21 -0700 Message-ID: <20230712002025.24444-2-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230712002025.24444-1-shannon.nelson@amd.com> References: <20230712002025.24444-1-shannon.nelson@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT014:EE_|BL3PR12MB6450:EE_ X-MS-Office365-Filtering-Correlation-Id: e00ea921-e6b9-4865-d11a-08db826dd6ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fPRjmmWDWpLTOBH+m1Cjm1NOS7xP5HwXF4RAAk8V/yKEwnl7F5gDaziyStkO2njWBuxWA02AaVKzQR9eHDN5Pj1WhHbxfPsCi362657hPvmQiaSCh30FjNZ5XpN+2C+NRbFH1tOvqEabRu87j/CZDDtPFjEfYG8GWdq2r/C5o0NuS+vgLjqTj5fTvqVEVdXXGlnSscPnnOE6zaSGax1AviyfCCnCllmIjofAqK2wPoaplkMFHmPoKeRQ+et9x8XirWi4Ni8FEf4Aes0NdqrVihggU6WJJOr+4YvDLmAZrogYS69bY8Whe7LIo58ImnI53E0dGQQ9HT//A2XMZGjs5mTu83O6T9r+Rq5eP5iro4bT8SGDqJe+kousOS6Ixnxyqdush69aRCGKg19l0ByS0kUrnxn4IsKca5zF6yNdleYoukYlcqyEv70Ytik7tLA72HYlt/IPSULChmbmbJ7QuVSdnU4AFr+I3Uuy8VRB1W+uKrufBdwb8p7BH4RfVr/31sAclAqTmcl+UF0uu2jfsNGcSkU6l7QW8W3cr4rEtm2udUyQybnKZ8mJpGnvj3Pidr3JocxqX/78HN7Ou3MhptcSlTksIhN8p3XFzxX7kF12PkqWTBCUrY/p0z7zJSidJtqcNwxjzcjHwmSMjdIpkrxrlc3pRYKpH3T5p284O7lHXO0dAMWQ02lv2OIwqgZ9z4mWHtO8h0xtMdAU4hD71SiRasGDNLK4FCZShO0kINCP1NeKE2LRZS5oUb7V4CIXGtbSRVr/N9GLvUs4+8PKtA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(39860400002)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(336012)(82310400005)(316002)(6666004)(44832011)(81166007)(54906003)(4326008)(40480700001)(110136005)(478600001)(40460700003)(36756003)(2906002)(356005)(70586007)(70206006)(82740400003)(2616005)(83380400001)(16526019)(5660300002)(36860700001)(426003)(8676002)(8936002)(47076005)(186003)(26005)(41300700001)(86362001)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 00:20:46.7062 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e00ea921-e6b9-4865-d11a-08db826dd6ab X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT014.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6450 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Remove the probe error path code that leaves the driver bound to the device, but with essentially a dead device. This was useful maybe twice early in the driver's life and no longer makes sense to keep. Note: This patch is cherry-picked from commit 3a7af34fb6e because the following patchset is dependent on this change. This patch can be dropped from this series once net-next is updated Fixes: 30a1e6d0f8e2 ("ionic: keep ionic dev on lif init fail") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller --- drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index b8678da1cce5..ab7d217b98b3 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -353,12 +353,6 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ionic_reset(ionic); err_out_teardown: ionic_dev_teardown(ionic); - pci_clear_master(pdev); - /* Don't fail the probe for these errors, keep - * the hw interface around for inspection - */ - return 0; - err_out_unmap_bars: ionic_unmap_bars(ionic); err_out_pci_release_regions: From patchwork Wed Jul 12 00:20:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13309468 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 9A3E238F for ; Wed, 12 Jul 2023 00:20:51 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2052.outbound.protection.outlook.com [40.107.220.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81650171F for ; Tue, 11 Jul 2023 17:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KJMy8NkBpbl3BbjsJR+1mveFxUcNUUcRsDyoRaU+K64ElRXPkH7DHbkwSGPV2nImsl95tLmNz/4A/Jz/MyntBwA7bQRUCnzd3hGc7kDHaf2vw014SSHr5unkk5gdVUY8x8C3JZCnbLAd4wf2H/Nq4I/mcT4336txPDngVXkWfl8SzkLyF0mY8XUILQ2Q4SEBMDFM7KyRmnoFX1zfSudMZEv4XjZyk7RUDkvErssV3Yx/XX7KVxql1zIBlkoL57mOCcxXKnlDTbS1e4/bAsBK8O7dfVlf3gW4sf7/ICNxt4WbHVSfoyEgRDClD+hkacFjhfnK9XKbZMyD6WaC9AB9BQ== 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=4wd2epHwBfqBXOAvsv91YuWoVCS95c0F8uy708TH7L8=; b=Lto2JUFi6vzmm1x+NC9L5hT48hu3kX6TWt8kkL91DDlsCYNAAoji02jZ3woe7zVDG34ZIHi4RKu4q3VbZm+/lo6u5QBmVcSFIXeqiJPkD3ZrxUfAwt02sere5kiMvaNrEXlEaec7tDpDw+EIAZGBasLKjH1JxpM58Qot3RhzQEGO3db6vVRkGAHoXnsCNsFAusoUaLQTD6ihP7Nn8aRKAhXwanuMQnP9uZZ3zMAZ1bvbvpXRArA53kLGyI7nljzXAtKPWbNKbZgMM+tDRktUFbwzthzJ6T5d4MNTmI9gE4MpLJBcXuCI3SG7eC3iW5R+1xOZkPgRqu2ZRrkVMrIj1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4wd2epHwBfqBXOAvsv91YuWoVCS95c0F8uy708TH7L8=; b=pZwKk43ORnK/qzEy4rZdry5W16VBkuKDis3ibFgRamkWmgpytYJS+lqh6LAm1D6rNzIJ3/yQkOGhjnjyt8xSWvnxO1llzgEDMULL8A07EdsQXMNfDbPYtlGroOp8pyZPcSWEWu6pQ/NvwWiOxS3B4ZpYtap7D4pUXSwkp/xjoGs= Received: from BN1PR12CA0003.namprd12.prod.outlook.com (2603:10b6:408:e1::8) by MW3PR12MB4508.namprd12.prod.outlook.com (2603:10b6:303:5b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul 2023 00:20:48 +0000 Received: from BN8NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e1:cafe::ff) by BN1PR12CA0003.outlook.office365.com (2603:10b6:408:e1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 00:20:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT066.mail.protection.outlook.com (10.13.177.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 00:20:47 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul 2023 19:20:46 -0500 From: Shannon Nelson To: , , CC: , , Shannon Nelson Subject: [PATCH net-next 2/5] ionic: extract common bits from ionic_remove Date: Tue, 11 Jul 2023 17:20:22 -0700 Message-ID: <20230712002025.24444-3-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230712002025.24444-1-shannon.nelson@amd.com> References: <20230712002025.24444-1-shannon.nelson@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT066:EE_|MW3PR12MB4508:EE_ X-MS-Office365-Filtering-Correlation-Id: 05f287ad-62c6-480e-24ef-08db826dd733 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fZrGIfVeyjB9gBY1rjYBP1OoOGPA8slpDA/TF1CE2Bq+tPHsRxFEbFwFuOr31unQ0nzxPQWOc4BDpb4bz75QbIov4G5dNXM738jQyWCxbS0dwsqcF470I6a34xyr8AZvMQXtq0zcZaUl0YTQNDsO5WkF7rOx+xw2VU+SjC6RtMSB9pV906uQPa0K+TuJeJ8AO5fChVHkPxIEe3r4qer4UOLUXYaHubsHbDIKfSLGt+lnZD3rDM3gj50qNDWbTnNJD6bJkiZdxMFTST0q8L2vwN3iicZdufAz11ScOzY1nfRlf9bHtoqtYQsO2dyqZ8QNXH6v3ehfKcqrYkQun3vS5/FXaGcxzSKt51EeUFT+JIM1aR4bFiOUaGp+aYWLDClB8NsKkxPKz6bi48kcj36E7agd4RQY9d1nZL+SxpW3Qmxtg9XjfwffsZTeBj7aNYnlbrI1y1tIeConr559npS7WncoiK6AM31YVLIP7vvpr4degetpqQ3R57oB+dGZZQzAx8HEnpSZ8wJlFuNJDche/diFFOTRAZEoZznlKp0OM1D5qauyCetectaF8s15z/7WSqP6/454L/do1IRR+NXDPLgGfgqtL8wGOqYe0DTIuw4f0QU90N0YklxHAPoJpf2iWE8FuERC4GPy/lbKlNL2hHAZHeukC9hnaDVHTw/jQ481bx85462ozfr3v+D0a5kTocPapORrCcmXRFB89ykkvP8Xf0Y5uprf1McRx32yWF84HPZDI3KGO7peCMxEU0JQd5qpuoJQI/5wtwPRCgZDrQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(136003)(346002)(396003)(451199021)(40470700004)(46966006)(36840700001)(86362001)(40460700003)(82310400005)(8676002)(8936002)(186003)(16526019)(36860700001)(336012)(36756003)(47076005)(426003)(2906002)(2616005)(5660300002)(44832011)(1076003)(26005)(40480700001)(356005)(82740400003)(81166007)(6666004)(54906003)(110136005)(70206006)(70586007)(83380400001)(4326008)(478600001)(316002)(41300700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 00:20:47.6087 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05f287ad-62c6-480e-24ef-08db826dd733 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4508 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Pull out a chunk of code from ionic_remove() that will be common in teardown paths. Signed-off-by: Shannon Nelson --- .../ethernet/pensando/ionic/ionic_bus_pci.c | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index ab7d217b98b3..2bc3cab3967d 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -213,6 +213,13 @@ static int ionic_sriov_configure(struct pci_dev *pdev, int num_vfs) return ret; } +static void ionic_clear_pci(struct ionic *ionic) +{ + ionic_unmap_bars(ionic); + pci_release_regions(ionic->pdev); + pci_disable_device(ionic->pdev); +} + static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { struct device *dev = &pdev->dev; @@ -249,20 +256,20 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err = pci_request_regions(pdev, IONIC_DRV_NAME); if (err) { dev_err(dev, "Cannot request PCI regions: %d, aborting\n", err); - goto err_out_pci_disable_device; + goto err_out_clear_pci; } pcie_print_link_status(pdev); err = ionic_map_bars(ionic); if (err) - goto err_out_pci_release_regions; + goto err_out_clear_pci; /* Configure the device */ err = ionic_setup(ionic); if (err) { dev_err(dev, "Cannot setup device: %d, aborting\n", err); - goto err_out_unmap_bars; + goto err_out_clear_pci; } pci_set_master(pdev); @@ -353,12 +360,8 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ionic_reset(ionic); err_out_teardown: ionic_dev_teardown(ionic); -err_out_unmap_bars: - ionic_unmap_bars(ionic); -err_out_pci_release_regions: - pci_release_regions(pdev); -err_out_pci_disable_device: - pci_disable_device(pdev); +err_out_clear_pci: + ionic_clear_pci(ionic); err_out_debugfs_del_dev: ionic_debugfs_del_dev(ionic); err_out_clear_drvdata: @@ -386,9 +389,7 @@ static void ionic_remove(struct pci_dev *pdev) ionic_port_reset(ionic); ionic_reset(ionic); ionic_dev_teardown(ionic); - ionic_unmap_bars(ionic); - pci_release_regions(pdev); - pci_disable_device(pdev); + ionic_clear_pci(ionic); ionic_debugfs_del_dev(ionic); mutex_destroy(&ionic->dev_cmd_lock); ionic_devlink_free(ionic); From patchwork Wed Jul 12 00:20:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13309469 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 78B5D7F9 for ; Wed, 12 Jul 2023 00:20:52 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2074.outbound.protection.outlook.com [40.107.237.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC9BFFB for ; Tue, 11 Jul 2023 17:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CoX0QHbBwSP/tUY4oNOJxxiUe1Zzpq1NmcLM82iMeuRumXYBUNpbGWUZoqw5pwT8zGYgOv7TZojhns1d+q/TYKTe6DcNn/6UZ66Nqnv287AITYdAg6HSkQO5YZyl4ZNX3otEYVjL1WAQqGWYzhYP+6uf5+UsIYFEJHwdFF6zIB0Wz/lSi4GGzPtliMsWoOTofn7FyM3XpamNC9yrY4R07PYkOkl84Wp+3OJfqKQT1QIoxKUA5qk+73fswhNjeR+aziYixoR6Eh0EMqDv5hcaHiWxb/AdusXLeL52V6jp38ATQ4byv6msj0P+NwXpRVHPxN+vhzXGgr/8bbGqUu3ezw== 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=rnyeEAsZ+PXRzIeRfU9AXImqgcQaAMhVyW6nhLZtEpo=; b=mnWL90SVL19f30EnWcvIJJZlULWQ0n7KZOoWu8KwQcY6yzdnJtIfmfZxID4JJAfkfOhWtXwszIiEv2dB6txA3hgX3tVO7J1KCvB/uEd4UADBcSptSiJ+LxiXzyCI4iGQ3IdIpJ0caXkI/+QWdKVOV6LQ9ATWAFj7SUkwnuozniIbqNJSK8Q9pN/t/wPKOzAfeTpk5FnShlWPa8IN7AhC08ZlTlmenrmVQHBrDjPxfs1Mmbrzz2MwGR6fM+aSxZXfQMToaNAcQnSmTkOxWJVYdgoFSPsTh+Z8nNkABSGTKMzL8LEP0J3JsCBi2RHRw94PquA2j80UDMYM1AtQFl/RpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rnyeEAsZ+PXRzIeRfU9AXImqgcQaAMhVyW6nhLZtEpo=; b=W7RCIvM1UtDugtLCem/sjK0SEhOtv8erMUkVSHv57dSlpSIfA+yck6cNhUYjJsYQ9xEhnTWJu3s5c8LPW4tN6x0jtqe713XlTiX6AxUIMNybfjM2svGdzKrm8R+vBJvXZHSUev7Mu58XaWnG3olkANoTYp0XNc5DvxmV51XDQb0= Received: from BN1PR12CA0028.namprd12.prod.outlook.com (2603:10b6:408:e1::33) by SA3PR12MB7878.namprd12.prod.outlook.com (2603:10b6:806:31e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Wed, 12 Jul 2023 00:20:48 +0000 Received: from BN8NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e1:cafe::6e) by BN1PR12CA0028.outlook.office365.com (2603:10b6:408:e1::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 00:20:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT066.mail.protection.outlook.com (10.13.177.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 00:20:48 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul 2023 19:20:47 -0500 From: Shannon Nelson To: , , CC: , , Shannon Nelson Subject: [PATCH net-next 3/5] ionic: extract common bits from ionic_probe Date: Tue, 11 Jul 2023 17:20:23 -0700 Message-ID: <20230712002025.24444-4-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230712002025.24444-1-shannon.nelson@amd.com> References: <20230712002025.24444-1-shannon.nelson@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT066:EE_|SA3PR12MB7878:EE_ X-MS-Office365-Filtering-Correlation-Id: 910c193d-3629-4990-3063-08db826dd7c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8AKH98wmKoXI6ZTSv0fcFIx9+g/0+H4JYq9tVRXFfZfk534AnkONw/mBz/I7ysPzgQz9u2RDCxR31DQJKXh4kfvOQ8FsrkJD8h9X8FMOIlw8uRrbQMOp/8cRBkhORnbnaaBf5EwZwQsqqiCU5qevXtG+6KJN8UohvUeqWUw3vwXzplIx/3bVCwiPCKS71xBpT4U8hoen4dQZtEyqHVeY265e9Vhk4LPr01d664zQ9IqL+WzSgRbYwkfL9YQWegG9bnrtDYcK4dnMKi5ixwPi0uhx8rhFx11JBi8ahKHZrVZIRMV4BWNkr/dFy9g+jzWl0VoFRrLyI+Jj3+gaEYqyofLBLDD65veFLN+6Zn4pLl4PEz87mGzXsDDvjknmZSDwTKD+uD5SirzrOQozpJghmz53G76ev9MyzpDLlCZZVBmWIkpcg68EcqWxkq3P5oq93KCuwqImhgHEK1z5HwEIniKrZYWXvcjTohVwRuuhnM46QqebNiZ6zZXj5ml6IX9DrkdCEDBKEh2aipDbNPmJPDRvs6wnmcxvTtbohjBlvvaY8tYSBDfA1nK+GTB10wDX3o5cNRZhPFJFW8gMTAL69r4XpcEjdT74lq9bHuxaM6uHB0hF3lExeFtASBoVEbF4/vQ84SaJ8WqlVZ6GBnZuNrtF30KsbLbav/caWA9dqcFC3RxBLUvQDYDBzlRgwc0X2569IgFwlUe141xZnL+HurxNf2XDS6PO+qZ2WBuRr1taDjJM2u7lK2/P/ue9qXdUStjcrfURWFhxD05sWZ4ziA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(136003)(396003)(346002)(451199021)(46966006)(36840700001)(40470700004)(47076005)(426003)(336012)(83380400001)(1076003)(26005)(44832011)(186003)(2616005)(8676002)(8936002)(5660300002)(36860700001)(16526019)(316002)(2906002)(41300700001)(40460700003)(40480700001)(81166007)(6666004)(36756003)(82740400003)(356005)(4326008)(54906003)(82310400005)(70586007)(86362001)(70206006)(478600001)(110136005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 00:20:48.5462 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 910c193d-3629-4990-3063-08db826dd7c2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7878 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Pull out some chunks of code from ionic_probe() that will be common in rebuild paths. Signed-off-by: Shannon Nelson --- .../ethernet/pensando/ionic/ionic_bus_pci.c | 85 +++++++++++-------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index 2bc3cab3967d..b141a29177df 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -220,30 +220,12 @@ static void ionic_clear_pci(struct ionic *ionic) pci_disable_device(ionic->pdev); } -static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) +static int ionic_setup_one(struct ionic *ionic) { - struct device *dev = &pdev->dev; - struct ionic *ionic; - int num_vfs; + struct pci_dev *pdev = ionic->pdev; + struct device *dev = ionic->dev; int err; - ionic = ionic_devlink_alloc(dev); - if (!ionic) - return -ENOMEM; - - ionic->pdev = pdev; - ionic->dev = dev; - pci_set_drvdata(pdev, ionic); - mutex_init(&ionic->dev_cmd_lock); - - /* Query system for DMA addressing limitation for the device. */ - err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(IONIC_ADDR_LEN)); - if (err) { - dev_err(dev, "Unable to obtain 64-bit DMA for consistent allocations, aborting. err=%d\n", - err); - goto err_out_clear_drvdata; - } - ionic_debugfs_add_dev(ionic); /* Setup PCI device */ @@ -258,7 +240,6 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) dev_err(dev, "Cannot request PCI regions: %d, aborting\n", err); goto err_out_clear_pci; } - pcie_print_link_status(pdev); err = ionic_map_bars(ionic); @@ -286,24 +267,64 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_out_teardown; } - /* Configure the ports */ + /* Configure the port */ err = ionic_port_identify(ionic); if (err) { dev_err(dev, "Cannot identify port: %d, aborting\n", err); - goto err_out_reset; + goto err_out_teardown; } err = ionic_port_init(ionic); if (err) { dev_err(dev, "Cannot init port: %d, aborting\n", err); - goto err_out_reset; + goto err_out_teardown; } + return 0; + +err_out_teardown: + ionic_dev_teardown(ionic); +err_out_clear_pci: + ionic_clear_pci(ionic); +err_out_debugfs_del_dev: + ionic_debugfs_del_dev(ionic); + + return err; +} + +static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) +{ + struct device *dev = &pdev->dev; + struct ionic *ionic; + int num_vfs; + int err; + + ionic = ionic_devlink_alloc(dev); + if (!ionic) + return -ENOMEM; + + ionic->pdev = pdev; + ionic->dev = dev; + pci_set_drvdata(pdev, ionic); + mutex_init(&ionic->dev_cmd_lock); + + /* Query system for DMA addressing limitation for the device. */ + err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(IONIC_ADDR_LEN)); + if (err) { + dev_err(dev, "Unable to obtain 64-bit DMA for consistent allocations, aborting. err=%d\n", + err); + goto err_out; + } + + err = ionic_setup_one(ionic); + if (err) + goto err_out; + /* Allocate and init the LIF */ err = ionic_lif_size(ionic); if (err) { dev_err(dev, "Cannot size LIF: %d, aborting\n", err); - goto err_out_port_reset; + goto err_out_pci; } err = ionic_lif_alloc(ionic); @@ -354,17 +375,9 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ionic->lif = NULL; err_out_free_irqs: ionic_bus_free_irq_vectors(ionic); -err_out_port_reset: - ionic_port_reset(ionic); -err_out_reset: - ionic_reset(ionic); -err_out_teardown: - ionic_dev_teardown(ionic); -err_out_clear_pci: +err_out_pci: ionic_clear_pci(ionic); -err_out_debugfs_del_dev: - ionic_debugfs_del_dev(ionic); -err_out_clear_drvdata: +err_out: mutex_destroy(&ionic->dev_cmd_lock); ionic_devlink_free(ionic); From patchwork Wed Jul 12 00:20:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13309470 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 740A87F2 for ; Wed, 12 Jul 2023 00:20:56 +0000 (UTC) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2088.outbound.protection.outlook.com [40.107.101.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3CA4FB for ; Tue, 11 Jul 2023 17:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=boIc/GoZFTIDYn7vm2lxQ6L1AyPrQpcP3dPwZoeF4m+kxi0nVVYsClqW2XrDFgSBdp7X/dgXAfR+2eLaLD9I0hP3HaOusTXvGj2H7buIbiViTx7Bs8q4bh0yOGE/bc7znUytGWMZfw28Tboi1unNAQA0ztdFEa0kEChAgBDnvKdlKRFkO9WO+W4+p9PNAePQLAFpVo/I7E5D0+KSXBr1JOcHaXAOCpuoOTGi8Hg2pjKOLbNktHzdXgADUQo7Rsf9peNv1LNqqy3Mq8ecVNo6l1R7Q6mk0hOPFYmhSjbgjTPsniJB3WujvtquZVCKwEbq/XHnrYhjOrqghPk89f4uLg== 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=p69culPUvzbyPeOVzWaL6Zyka4UZbEMtewwAIyNc0Bg=; b=iqCBGF5GAsTfyfyGxbz+RTS6Qv+jUOP93kMTSlE5wm/wHkgsGtVpkYgtYz7u+YaLi6VOEmYGyTKI0awbW1bkqZarkgs5kTSzVz6aLWbcZe8xmDOx6vOKV/EQ1PIFE4yzhj7VOCf2efvWwZcYhO0TKaFOquzZa/UbvjUDcG6jCbrnZECzi4m7QUebYjUvVadE/nOvzOL0bRHPQmbbv3H/tNgnq9fxKbhxqkL7FK5U4JsWPxamK/Qvxb28bgD49uRCNU0KwgY7blruRANei4IBGlSC3ezk8pSBe5k1TPfsYX5CRR8yVJzRPez572qnBpunsRq/p5Vmlxc6PWTrpIsOAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p69culPUvzbyPeOVzWaL6Zyka4UZbEMtewwAIyNc0Bg=; b=tPUaHCBFafYzC4I9D+OPDFA8hXDtbQOUZYrcX6YNBuLjDccbhKeJ8DEFZXeijXyN8IZ2L72JavG00e2nYyJWJ7JTSkc3wrUHJZ9W22AHSn9D69kizdn/XTEqK1znAJAj7uPi0ykzd/evanX7vBEQQ1XRX8mldA8n8oeWiENmlMw= Received: from BN1PR12CA0013.namprd12.prod.outlook.com (2603:10b6:408:e1::18) by CH2PR12MB4118.namprd12.prod.outlook.com (2603:10b6:610:a4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Wed, 12 Jul 2023 00:20:49 +0000 Received: from BN8NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e1:cafe::ee) by BN1PR12CA0013.outlook.office365.com (2603:10b6:408:e1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 00:20:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT066.mail.protection.outlook.com (10.13.177.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 00:20:49 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul 2023 19:20:48 -0500 From: Shannon Nelson To: , , CC: , , Shannon Nelson Subject: [PATCH net-next 4/5] ionic: pull out common bits from fw_up Date: Tue, 11 Jul 2023 17:20:24 -0700 Message-ID: <20230712002025.24444-5-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230712002025.24444-1-shannon.nelson@amd.com> References: <20230712002025.24444-1-shannon.nelson@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT066:EE_|CH2PR12MB4118:EE_ X-MS-Office365-Filtering-Correlation-Id: 4414c958-36e8-48df-0258-08db826dd837 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oZXprCJ8bhP6dj1AkcZHqnoU4msv8TGf0C8x8qwUUcVOF0iQsez7LGCWCEE57Kvuh4ydt014jNlGg8zPE1Ul9j9t4cz6KHLdnbxH7QUP7XdmvWBJSgEPz8zDZ6yf0+v6OWqgj0LvSXomAjyIqOTvUKXdoqupAOvEu49UXEjfWZ6235RWzzgnsyKILdx9UDzIFztSJGURflNA9C8G9ruv4pfkVJXGudte1D1yZcUDFAWlw+/KTlZA8pB9aryNP+s5TRgwafKUfReI6fytTZ9mHdw7v2NNWNzrWr9FT4XNflPP2mU9ukHPaBwfQ8d+GwiJ23d8Kq9NL3eGsDky3caXbJD95d3KhVmWxNJRHfP6HczKjbMFxsJMi2KFsvGaRN5/LTkT8/YkEonPAXl3T9b9hZ2JtkuAvCEzxZsUEYDigRaF35DZZ9JQIPyPPTu6kvxyCAXPnq8wgGXPlrvWjBMmkbxi/RyOhtjLjXu+xNAYJt5fW+i+QL5RNplkNoDigNfTl2kiHgb1C1g3gTacV8KJW3GL99HVoPrJ6h6j0jWJLXPQWZfJWiGiuEJhF0xuN3ICk1jwEXPzSHgvKM2PE3+6WHLwjI+CMwoUh3BcqImP9tz1S2+TRXEw553M6KTvgYflL1exz7InOiCBSjq67xGTwHP5kGbzfIgvjcxs5ZqglMeeh2Ts/ke3Bq3aU2aKguL0rKC363ohsZD7wtROXw6X871nzkgzdxJ6dWDvAVCqumCNgto8JI5NFlDgt3vNjz6Ce6Lgz/+o9M2OPHUpX/9boQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(396003)(136003)(346002)(451199021)(40470700004)(36840700001)(46966006)(82740400003)(356005)(81166007)(426003)(336012)(1076003)(2616005)(16526019)(47076005)(26005)(83380400001)(186003)(40480700001)(36860700001)(44832011)(8936002)(2906002)(40460700003)(8676002)(5660300002)(36756003)(70586007)(6666004)(478600001)(4326008)(70206006)(110136005)(54906003)(316002)(86362001)(41300700001)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 00:20:49.3118 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4414c958-36e8-48df-0258-08db826dd837 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4118 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Pull out some code from ionic_lif_handle_fw_up() that can be used in the coming FLR recovery patch. Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 66 ++++++++++++------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 7c20a44e549b..57ab25b9108e 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -3271,27 +3271,11 @@ static void ionic_lif_handle_fw_down(struct ionic_lif *lif) dev_info(ionic->dev, "FW Down: LIFs stopped\n"); } -static void ionic_lif_handle_fw_up(struct ionic_lif *lif) +static int ionic_restart_lif(struct ionic_lif *lif) { struct ionic *ionic = lif->ionic; int err; - if (!test_bit(IONIC_LIF_F_FW_RESET, lif->state)) - return; - - dev_info(ionic->dev, "FW Up: restarting LIFs\n"); - - ionic_init_devinfo(ionic); - err = ionic_identify(ionic); - if (err) - goto err_out; - err = ionic_port_identify(ionic); - if (err) - goto err_out; - err = ionic_port_init(ionic); - if (err) - goto err_out; - mutex_lock(&lif->queue_lock); if (test_and_clear_bit(IONIC_LIF_F_BROKEN, lif->state)) @@ -3322,17 +3306,13 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif) goto err_txrx_free; } + clear_bit(IONIC_LIF_F_FW_RESET, lif->state); mutex_unlock(&lif->queue_lock); - clear_bit(IONIC_LIF_F_FW_RESET, lif->state); ionic_link_status_check_request(lif, CAN_SLEEP); netif_device_attach(lif->netdev); - dev_info(ionic->dev, "FW Up: LIFs restarted\n"); - /* restore the hardware timestamping queues */ - ionic_lif_hwstamp_replay(lif); - - return; + return 0; err_txrx_free: ionic_txrx_free(lif); @@ -3342,6 +3322,46 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif) ionic_qcqs_free(lif); err_unlock: mutex_unlock(&lif->queue_lock); + + return err; +} + +static void ionic_lif_handle_fw_up(struct ionic_lif *lif) +{ + struct ionic *ionic = lif->ionic; + int err; + + if (!test_bit(IONIC_LIF_F_FW_RESET, lif->state)) + return; + + dev_info(ionic->dev, "FW Up: restarting LIFs\n"); + + /* This is a little different from what happens at + * probe time because the LIF already exists so we + * just need to reanimate it. + */ + ionic_init_devinfo(ionic); + err = ionic_identify(ionic); + if (err) + goto err_out; + err = ionic_port_identify(ionic); + if (err) + goto err_out; + err = ionic_port_init(ionic); + if (err) + goto err_out; + + err = ionic_restart_lif(lif); + if (err) + goto err_out; + + dev_info(ionic->dev, "FW Up: LIFs restarted\n"); + + /* restore the hardware timestamping queues */ + ionic_lif_hwstamp_replay(lif); + + return; + err_out: dev_err(ionic->dev, "FW Up: LIFs restart failed - err %d\n", err); } From patchwork Wed Jul 12 00:20:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13309471 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 82AC1A34 for ; Wed, 12 Jul 2023 00:20:59 +0000 (UTC) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2082.outbound.protection.outlook.com [40.107.93.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FD50FB for ; Tue, 11 Jul 2023 17:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hrkdr3FspaCrpssgP0Nt9MadFUnLDwJs+LJuk6Fd5gEyK24WweT5JxCHrf0FTZNJvctw/EQwiQoACn3S9QA4wwVRQxpZ+cuENUHk7wA1CpsI593m3v5pDKnmAgQ0H159xVlCNGX/jUYb4pwcFBM9O8I82IZPiBah+nN1evMj+VRN8iYwByxL7s5u9imvlG26qVr3DKFkYHxRTz54Cs0O7dwE318K5WFP1MB5rJCvjaZEDCN5thQ2DP+oD2wTiY6UviIxad5aCmUC0hMQAse5gyodNmuAB9DkMmFdtoWt96h5pNSXL7F1IScQtE00fpomD1vuMCUM45yyrX0QTzIALg== 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=EKzGaYaEYrAQYe+xrWtcXi6pabrbtUZ5KH8DW24jpTg=; b=Ri/B/BzBxMLo05NSzhmJpQCCF0qY04Xj3yG8pePSyIYOBsDBdN2TsFozj2hdW1dlfiPrJLvGezH/5Er9N5EmLd6FoQGf1FKSkSfLQCf+wvcILYrTBHdlobJ4sQu9Ipx3JV5TNJDZc/1MNVs0dxVW+Eh0SfDX1p5JQiZvQAniOxNsb9ZTQqk6X8qgyYINFrzwmrazo0U4t0HpL8xeG0qySnjIdTNfSuPkxTCv/DinMogabGVMq9UWo3lhLu2mZ+VWu0dVo/9wVe6TxlOSZx+hh/4/Z0Qvawyrhx25XZ602VAPjx1ffzRUn71n/9j8Rg4bGMPYfTxsrZC0lEtyMocrEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EKzGaYaEYrAQYe+xrWtcXi6pabrbtUZ5KH8DW24jpTg=; b=Hu0h9+p3yW7b7PvFBT1WWnAGSKYgdo9IB4eMFAtxWjYSh9UrRUgVAgV03x0gUUvSpUNnrpjjUuazayeUdFY3Ky7pjd+OtUFAcz9Bjlqs0GC0mFDX3pvdTLNu1R53AhE91jZOCcpmgp7u7BPH0Vcy4R7f9frRY0wgEQ1T2R4kPh8= Received: from BN8PR15CA0055.namprd15.prod.outlook.com (2603:10b6:408:80::32) by CH3PR12MB7715.namprd12.prod.outlook.com (2603:10b6:610:151::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Wed, 12 Jul 2023 00:20:50 +0000 Received: from BN8NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:408:80:cafe::28) by BN8PR15CA0055.outlook.office365.com (2603:10b6:408:80::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend Transport; Wed, 12 Jul 2023 00:20:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT051.mail.protection.outlook.com (10.13.177.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.20 via Frontend Transport; Wed, 12 Jul 2023 00:20:50 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul 2023 19:20:49 -0500 From: Shannon Nelson To: , , CC: , , Shannon Nelson Subject: [PATCH net-next 5/5] ionic: add FLR recovery support Date: Tue, 11 Jul 2023 17:20:25 -0700 Message-ID: <20230712002025.24444-6-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230712002025.24444-1-shannon.nelson@amd.com> References: <20230712002025.24444-1-shannon.nelson@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT051:EE_|CH3PR12MB7715:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a34de2d-e4eb-4576-6fbb-08db826dd8ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YVXtm9oVwsyDBt7KSJ1yt5NIEpyis0fg0GNCYnt3awBxNKmKsr3g/l9KVS6CUwO2tC4Kt4hDYLp22HgIoyAjQoK0PipWFBQOawUZqwzdoAcMfZGX4It9ShkHaryo2VOEZ1sGXAMtxY/w/R+O2PgLEwg/ra2FrnEQgVS/o2MdegO+rolX95oH6YeRSqIWnhpphoMT4W5LXI96jrgfKcudk7GKd08qdADXEjFNDoeDx9hODw+rFYNlPWBkULHdSqZUImPEuxhyh1M0YECaZVkQEVCOwYY5zEELvCOSpAOGP3uoocTW3sFnteSBEbqzEjYh/CigqJPmfD71X8EduSH74YJPVzwleH8PEZGt2tJZbfyKq5ucE5ZhkMiWfITD6fmwHs/Ap1C4+Zlto8SJ6Wo3c+F5GB7g9bM3II74g9tApx0kAjT0qa+clOjMRbBRgXStl59L7jTuM1NjiqCXFYmsqOE3eSgP9c5FfenBuZVW/b3OPW+fl0VcVqSM9/yZeQtUjx00YBeRiHk0taY0ZJpZWbOJeOI+RkZYwgapi9kxrCuM2K2iBpvIIt3Nc1hRARJi3kEoYDzkw2StgW6Lx3K1huLRwxGtxLMwo1rp1grs6+TUfeIcbvCEHKDYX534XbVKlPaShWRiZl7Dcp02vRcDahJMb9AWs27S8PdENMlr6Zigw/mRx+WNrnPu1SfRQrQMDVA7ordUPcYctzsZKPS65CYWcSO9Iapitp34LnpL2XGia+HLkcn0F6Xw8gUqi9sP+5OGVxYUJdKjNeL1KYnmmw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(451199021)(40470700004)(36840700001)(46966006)(5660300002)(44832011)(316002)(70206006)(41300700001)(70586007)(8936002)(2906002)(4326008)(6666004)(8676002)(54906003)(47076005)(1076003)(26005)(83380400001)(16526019)(186003)(2616005)(426003)(336012)(36860700001)(40460700003)(110136005)(478600001)(82740400003)(81166007)(356005)(82310400005)(36756003)(86362001)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 00:20:50.0814 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1a34de2d-e4eb-4576-6fbb-08db826dd8ac X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7715 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Add support for the PCI reset handlers in order to manage an FLR event. Signed-off-by: Shannon Nelson --- .../ethernet/pensando/ionic/ionic_bus_pci.c | 58 +++++++++++++++++++ .../net/ethernet/pensando/ionic/ionic_lif.c | 8 +-- .../net/ethernet/pensando/ionic/ionic_lif.h | 5 ++ 3 files changed, 67 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index b141a29177df..8679d463e98a 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -320,6 +320,8 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (err) goto err_out; + pci_save_state(pdev); + /* Allocate and init the LIF */ err = ionic_lif_size(ionic); if (err) { @@ -408,12 +410,68 @@ static void ionic_remove(struct pci_dev *pdev) ionic_devlink_free(ionic); } +static void ionic_reset_prepare(struct pci_dev *pdev) +{ + struct ionic *ionic = pci_get_drvdata(pdev); + struct ionic_lif *lif = ionic->lif; + + dev_dbg(ionic->dev, "%s: device stopping\n", __func__); + + del_timer_sync(&ionic->watchdog_timer); + cancel_work_sync(&lif->deferred.work); + + mutex_lock(&lif->queue_lock); + ionic_stop_queues_reconfig(lif); + ionic_txrx_free(lif); + ionic_lif_deinit(lif); + ionic_qcqs_free(lif); + mutex_unlock(&lif->queue_lock); + + ionic_dev_teardown(ionic); + ionic_clear_pci(ionic); + ionic_debugfs_del_dev(ionic); +} + +static void ionic_reset_done(struct pci_dev *pdev) +{ + struct ionic *ionic = pci_get_drvdata(pdev); + struct ionic_lif *lif = ionic->lif; + int err; + + err = ionic_setup_one(ionic); + if (err) + goto err_out; + + pci_restore_state(pdev); + pci_save_state(pdev); + + ionic_debugfs_add_sizes(ionic); + ionic_debugfs_add_lif(ionic->lif); + + err = ionic_restart_lif(lif); + if (err) + goto err_out; + + mod_timer(&ionic->watchdog_timer, jiffies + 1); + +err_out: + dev_dbg(ionic->dev, "%s: device recovery %s\n", + __func__, err ? "failed" : "done"); +} + +static const struct pci_error_handlers ionic_err_handler = { + /* FLR handling */ + .reset_prepare = ionic_reset_prepare, + .reset_done = ionic_reset_done, +}; + static struct pci_driver ionic_driver = { .name = IONIC_DRV_NAME, .id_table = ionic_id_table, .probe = ionic_probe, .remove = ionic_remove, .sriov_configure = ionic_sriov_configure, + .err_handler = &ionic_err_handler }; int ionic_bus_register_driver(void) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 57ab25b9108e..e70952e508bf 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -434,7 +434,7 @@ static void ionic_qcq_free(struct ionic_lif *lif, struct ionic_qcq *qcq) } } -static void ionic_qcqs_free(struct ionic_lif *lif) +void ionic_qcqs_free(struct ionic_lif *lif) { struct device *dev = lif->ionic->dev; struct ionic_qcq *adminqcq; @@ -1759,7 +1759,7 @@ static int ionic_set_mac_address(struct net_device *netdev, void *sa) return ionic_lif_addr_add(netdev_priv(netdev), mac); } -static void ionic_stop_queues_reconfig(struct ionic_lif *lif) +void ionic_stop_queues_reconfig(struct ionic_lif *lif) { /* Stop and clean the queues before reconfiguration */ netif_device_detach(lif->netdev); @@ -2014,7 +2014,7 @@ static void ionic_txrx_deinit(struct ionic_lif *lif) } } -static void ionic_txrx_free(struct ionic_lif *lif) +void ionic_txrx_free(struct ionic_lif *lif) { unsigned int i; @@ -3271,7 +3271,7 @@ static void ionic_lif_handle_fw_down(struct ionic_lif *lif) dev_info(ionic->dev, "FW Down: LIFs stopped\n"); } -static int ionic_restart_lif(struct ionic_lif *lif) +int ionic_restart_lif(struct ionic_lif *lif) { struct ionic *ionic = lif->ionic; int err; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h index fd2ea670e7d8..457c24195ca6 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -325,6 +325,11 @@ void ionic_lif_deinit(struct ionic_lif *lif); int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr); int ionic_lif_addr_del(struct ionic_lif *lif, const u8 *addr); +void ionic_stop_queues_reconfig(struct ionic_lif *lif); +void ionic_txrx_free(struct ionic_lif *lif); +void ionic_qcqs_free(struct ionic_lif *lif); +int ionic_restart_lif(struct ionic_lif *lif); + int ionic_lif_register(struct ionic_lif *lif); void ionic_lif_unregister(struct ionic_lif *lif); int ionic_lif_identify(struct ionic *ionic, u8 lif_type,