From patchwork Thu Jul 13 19:29:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13312595 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 AB7B3200D8 for ; Thu, 13 Jul 2023 19:30:11 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2084.outbound.protection.outlook.com [40.107.243.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 268E6272C for ; Thu, 13 Jul 2023 12:30:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GMDnL6jKs7V/XMRZ+6qh0DCrL03ikJxoCKwMy/WLf50WKPSBjtpT/qH6v+j5FtzF+Dm1HZTfTcE9uSQeSiAviVgOA95WYkH/7KXy8cEOswjvQdVQz+g9W8paxFuj8zJPPALZbcQQUrxNSR/Z5lvbfhDEiW+7r6LAE2LsN4zJvi2ARCtUEz3f9ek5++h+UUnafXID2NeG9sUd3bGqZifz+jw445A0YK128W1s8dMNW218GRw7spgZUSR7yha6tJHct/ciu4TL2wpmuIhKn+ms7WzZK2ZPARiCkbZ+ybjDPV6AD/MRKbMh95KHFuPdV49yR5ATD3ddS6PK9Ri6bNSwXQ== 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=lcMKufzSXzQTiGJFKOYf90WM+0gaToSEutvBP7Dgmqm3/BBdjGRKorHO+r/Vn/CfC4wA6Y7Gb/k9HLFS/SHxg5easeZQZA4PU9DS2ZkF6md1mRH2gfgsOYSDDUTG4uLCZR2nW7xAwnzjouM+FjhNUyIWnFxQNsOYET3lmysiMSRt6uzQ26aZfn2L0mcY+jC9OOtwyHBq6LzyM4UmURs2HT7v04jhxT1YXn79bTec9FfEeAjkElLDS+wFlLFaKOJv+nDkGq8Yqgqj5utxpNRLyTpZbDvNQoquYR72WVOprlU7b2XLzWykFBdBHMG1YTq3SarqNI267t6GUQ9qCvxDbQ== 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=NWFOOC5Ps6Q8oUpnhb/0wJZvryPZ516hrOnbluqamgcC2ix7yD6GmTG4gB4CReltyXqvFYVpadgYY3xO/837vye5t8iKPJ9hr6zsja2+6MkJquel11427XU4zIyLY3kIkjJqwtAvXc3rZcreaSvp9g+zlaNrRBjnyr5srX7zV5U= Received: from BN1PR14CA0029.namprd14.prod.outlook.com (2603:10b6:408:e3::34) by DM4PR12MB6255.namprd12.prod.outlook.com (2603:10b6:8:a4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.22; Thu, 13 Jul 2023 19:29:59 +0000 Received: from BN8NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e3:cafe::75) by BN1PR14CA0029.outlook.office365.com (2603:10b6:408:e3::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 19:29:57 +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 BN8NAM11FT043.mail.protection.outlook.com (10.13.177.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.26 via Frontend Transport; Thu, 13 Jul 2023 19:29:57 +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; Thu, 13 Jul 2023 14:29:56 -0500 From: Shannon Nelson To: , , , CC: , , Shannon Nelson Subject: [PATCH v2 net-next 1/5] ionic: remove dead device fail path Date: Thu, 13 Jul 2023 12:29:32 -0700 Message-ID: <20230713192936.45152-2-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230713192936.45152-1-shannon.nelson@amd.com> References: <20230713192936.45152-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: BN8NAM11FT043:EE_|DM4PR12MB6255:EE_ X-MS-Office365-Filtering-Correlation-Id: b29175b0-cf37-42b4-cfd5-08db83d78b16 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YThs9kOAu/K/gqXKBpf4SHAaS2ixlVIUFFKsay0XxVUqQP1KA+2YeRFb5UVfCAi5OksfEFcwh4b769eIEZX8UohsZjZ4rbM617vmC8qWsa12jemTuV4tGwuiS7fjGSlyQSjGi15pqYbtP/P5ZhW1ls/LyztyX1ZCWTVGDvPz8TF5NI+8xuByQQiW/vILCEVLzkpD8l5qy63VdGFKSGC+SLyVbLGwTvRp6aJBBFQlNJJDetrWtN4hYgePKoHAbfLTTO+buvcgfold/BtDNX3yWfwTX18SYVKMXygdF48iolxR9XZUB52dq9aZgof8WxX+BXogFIhxPuM1s1oAAxa/7ito/Da17BD9JvKg4Y20mSdVBWxzy190HptzWeM7pemZxviXSNyVdgJT6rQuvHYqZ/5M17LlqnsG9VNgaZqjXRQ0YXxb3oPoflfzC4KGBEJTPjSDTT+bqY241NEFxCD9Xx1brGsCN9P/uiIDOft56cjvJEwQPqJ/4u1ZBsosX4A3a1tZ6EXMcRPVcTDbQdlRO7mlz1fWk3YLasQw7CfSReFFbbF73OtZr/5o1/ppeWBR0lVMfxEnR08gViBgm56kBTQ9Auy47KWPqJjbwcPXb6uzRMBKxzFmxjzQrnuuYs8hCp+g2Pr/GI7TdOj/qXYUmUPKJ79Q1KqRARK6EhTJmOmfEaY+lXsUksQrBPzCHPtMR541ozza5K9IgoH6asT/lLz2jN/dtzFdbMkYQIqmbfPzhwJrsrJhVchPF4aF+9GKUO8h/fYPW96CLF91z0XHRw== 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)(136003)(376002)(346002)(396003)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(40460700003)(6666004)(36860700001)(47076005)(16526019)(426003)(1076003)(83380400001)(336012)(82310400005)(186003)(36756003)(2616005)(26005)(86362001)(356005)(82740400003)(81166007)(40480700001)(70206006)(4326008)(70586007)(2906002)(41300700001)(316002)(44832011)(8936002)(8676002)(110136005)(5660300002)(54906003)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 19:29:57.7323 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b29175b0-cf37-42b4-cfd5-08db83d78b16 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: BN8NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6255 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 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 Thu Jul 13 19:29:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13312592 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 BA1B71DDEE for ; Thu, 13 Jul 2023 19:30:09 +0000 (UTC) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2061.outbound.protection.outlook.com [40.107.100.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9656C2D77 for ; Thu, 13 Jul 2023 12:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=odgoQvNouQ+1Yy75iRt8qW/ZRmM8hQpiPOHOQv5Gm2sHzFb6bkr+xBuRnXF7xVFNmDsc8o/k8s62uKo33uakhhXJTgG1/VpHVm0ek3NwUJrfjxuK7NBtYu/GspiG47kuXYZ56F8p3cIGAoYzX1WMiVIMcJZrXts5eIFLjZI4bIIln9ldTOMJLKva4oc72FOMLxvlbZ3329HCS19PvW2gXLb5wDauzJpl9VA0BUV7LhnLivoItGVukZHGn2jtBTXlhKtR6nH0XfOZJ5g8vczjF2uenpBlOaYpDBOPghoD0CLY8gBijmDA/+LR+C1m9aEN3lFUxzq/I8vaiHc8g6YuLA== 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=g9nuXYk99uZNeYvIL8Z5/CgtV3gHX+ULMFWfkwglVcEOalnJa+cdhJTWTWO3zCk4n5GT05VdU8pmS0LsI6b9L8NW5I5LA6kKgTeDbK2oAcSolW9SC4x5rfE+mLyO6gurPZUFP4POi7j9GGs+P0DoOhUPE3YYcLD+M1nO0qmWanzB/sGx3jlIjAPoc0VBKgwrsniMUer6FMuN4qnaCAearFv5Irfw4lWs6Bp2TSJ2PQMwqiLE1hSf7BRpMGFax+wBKDv1T2eOt34n5dN2+IoPMeQ5UzH+ABzmU+3x91PNUxI8LGGWvWpjir7W5vn7XXMkXmf5HO1N2tl/fqMAxnlKZw== 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=LLNxRmYnrhRzns1/E7NIQZWf2viW9B3CGfDYNgPTYCF7tLItb6lA7JrjNMyPdt5LNVIFt2IIaQOhz4f0EUhrTegkY+sJLsy185yNKtWqt75MwGQHaDzvxC9jJCcNVoMMMMei4MuEpc6u1lzqAJVCni0YQEhTfoP3exYOwGCWUJ8= Received: from BN9P223CA0001.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::6) by CY8PR12MB7315.namprd12.prod.outlook.com (2603:10b6:930:51::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Thu, 13 Jul 2023 19:30:00 +0000 Received: from BN8NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10b:cafe::56) by BN9P223CA0001.outlook.office365.com (2603:10b6:408:10b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.25 via Frontend Transport; Thu, 13 Jul 2023 19:29:59 +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 BN8NAM11FT043.mail.protection.outlook.com (10.13.177.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.26 via Frontend Transport; Thu, 13 Jul 2023 19:29:59 +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; Thu, 13 Jul 2023 14:29:57 -0500 From: Shannon Nelson To: , , , CC: , , Shannon Nelson Subject: [PATCH v2 net-next 2/5] ionic: extract common bits from ionic_remove Date: Thu, 13 Jul 2023 12:29:33 -0700 Message-ID: <20230713192936.45152-3-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230713192936.45152-1-shannon.nelson@amd.com> References: <20230713192936.45152-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: BN8NAM11FT043:EE_|CY8PR12MB7315:EE_ X-MS-Office365-Filtering-Correlation-Id: 7010d8e7-7433-4188-ce3e-08db83d78c5f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0Hv83ltFibN00dQNSVYxypW3oUPt3O5yr9El+7dKQ1QSUURjBmBLOqrRxPOy0bEYqMg6M74mjBqZNeY6kVoe6jCktFYcY7uXm1USr0AJXMPFPeK/uqWDKyh97OngQ6KERSeCA+WY0j2isnw5MKSVwwUqJLbyqLeSiNbOomZdFrxgRd/AiSme6GQKAEhPk/2BNkEo9dsNq/1T6FC8D/qhFA9JQTF/93jFa9X69UmpzZZwokcK69BuQ7XkpzCiyHDGnNMd1JCet06G52AXp3KDKwZELCM+ZLj8udOeaZRYzHUfjZHA7y7DCk7Q7y+b7JCLMXC9s1AzeJOsIudU/dVQmY6Q0Q0AKBIZwareS+10hoLJG423jyrXINU81lZu6aavPn9p5y8qNbEvyzzGoPohJWa2FSKBzaufL+6ZytbGu8fX4a5KaDKTThCAxZO3jFbSsnvcOS8K6q9zXHvnrWXsE6kMx4vvdj+B5zK98OiIH8dco61LCCGU+8HgXvWJckmN1SxuGz5CG+0s8QdPNx3l6/mekAytwDxAunXvUGP6C1RBTgNTPY1vhxjF1lNXcaWEh438DK7RStkBtkfATd6CqNTkpEI2yQnschRkr+hvkN1qwgZxMTr9WxZSCELuqPg3n4u0QyfVyE/9lF6x6JV05+sPSzcf/aB3Ivo/HDB/XJO68DtuUYZowiaGumw0MZj4hTtCKZtL5nfnDl2xyDLGtCRrDhxpM2cBEhCwlCRBZj1Jc/cOJl//Id2mXPrmUhAZNl3+NMJS1YwjTI8aihP8ug== 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)(136003)(396003)(346002)(376002)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(478600001)(6666004)(83380400001)(36756003)(47076005)(26005)(2616005)(186003)(1076003)(16526019)(426003)(40460700003)(336012)(40480700001)(36860700001)(316002)(82310400005)(2906002)(41300700001)(356005)(82740400003)(81166007)(4326008)(70206006)(70586007)(86362001)(44832011)(8936002)(5660300002)(8676002)(54906003)(110136005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 19:29:59.8884 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7010d8e7-7433-4188-ce3e-08db83d78c5f 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: BN8NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7315 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 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 Thu Jul 13 19:29:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13312594 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 07BE51F937 for ; Thu, 13 Jul 2023 19:30:09 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2053.outbound.protection.outlook.com [40.107.243.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE9D82D78 for ; Thu, 13 Jul 2023 12:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kWXbzqm9zXS4tSvlycgdHMiJxEsO/KHwPL5LV0kaK097z9iAuJyEa49N3/tXs/sMUQjI99qPlEBITkyMniFtHe3qqO/7CtRHSguvl27Z9vwMzJc7fbMbXSWf2T1+24VIf3v5zHfMGy9jXZiR5o6qndYUsBgdo1Atq9dPLgIgebgl50PcOJCaU6E1Ztf2pnz8ZmexWBg+jotLpXC9nF1MebhIG9WEHpUXaZ04PemuPOWlgYEwRj7Rwb9hTrmCKFL85rIjFqiwrh4oY2f7nl22L1FI7wJLliUMJ2BmUrMK4hXvHdINgywSzVzeKfD+2YXK4a24grlxRQ1tuMabY6YDCQ== 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=CFa/SiJqQ++pxobePuGuJ7nqujHPX5b48pdyLmoAqPzBzeJ8G7rPaSL2iX+HuMULJOVvuhLd69eECki+K+opoYg3KaGkSc43K4tjg8Hm2iENsPvPhAlCvjhkGRNSGY3D9QuNCOUefJyG4VrXhcoTpj0LG4t+beDndyn7ZiZH1h5rk80OhteorNirq7e72Dg/wk7s2oFYpYTwHeJ48Hz0MXqXka/Mqn6X6b+ioRW6xzsfecmri6Z3irIhyB4h43XjwtvgkCQx7JdAvsfKWXtcH497i2JhatzIJqIjU840kcAH4b2U2W+W98Rb4q5BY/eQ/mon3vd0mVNqr9XbjQ4hnQ== 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=2TpU4K11kMrbFTOHqU6zatTEDk+B3TTJUrw3KhYeUW4lXa/zG3Hp6jEsRDlMA1ECW1LFECAd9tiT3PlC6GyAGY4+LNsNpU82ICtML7pjK+8oVe+f4Wukx44CB+VrDNEZh3iflLDfJI9f0XbSguCftUyuidPRMJ+OQrpQF4L9/VE= Received: from BN9P223CA0007.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::12) by CY8PR12MB8196.namprd12.prod.outlook.com (2603:10b6:930:78::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.26; Thu, 13 Jul 2023 19:30:00 +0000 Received: from BN8NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10b:cafe::ef) by BN9P223CA0007.outlook.office365.com (2603:10b6:408:10b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 19:30:00 +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 BN8NAM11FT043.mail.protection.outlook.com (10.13.177.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.26 via Frontend Transport; Thu, 13 Jul 2023 19:30:00 +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; Thu, 13 Jul 2023 14:29:58 -0500 From: Shannon Nelson To: , , , CC: , , Shannon Nelson Subject: [PATCH v2 net-next 3/5] ionic: extract common bits from ionic_probe Date: Thu, 13 Jul 2023 12:29:34 -0700 Message-ID: <20230713192936.45152-4-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230713192936.45152-1-shannon.nelson@amd.com> References: <20230713192936.45152-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: BN8NAM11FT043:EE_|CY8PR12MB8196:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d992bf9-9aeb-49de-deb0-08db83d78c91 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6KyM2SNlm72ZWnWpW/7VNGuI1/l6O7FOa13R3OsZasJfEKmvd98yZHD3a7S9UTbArWZnVlY6eU9LAfCtzBrhXxbP+CL63+07+hKYyu6ppOyuqSINjDQiDIlciCXZuKV31YhxUMWR+wvdY6l9PklsIEPXUMY6dzNl/jbW0q2/df39FOps5Qgrm9Hm8pf35ZhE8x4l7n7PxKN8dF6G0CzUnw1fKG/LWn/JVBT42IFseDmZ0VHxo3nfAgrJTcKosc0LMAucrSpiYX332EN6hmViItuHf8ntjQpHf8XqlNF6iDTM/36uSIeUC3prPIRY322ab0f4/5UjBdYz+BJAQMqqr4DNELS6knWEMQBOVJ0ZOMSdxacxOnBHRHt5cgmIZsqWy6ku8GMj6/ut2vfIHnOwrgMkawEZ+h4GozCdqxcdVtcGKLjY9XLXArb042lWYWTar6zuXlucEzyXhWgFBs8nUT2tREWO4WcBhvpgrnWZb+He4iS2Y15pGlFIiGN6dZ2T/lDR5IE1JnoQspZnvHZVL6hGdcGVSzNJ2XQkUZdGK8acL2FPyfBfbaymnxJs1q50mWRREY/eQqtApbWW0wgFTqEPwBykzAVKrziwgQ4dvDc5NiJoyw+5WJphwb54phM54sLm4dDjhQyA4HO3YYIAJLBDcjYjrgLLAM7TEJKmpQv7vs1oQ2iVpgi7gAs52gvPTMeLGHQSiaSUIQJG9SZbpL3v8LMEsGXnJSSDALnk+HX/SSFrJS+yPZe2vr5fQMJb86ilv3nZIDaIyOuu/53l4g== 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)(346002)(136003)(396003)(451199021)(40470700004)(46966006)(36840700001)(40460700003)(8676002)(8936002)(36860700001)(47076005)(83380400001)(426003)(36756003)(2616005)(2906002)(81166007)(82740400003)(356005)(86362001)(82310400005)(40480700001)(26005)(5660300002)(44832011)(1076003)(186003)(336012)(16526019)(316002)(6666004)(70206006)(70586007)(4326008)(41300700001)(478600001)(54906003)(110136005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 19:30:00.2165 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6d992bf9-9aeb-49de-deb0-08db83d78c91 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: BN8NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8196 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 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 Thu Jul 13 19:29:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13312596 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 120AA20FB7 for ; Thu, 13 Jul 2023 19:30:11 +0000 (UTC) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2065.outbound.protection.outlook.com [40.107.93.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4A5F30C0 for ; Thu, 13 Jul 2023 12:30:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GSnkqNelBmHr4h/m1v4KwlOm0R1JUCEvOfQoGF40pC1hGHqZ/pAegWBW9gZRNnIygY16SSN2oFlfcjYBEsqD8tn0bs0aRPL+nLMu3Z/066jtlt84009hVT1AMpriBRMxZ/0GsQaR7N672C6V1SYFkvCEp3gDqhD812GdWdpE8JX07dvQXxyg6mCUcueSIk7s1wemL34c7z0gmJfTLPrDT/2efFlt36g+9HkvPlgbrFjoot8/BjcFwOLT9IEL1ybH7WcXhJYAUOTKrLdaZpznj2GVdIqKLeash9c4qtRxMj8y/Qpff1ozHmjH9zGcSkTvk4pzrXSRs3Vmx09sF6A2wA== 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=SdmkmzslmejG6A+foLCIWjo51zGBpNcmpXO+Ide1BmVPxigN83aQgkjo/hlpu2tPf55I1c/7KNXUNqpnfopgk2k4tlFdPf4P1BDIgtcjfy6BT+719777ChBznDP90HRqldVzROfexX1qL4DdcrF2zV0XRhYfKVQrrwYF9eKw11XDAHaN3af0bZ5KFVckoQaOMmkF5UAFmZo+kNVnvV043Ezfu0BPsv4kfMZSdXGbKizZDup1U1bw0x8jsw5AwrvLb2gMdk9S8pOJjzhwCjQXK2jGKom8vmp8Qzd2GpIkC8bK9ixZLBqzR2PiPZchtCTsML5oNkEJCXTizY7gEFkRrA== 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=kiT49Pxk8TU+YgnB0LquShQsh012WPIVfuMRmho96RQslXJZm+L+lW94bM0nWy1wkpAs3uMdsAhBPuEc8cGxtLnSimLPQxIeW6cYYuZXUXBeoWPkNXJfZOIYzq4PcOeklKIowsPZLJDI7t+xT85FS4T1bOCE+Aw8mGeJLcf5ak4= Received: from BN9P223CA0030.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::35) by SJ2PR12MB7824.namprd12.prod.outlook.com (2603:10b6:a03:4c4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul 2023 19:30:02 +0000 Received: from BN8NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10b:cafe::da) by BN9P223CA0030.outlook.office365.com (2603:10b6:408:10b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 19:30:00 +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 BN8NAM11FT043.mail.protection.outlook.com (10.13.177.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.26 via Frontend Transport; Thu, 13 Jul 2023 19:30:00 +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; Thu, 13 Jul 2023 14:29:59 -0500 From: Shannon Nelson To: , , , CC: , , Shannon Nelson Subject: [PATCH v2 net-next 4/5] ionic: pull out common bits from fw_up Date: Thu, 13 Jul 2023 12:29:35 -0700 Message-ID: <20230713192936.45152-5-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230713192936.45152-1-shannon.nelson@amd.com> References: <20230713192936.45152-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: BN8NAM11FT043:EE_|SJ2PR12MB7824:EE_ X-MS-Office365-Filtering-Correlation-Id: 044571d9-f182-43d1-2688-08db83d78cfd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a/540iKtRXQgQ3sqVd5PKQyE66A1ZJYOymPVBwwN5RvnmQvwmsH6HLQha+Fy9Mxmx0sHZritqztr0Z6voq0b8uaypoRtiO7cbt/7s4S3WSHuxexcl8eNXPt6c+fMCjW4a3jdH4BaSotjK603BaMVtaP2UgrJbyN2x3sbu62WCJ9y7EC1rQ3h/Z1Ac4eE0rCJYzXI2mRwlxx1YNIc/peYgFmUQ2J4ECvLcSOwIknRjc+qN8pmsYMNzH9Iybf7dhewbG2Cx394YL2ycY7mClVHeZV6gilxBWfLrrrzz7ddcgjTxgLmh6AFutHoSL134wZ3FPNEC10RLe7xpOSZsxdOtzpHYGUtsPUUaydygbWLEkOPOU42WHr9birWzpnVOrNgvUxa5L/yunmo+QzDcVa66Lq7wSFEVeiYbH2Cket6YYaZ/58Y2bUL5/RSMA4EZdVsS7wqI4h0hus5WpZAxqJTceZyzfZsDQkEOK65QYRvs61G0ExdqTzl57p6djp2auSjomk/XiXY54dGoYPMf0M5fvtZ5WMLOAZaPYppbXejcmdX20dooDKbCk+WS38P60nBF/09HZ/SsnSqhv90NVZSX/FVOzHeU58W3tWKQuNx+QRetcPcttgSjVTedbpSuLVFulAxTqkb1ghqPA0ABnLGMFRBlkf5ndBjrpjrjdZcymEzlk0PSC9ztKF9MxYMcMgmGHd5LP1bWSLhTM9Z6IQCDRx5xGj0uZcCTxL21AVhudvUUV7LAwGhb4L0T+VeUQdv34x1FFeO8vBZYpBm8E2/1Q== 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)(136003)(376002)(39860400002)(346002)(451199021)(46966006)(40470700004)(36840700001)(2906002)(82310400005)(16526019)(81166007)(356005)(82740400003)(83380400001)(426003)(47076005)(186003)(336012)(2616005)(26005)(40480700001)(1076003)(36860700001)(5660300002)(40460700003)(86362001)(8676002)(8936002)(36756003)(44832011)(478600001)(54906003)(6666004)(110136005)(70206006)(41300700001)(316002)(4326008)(70586007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 19:30:00.9352 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 044571d9-f182-43d1-2688-08db83d78cfd 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: BN8NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7824 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 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 Thu Jul 13 19:29:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13312597 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 384852416B for ; Thu, 13 Jul 2023 19:30:13 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2055.outbound.protection.outlook.com [40.107.92.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A7BF272B for ; Thu, 13 Jul 2023 12:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hBOYcdc0rgtYXuY11BX8oJOVzXruQm7mq2yjCd1It/6Iac1mZWtpH0wBFb/aUcmdOduhKe2B97ICXaP6KBJ5TQ4XDbrWH1gz5WMt2QvtMFFQFGLQzeiWDj6ALltT1hQbzDYlUvope6l05hR4LTnO759zI++ynD9Go5F5iuS2WAfC7wI5ISssn2yCMJO4ReR55Nc+j2YPYfYAcwU0Q4VqXcK3Fdz0DZurHgOTYKnyRVw6cchA7LnOuwj5R11l+YiG8PAN88AF24xjqs4lE1ohFMBL6cryn9SQnC2tBzZnfU7X8i/QaI0YeSmjH72LPVx8mKaoyWwlcF3SLwFa8o2pLQ== 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=nsHTLhxjQ2OrdiHl8vFNTStB0wXlMkKXv8avppg9wOA=; b=PoCRIvWGVbflzatc89hr1/h8eFBESPW3ZBFMbgiG0Z59/DfM3rRaI4UqrZqp4/HnsYAmXQxmAxKxHw9bG0o6DIfyMn+FXfahnP2oP4wXSdM/BjuyMCWuEyoeHedQHBxfzPT9RovFZoQP3/iZ7sUsWgCdE3UUo4j3EtQDdPXEcMrmhh+FYkld8vN5dnW8qr71QdIIQkSW9O7JASzMmwEfUfwQmGzVpaTz3RQJJ6g0eHMiLV9FM5KPabDJmj2/0JJ8oplyhKkZMyN/p+QOGIjDRq75otFPRNyqBFTslrM1bi1hZja74sx+pKfKBxbOWMGnqejbdI9K7CIvaOyaixrIRw== 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=nsHTLhxjQ2OrdiHl8vFNTStB0wXlMkKXv8avppg9wOA=; b=RAug4BLyYirl1X41f06GGNR0H8q1SwSHb96Dkn7Aoh641b1PSdsiAl8TBm7osPzupgEMgDiwvEL+AFaScpSRaZiJaAr5V/t/armSirA5j2bIzJxVvXtOi+AQkiNlmLkvsRR81kVvnAZacKEMfdjw+65PP9mrW79Z2cmRrD3Sw/w= Received: from BN9P223CA0018.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::23) by MW6PR12MB7069.namprd12.prod.outlook.com (2603:10b6:303:238::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Thu, 13 Jul 2023 19:30:03 +0000 Received: from BN8NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10b:cafe::8) by BN9P223CA0018.outlook.office365.com (2603:10b6:408:10b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 19:30:02 +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 BN8NAM11FT043.mail.protection.outlook.com (10.13.177.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.26 via Frontend Transport; Thu, 13 Jul 2023 19:30:02 +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; Thu, 13 Jul 2023 14:30:00 -0500 From: Shannon Nelson To: , , , CC: , , Shannon Nelson Subject: [PATCH v2 net-next 5/5] ionic: add FLR recovery support Date: Thu, 13 Jul 2023 12:29:36 -0700 Message-ID: <20230713192936.45152-6-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230713192936.45152-1-shannon.nelson@amd.com> References: <20230713192936.45152-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: BN8NAM11FT043:EE_|MW6PR12MB7069:EE_ X-MS-Office365-Filtering-Correlation-Id: bc9f1d26-440b-480a-d925-08db83d78e18 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sRT2cJUBahQ8hwdQstCXvG64/naOa+xKnfoF3zDuCtILmYQpCMlkmkNLPXgefbDD06ON9MjUR4PVLAYvC+etq3mcoPtD5mpYSLKkQxcAfOEEFVL18SYDFhMPHDTaHHSTmOEVrJFO/8780rZxNkU4vOS25Fhq6wII6OASkwjt8xlAMnzXLqWuy6BzD4ZWC+Vc8DwD6TYn1oYvtGtTZX39Goa5BdGc20EF9fEFT3vRSbwFDHhlxldDX7SuwUyD7W2uYIm90FVtAkB9yBluw4s1XzH9jrkylOqehSTkXyxt3J0bnOsq7/HazSHOe/j0rIh8bkQJO3vdqVeOpBUoTU131pa639cvGYkYzSq4F/InUNl/1UrEg7Blf9MUvTeFGMDkP5q09LpLQh4QLkbbDPde3B2K12i+02bu5pgeCQWBPBZxIMhAUC9d5AlVuBxAzRqwVdwBskPRFbKtK/m6gBWE4Vn0NaQ05LD7AgL2xFI8yrOl4p26U3rxfZDMFSxqu0K8OoVeo49W9dmpkI8ShiDIIkaHSxXcqF711TxGYWnEUMAcmfMIQToTI3dLpmRyOpc7VWWjtKokS0Aw0q+5lSBPmktMtj58r1mgXVCV5b/2pjC7tqQ1EDvtGG4gOr1EjYOopjVunkC8++XFvqJRoh0LjDSJ1C2Rlq/tOcQSWmYJ1F1xRNMRscR8DPdftRY5/nDOLjdwa0pZveTznZZYt/OD1sDqUtnYz5vdOKzACuHolreQBwcvIG8cl/H/YxWcvMl02l+SnjPNUqAn6mpx4ZIHCQ== 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)(346002)(396003)(136003)(451199021)(36840700001)(40470700004)(46966006)(336012)(2616005)(41300700001)(26005)(1076003)(83380400001)(16526019)(36860700001)(186003)(47076005)(426003)(81166007)(478600001)(82740400003)(356005)(54906003)(110136005)(86362001)(40460700003)(6666004)(4326008)(40480700001)(70586007)(44832011)(70206006)(316002)(8936002)(82310400005)(8676002)(5660300002)(2906002)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 19:30:02.7632 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc9f1d26-440b-480a-d925-08db83d78e18 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: BN8NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB7069 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 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 | 53 +++++++++++++++++++ .../net/ethernet/pensando/ionic/ionic_lif.c | 8 +-- .../net/ethernet/pensando/ionic/ionic_lif.h | 5 ++ 3 files changed, 62 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..3fb7925c2d47 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -408,12 +408,65 @@ 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; + + 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,