From patchwork Mon Dec 11 18:57:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13487942 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="iUoe/gbv" Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2044.outbound.protection.outlook.com [40.107.100.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2929DB8 for ; Mon, 11 Dec 2023 10:58:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EbgnrICXqHw5YEQvv/7cR750ko2Crto7f/wgNYIbaC8yrQM76N3GSMc7PsMxz9mjdc6B9U2CgqXeq+xCex35TeWHApUYJrNIH3AqiXrjUpsLxHX8S9GoId0+F2lO9wihGn8M8elcSoYIyeYqkvNXBNV/64IMHRbn6mKu30hQl2Fjh556gjMzyrqAKlz0hUtJOOw0cbWm1AP7wPpNMMWFZ0uxto7aoSk7NCantKHi+tMAcwdx5/YA1J/20Sg1bN914DhQkdvQ/Ze3WxJmrumBqTfS61OrAZkCgTer0/zInxPUIXSTfmYlK4k4IHtiUkvFpW8ys9+n1jloRuqZ/CI7bA== 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=KE5nQREn9eXlhvER4baks25+vrj1+2HU04+1Ev/xi6o=; b=H1OPXDRwzHggFW7oJmDBKZXSWdiiy6dDowCzftoTIs4jV4Wj2FKxn+ZH1Vomx6PXOzvNRNfo59IhQksThjTU3t4VaNb66+V9cqAuZIGN3mKR8tq+Hwaz3kq9l/7q+Rw3wpybF5o/0IzOty1+MHUy5Nm6yq/gGvQ0v6BOIW9BRAoSUsqiAyYYDfOnBRfcC/RmvgejdrY6KlTcvNqAcTCpKE+7ht3yhWzrmMKvE+ao8zjw0CgNP7wFX86RmSzPPdvA+aUICqSzvOSY/ecqoDu/bDIB44ddBska5eESi3nJIcaBZyzEPW/Evih4CtHJKAsqxd/bvgQhe8vgJ72XYIrPWw== 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 (0) 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=KE5nQREn9eXlhvER4baks25+vrj1+2HU04+1Ev/xi6o=; b=iUoe/gbvp1GlkKK1+IJ+Q0eNY1egO4EC66MzjR8qkPPUbTpKHG/Be1dI4bafMLVe0ljSBnY818kQvnTklaUGv+ANmEc4GOHAG8ENQWxRHFfzLtIJQZOpA0egMMtQxbCUVhZGYPSZjYAdcJ99/06juxhhpVbpNSgPdXa+ZQPLVoQ= Received: from CH5P222CA0020.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::12) by MW3PR12MB4347.namprd12.prod.outlook.com (2603:10b6:303:2e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 18:58:21 +0000 Received: from DS1PEPF00017093.namprd03.prod.outlook.com (2603:10b6:610:1ee:cafe::68) by CH5P222CA0020.outlook.office365.com (2603:10b6:610:1ee::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33 via Frontend Transport; Mon, 11 Dec 2023 18:58:21 +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 DS1PEPF00017093.mail.protection.outlook.com (10.167.17.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 18:58:21 +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.34; Mon, 11 Dec 2023 12:58:20 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net-next 1/8] ionic: pass opcode to devcmd_wait Date: Mon, 11 Dec 2023 10:57:57 -0800 Message-ID: <20231211185804.18668-2-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231211185804.18668-1-shannon.nelson@amd.com> References: <20231211185804.18668-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-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017093:EE_|MW3PR12MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: ce5f4be7-3393-429c-c763-08dbfa7b250c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wASBB9PH+YcV2HGg4wG4s0ctP1D1ymMHJS+p6gd5UWNTQWgXqh8H8XP8Bc8yAVvNpKL9c/iXz7oF9YdjgkwjIe4+EPeBhfa1n3+FQwzQfKgvU2qX/rFnwXLdfU63ar+SpYKjbHQjrl7RIjyLHqdnErvKbOOIh+vwAGJeSprlvReTmXtD4JthhC923J1BKDk0DYpeQ8T9sEArP6ey8VnNhkvEGWi7etL2S8riuEtO7rqeIg4g216O5els9D0n8CesGUN62Cm+pa8VxI7G9yKOmjyopHMroeJdrma5hzHAtml0T3d1HQziLnTgjYpOGW33XZnnRakRsrIeTyo0WKZzDNOgKDpvwH3O5zt9Jp28c5w+AvJyg1l3jcs3DgBifbeAVMsAJCMvd+ycpjDQKsg2UmS0mZjxGupp4JTyexNAJhtnz/6ivPYuE4kLi+QeH5yjOdit2FnmTmIlg7ikorMX6seOYFg+fCig5if6qzAmLNNEvi0Buqmmffj+XieXEF/Del76jpdokM22qIZAjpG3NNP9zHALOFOa4i183+8daG84EFrcMyKmaLB2QZJRhRjWJ0Xfd6PGrtuEl2eDSZmXTkr+bKlLqoaQee6eHxVPA/3GcbYt9OTcDY4mPpm+CBTaCdW6dNltJ1OEEMyaWoCHxOATvxZqmGlApD5p/Q6Yl4z/lpBF4ApTuOMPGoC6pPMJ7QQ52huLxuDDhwAhmGbENhi9Djs7/TK5HgAIpsxpqcPAojuwp25X/QCTZOTjcwH0LK1wLyVl4QT7ljb6VTU8xg== 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:(13230031)(4636009)(136003)(39860400002)(396003)(376002)(346002)(230922051799003)(64100799003)(451199024)(82310400011)(186009)(1800799012)(46966006)(40470700004)(36840700001)(40480700001)(41300700001)(40460700003)(2906002)(44832011)(5660300002)(316002)(4326008)(8676002)(8936002)(70586007)(70206006)(54906003)(356005)(82740400003)(2616005)(86362001)(36860700001)(36756003)(110136005)(81166007)(47076005)(26005)(6666004)(478600001)(16526019)(336012)(426003)(1076003)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 18:58:21.1791 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce5f4be7-3393-429c-c763-08dbfa7b250c 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: DS1PEPF00017093.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4347 X-Patchwork-Delegate: kuba@kernel.org Don't rely on the PCI memory for the devcmd opcode because we read a 0xff value if the PCI bus is broken, which can cause us to report a bogus dev_cmd opcode later. Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/net/ethernet/pensando/ionic/ionic_dev.c | 1 + drivers/net/ethernet/pensando/ionic/ionic_dev.h | 1 + drivers/net/ethernet/pensando/ionic/ionic_main.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.c b/drivers/net/ethernet/pensando/ionic/ionic_dev.c index bb9245d933e4..c0b347dd6bae 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.c @@ -321,6 +321,7 @@ void ionic_dev_cmd_comp(struct ionic_dev *idev, union ionic_dev_cmd_comp *comp) void ionic_dev_cmd_go(struct ionic_dev *idev, union ionic_dev_cmd *cmd) { + idev->opcode = cmd->cmd.opcode; memcpy_toio(&idev->dev_cmd_regs->cmd, cmd, sizeof(*cmd)); iowrite32(0, &idev->dev_cmd_regs->done); iowrite32(1, &idev->dev_cmd_regs->doorbell); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h index cee4e5c3d09a..c5a3a966aef6 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h @@ -153,6 +153,7 @@ struct ionic_dev { bool fw_hb_ready; bool fw_status_ready; u8 fw_generation; + u8 opcode; u64 __iomem *db_pages; dma_addr_t phy_db_pages; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index 8d15f9203bd5..873a86010b27 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -443,7 +443,7 @@ static int __ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds, */ max_wait = jiffies + (max_seconds * HZ); try_again: - opcode = readb(&idev->dev_cmd_regs->cmd.cmd.opcode); + opcode = idev->opcode; start_time = jiffies; for (fw_up = ionic_is_fw_running(idev); !done && fw_up && time_before(jiffies, max_wait); From patchwork Mon Dec 11 18:57:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13487943 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="gwj5HyWD" Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2067.outbound.protection.outlook.com [40.107.94.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45209B4 for ; Mon, 11 Dec 2023 10:58:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g96evgp9KvQkALb2aLWU+HXRamkBXeJ8DYngqfPv//duJi6FdzzmSon0GHkxwijmDNxLX1YsodNmONcsyhTqDNU6aj3/QyCuHW2h1F8xzW8lCqXG7bOVm2Mfb/omhp+rWDwNv4QcHcIAu/z62LvGnVUToyLTr/ZZIH08t7QXmfczE1K+pJhuVRuiWNqK7msqTabQ4f1wMzLfqhFTJSngkfrZ80APIQ2VHsGW8gBl0Hk8VwW/fQJpwNNCMNigLQ9HlBuWP/bimnLCxjgqQntB3Od5nY7x/v5U/eo0LheVyEUykaRSuMNtBqNdom7CmJz7ZovZRKSfts/v0wtoxlwFZg== 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=AvJQ5Op+ilPkvQoLtOZ1Nu2FUQIXx0eHxN6zuUqifWs=; b=fAYHla9PBJIo/mvFo3fqaKQ4A87T0kxfmBxl+97hN8pV+YtCpNZhm9Tes3RAjt4Dcrd7zkCaUsEhbERXmsZqQ7Lfp68WSW1giKm6MAyRVvGOWcs9uCRBj/rNNOKH8Q/H15bH4yzse/gJIBHo5sT+Uwvg+bQgY1kAvecrgKdH0AZu9+ISfnP+pGPp5XEkdMglX9wEg1eU9YYhzGeLSsDG05mEDy7+qN9VTLCFf5AX93WBopnfog0g5jrcPdEZoh2HH/IS4sl5m6ulHh8oQ6tgBwQxkrBbeloeA+iwW6VWSLD/xxD4kJNjzvXS6u6tdts0eFZr0axgk2Fu/R2m7DeKRg== 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 (0) 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=AvJQ5Op+ilPkvQoLtOZ1Nu2FUQIXx0eHxN6zuUqifWs=; b=gwj5HyWD1o7j+2ST0SkTBWb7/FJXT0FcsZxISpwExBniZKLSUfDaT5KkzH55vH3JoLEQe2uAdnYVzFno/Y92sPpac59Dqf1Pawaf+3enRSCRULF1KcgDa+GZ0+Py18anDwBNYf7F4k70sx0/64wPiAOmcyBfuYkxL9TGswZQjE8= Received: from CH5P222CA0014.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::6) by PH7PR12MB8794.namprd12.prod.outlook.com (2603:10b6:510:27d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 18:58:24 +0000 Received: from DS1PEPF00017093.namprd03.prod.outlook.com (2603:10b6:610:1ee:cafe::7f) by CH5P222CA0014.outlook.office365.com (2603:10b6:610:1ee::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33 via Frontend Transport; Mon, 11 Dec 2023 18:58:24 +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 DS1PEPF00017093.mail.protection.outlook.com (10.167.17.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 18:58:23 +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.34; Mon, 11 Dec 2023 12:58:20 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net-next 2/8] ionic: keep filters across FLR Date: Mon, 11 Dec 2023 10:57:58 -0800 Message-ID: <20231211185804.18668-3-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231211185804.18668-1-shannon.nelson@amd.com> References: <20231211185804.18668-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-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017093:EE_|PH7PR12MB8794:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c62927c-838d-4fb5-00ca-08dbfa7b26cd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F+A6UhDUHvXu4nCsiZaUO53bSRhTERaGoTehJnivVERTCkkERHHWxRKO6uUxrfQe+Ab1u1GAOj09bUWpym581opNXUWDCZsfMq4246rZ2dcPxvU+C606KSeT+/wlp8t2eb+NVWPEZcXLYLruv7syo7SMlnhwv6UkqIyeKpwy92eeI064szB3tyNsl0FdXJpMOikISaV2QuLcQs9/vPGmpSi2BFa07c+mfw1zB5KNl8mEZeWTXj1gP3f1rS8DNP7JSlStLFVeLEojSSM8rcOeOAVXYTwweCeo3Cymkr64u5xhSgLglCctGCgH744EwaoPBY4rn9UtA9+MbI39pPhZtMHbKKIj6POGEoYBfoKwAJdreRm+47NfNClnZgFGpg9WCyyhu6MZlnOwEqutIl01NB/HK3u6ezp7VuYZIEvTsAMsPzueiNrputL1A43dcY855nn3cEcus+GXA2Wnxxsv1Dg4h/RB/03ZQ8PFZXqw8cntYHUbrqeU6Ak6vljb7NkXMMZIircDxcJZj7AWptKurfIkozj4dqR0SRn44qBvRYuxEBzAbm2HrM0bn8D/6K8DxcdIrYkeVC7oqAz7dt1UgoQNWuLbtsIaQwRJe9Sc7RPXyAcF5xzmNeGcMrwbjgackbfoJKWYWrvr7XxTvNc03DbcYhzwpylhFDAvcj3vRKeANWMU7mYuvNnUGRLi3A1ZC1uVmx4ZRkYpCRCq6PF0jGG4BH9oVGLIj1cR6GZ3eMxVJLYkpNl/DACU+bD4JHvo9nqbq5vn7hFVD/0ndJxLuw== 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:(13230031)(4636009)(376002)(136003)(346002)(396003)(39860400002)(230922051799003)(186009)(451199024)(1800799012)(82310400011)(64100799003)(40470700004)(36840700001)(46966006)(41300700001)(36860700001)(16526019)(1076003)(426003)(336012)(26005)(83380400001)(2616005)(47076005)(82740400003)(86362001)(36756003)(81166007)(356005)(5660300002)(316002)(8936002)(8676002)(4326008)(4744005)(2906002)(6666004)(44832011)(54906003)(110136005)(70206006)(478600001)(70586007)(40460700003)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 18:58:23.8041 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c62927c-838d-4fb5-00ca-08dbfa7b26cd 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: DS1PEPF00017093.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8794 X-Patchwork-Delegate: kuba@kernel.org Make sure we keep and replay the filters and RSS config across an FLR by using our FW_RESET flag. This gets checked on the way down and on the way back up to help determine how much LIF state to keep and restore across a reset action. Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index d6ce113a4210..43e7967ad1c5 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -416,6 +416,8 @@ static void ionic_reset_prepare(struct pci_dev *pdev) dev_dbg(ionic->dev, "%s: device stopping\n", __func__); + set_bit(IONIC_LIF_F_FW_RESET, lif->state); + del_timer_sync(&ionic->watchdog_timer); cancel_work_sync(&lif->deferred.work); From patchwork Mon Dec 11 18:57:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13487944 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="VGtw/Uof" Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2085.outbound.protection.outlook.com [40.107.243.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 961BEBD for ; Mon, 11 Dec 2023 10:58:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iAf6VxRxfb60G97PBOJYi9bcEZmAw2McMBM7YfjDfTLQpu8qNL62G+LesERhVo5wuUGbzbF+BHcZm9scxrHnMyjHgjDjiJ18UK4Qt/HKGyq7Fmbt8Lq3QfG7+TIBGzrbLThrZhOa2e3rr1fBqm5eG9fqCSmfZ9Hsjh9c/tIvMU0qW41ptIAFDyy+y5lQcg8tzppdyt3liNFMjt7KzytGnow4yfwFaCZjUCXlkWUR4O7fUfrT7hh+G9zFCdEY+CPpC/lxE6HFWA1fyoY87+ye8AY/r4L7PnPDi186Rrqi8zJOxKldMEAAbTlR6cRGSCne2h3jpsstU1gGkb0c/heEZg== 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=seSl7s9oP1JPLhymbI9TmGiMbBy39Fjmiz9t4JtSfJM=; b=I368h6q0Mc81jeFH8fG2ri90HDqqcgWOXxlqJolLsef5aC3KXH3oMxkC14EEXluDwE0Orx+nh1i2EW+xKXEZ/axXD3VwfQ3jjCO4f8nVTXOT17Q3pkGZtvNKOVchjSmgqV4A1h6x+urxny8ocYLvs/GEs9GAxf1JfOA1cuU3jxZ0k5afPXNQcnP023QWp3Oyqz2AA66fDO9UuL+rkCR7txa2cuMgp3Z7EmbMrA1HI+nTGaW4LUIIb7o2OP4tpc4KzCGNa1E3aRuoFht5Ud0FSqas5V9ch7uO8/FMSOf/p7V9lZxeyRxy1vLCNUZjTycvQZ7Mcjs98oEo87SCf5LJOw== 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 (0) 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=seSl7s9oP1JPLhymbI9TmGiMbBy39Fjmiz9t4JtSfJM=; b=VGtw/Uofa1pEh6OynXlUNghbhS2E+QYT9YxzpzHYIHi7APTW/iW0F92WmF+t4q/XnesvDNGnUcR+SrrmRd25kPckl099daw/xGd6insU8+b744FO6jnFlSZXbJ7NyKoGn9fdWo/ipYtrm1Xdt/D7bYNo7eRicvjfsrwJrtx6ezA= Received: from CH5P222CA0001.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::15) by PH7PR12MB9076.namprd12.prod.outlook.com (2603:10b6:510:2f6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33; Mon, 11 Dec 2023 18:58:25 +0000 Received: from DS1PEPF00017093.namprd03.prod.outlook.com (2603:10b6:610:1ee:cafe::f8) by CH5P222CA0001.outlook.office365.com (2603:10b6:610:1ee::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33 via Frontend Transport; Mon, 11 Dec 2023 18:58:25 +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 DS1PEPF00017093.mail.protection.outlook.com (10.167.17.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 18:58:25 +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.34; Mon, 11 Dec 2023 12:58:21 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net-next 3/8] ionic: bypass firmware cmds when stuck in reset Date: Mon, 11 Dec 2023 10:57:59 -0800 Message-ID: <20231211185804.18668-4-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231211185804.18668-1-shannon.nelson@amd.com> References: <20231211185804.18668-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-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017093:EE_|PH7PR12MB9076:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ac7587b-76ca-4056-d254-08dbfa7b2760 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nJTzB1dgpX7JWuCmumI7SoIqexsj2FKbLqbl9wihazR6ND9AFfKp4AkfsPk4VeMvTWjaaEEjkMT+QTRF1VeG86/ZJtYiIVem2DVhfZQICtGfHengYVGNe5U0a4r1ZFr1VCtNWqxcF2IDTr2sbx7ci/AVmx+e0ihLrYZXYVacr1Z9uDV2YSBn3ZgyCkaCb9OG+iFE93PtL53jcUUpvuURQTVEssb25V55PMmarQv+5WGunL/q02gv8H+WXYrNRprv/6p6a55ZLL/BtyP+IQziP/fgmqRgN4i9abGQEMqI1M5lFV0UPtqPJKQN7VveZGzRGin0BEvD2SgE2Fex+xN9RkJ+vER7T4dQbdEFH3BJHwXA5jHBf09PrUoZ48Q4WyyP9fm9mVLosAIxnyUj/8bGZaPy2DwUCkeE8dN3LPxW220A3OloGXysSURPzxeYNBdZ2x6oCXfjcu6RtodeQDtxsfGoGC/H4Z8w2bF8724KhFpl7QnwUGqbx11t6p/irfrwFQWBpNbao09E+PbTWUyDrdDn0q/J++h8f6o+dKm9ZUEwd3jwn0jO5Zx3qIR00JKcCm6PCsek7K/wJlzzVB5PhjOqQmkuJtumbzAUXiXLPPZd9foIijrWT32pJdNiRcFZbMJAW8BGDExE+2eAD62eDBIF2cTWLjpGZyBL5tNLpFSpxDLTYv0PoKIijElPyaRMNmKJiF3s6rshkX9CCwbmApCLc/AQjgT6ATyJcJxeV8nLoIm+hhiz/mHckdr/ZRivUee34iitPyLMjGoN/DwqmA== 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:(13230031)(4636009)(396003)(39860400002)(346002)(376002)(136003)(230922051799003)(1800799012)(451199024)(186009)(82310400011)(64100799003)(40470700004)(36840700001)(46966006)(40480700001)(1076003)(26005)(426003)(16526019)(2616005)(336012)(40460700003)(82740400003)(36756003)(81166007)(86362001)(356005)(47076005)(5660300002)(83380400001)(44832011)(6666004)(36860700001)(316002)(70586007)(70206006)(110136005)(8936002)(8676002)(54906003)(41300700001)(4326008)(2906002)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 18:58:25.0541 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ac7587b-76ca-4056-d254-08dbfa7b2760 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: DS1PEPF00017093.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9076 X-Patchwork-Delegate: kuba@kernel.org If the driver or firmware is stuck in reset state, don't bother trying to use adminq commands. This speeds up shutdown and prevents unnecessary timeouts and error messages. This includes a bit of rework on ionic_adminq_post_wait() and ionic_adminq_post_wait_nomsg() to both use __ionic_adminq_post_wait() which can do the checks needed in both cases. Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- .../ethernet/pensando/ionic/ionic_bus_pci.c | 4 ++++ .../net/ethernet/pensando/ionic/ionic_lif.c | 3 +++ .../net/ethernet/pensando/ionic/ionic_main.c | 20 ++++++++++++------- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index 43e7967ad1c5..f69178b9636f 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -392,6 +392,10 @@ static void ionic_remove(struct pci_dev *pdev) del_timer_sync(&ionic->watchdog_timer); if (ionic->lif) { + /* prevent adminq cmds if already known as down */ + if (test_and_clear_bit(IONIC_LIF_F_FW_RESET, ionic->lif->state)) + set_bit(IONIC_LIF_F_FW_STOPPING, ionic->lif->state); + ionic_lif_unregister(ionic->lif); ionic_devlink_unregister(ionic); ionic_lif_deinit(ionic->lif); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 6842a31fc04b..6669c5e52c71 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -3161,6 +3161,9 @@ static void ionic_lif_reset(struct ionic_lif *lif) { struct ionic_dev *idev = &lif->ionic->idev; + if (!ionic_is_fw_running(idev)) + return; + mutex_lock(&lif->ionic->dev_cmd_lock); ionic_dev_cmd_lif_reset(idev, lif->index); ionic_dev_cmd_wait(lif->ionic, DEVCMD_TIMEOUT); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index 873a86010b27..165ab08ad2dd 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -388,22 +388,28 @@ int ionic_adminq_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx, do_msg); } -int ionic_adminq_post_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) +static int __ionic_adminq_post_wait(struct ionic_lif *lif, + struct ionic_admin_ctx *ctx, + const bool do_msg) { int err; + if (!ionic_is_fw_running(&lif->ionic->idev)) + return 0; + err = ionic_adminq_post(lif, ctx); - return ionic_adminq_wait(lif, ctx, err, true); + return ionic_adminq_wait(lif, ctx, err, do_msg); } -int ionic_adminq_post_wait_nomsg(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) +int ionic_adminq_post_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) { - int err; - - err = ionic_adminq_post(lif, ctx); + return __ionic_adminq_post_wait(lif, ctx, true); +} - return ionic_adminq_wait(lif, ctx, err, false); +int ionic_adminq_post_wait_nomsg(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) +{ + return __ionic_adminq_post_wait(lif, ctx, false); } static void ionic_dev_cmd_clean(struct ionic *ionic) From patchwork Mon Dec 11 18:58:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13487945 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="0900gbdP" Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2056.outbound.protection.outlook.com [40.107.244.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A778CAC for ; Mon, 11 Dec 2023 10:58:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zoer3h7iyqo3pD5/Qj6AVoiDMEE9QVKWrjB5jSpyxfXndIvQPRAMCLh4Ja3OfVmcCFSjjLIWCfG7zHQdhHvU60ZNmndTlgpNX0lWu31YOYLrGPXMdgjcb9Ziwpx+F5zXak6mobBYeWSQW1HGlj6QqZ3iGhYxMFC1ZpMVKyTWkb7WJGPg0k1b6zEcYsWeOZUBxqOr2drhPklpK+Zer9wCVt5/w7eXR8PqqXxKJoV4sTmEF2FDh7zyO5sS44gI4asi7bcoAmsN6dGZHSkogg3To8gUEcZ4/dXhW+MC/HAF/74XpbsW+yYI4JW3uXjTTsJ5sHrcoxp9cy+ojuHdwMoMFg== 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=7gY90yrWgDeX3eyMyREMqeBITZc4jEIjFzYZYQRoAyw=; b=Z0phZlpne8KX8KZOprVjpzrmea4cxiyPjEqYhHsrjHxHCkR/aHvqN63xOVRr6xBG2DGgKnYc1kCUZIl90pC5GdbwK2HWTHq8Htqrgb/W2/xFqQ7u4xTkwiCMgtgDqV6UcdQioV/7WQzHFXK9oqCgJaxzVwEdk7KWzl6rZPZCWr8X3AcryRzBwUVeig5FoHK+41W1kXQNnSloY5lsey+UqDhXxrElZtWG6XkkBLLKDQWuh2+w9J4Mmb+J+m1Th3mK41ABGUEzum/wMM4arcT09vG8xrs5Fyk/qGqfssc9m0BGk74OwVy/6y15GhaHzGrr9PNsAmmKKg3gtR0QynUE+w== 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 (0) 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=7gY90yrWgDeX3eyMyREMqeBITZc4jEIjFzYZYQRoAyw=; b=0900gbdPInb+S2LiNgndM+wkZ5SzUTs/MeJdIPoInrhw35ml7rgmNBnxHnxB94vtFqvMBbHNMEByUoCaEMFIvYURDz48YD8zsAWZKtSrz7VyMeoFBaOtb/rAH3SAuqdF406TB4hCYrHXnUck6XZIX2d45qR/2EcucDxS6buO7mM= Received: from CH5P222CA0011.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::26) by SJ2PR12MB8808.namprd12.prod.outlook.com (2603:10b6:a03:4d0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 18:58:26 +0000 Received: from DS1PEPF00017093.namprd03.prod.outlook.com (2603:10b6:610:1ee:cafe::59) by CH5P222CA0011.outlook.office365.com (2603:10b6:610:1ee::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33 via Frontend Transport; Mon, 11 Dec 2023 18:58:25 +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 DS1PEPF00017093.mail.protection.outlook.com (10.167.17.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 18:58:25 +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.34; Mon, 11 Dec 2023 12:58:22 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net-next 4/8] ionic: prevent pci disable of already disabled device Date: Mon, 11 Dec 2023 10:58:00 -0800 Message-ID: <20231211185804.18668-5-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231211185804.18668-1-shannon.nelson@amd.com> References: <20231211185804.18668-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-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017093:EE_|SJ2PR12MB8808:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f503c48-d84a-49de-4313-08dbfa7b27d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KZ/CeH/uQR79QCQUJ+95JUgB0upG4MgLx+ggv4IBtlSsEatsrUk5gqc/e6lUXOqCaejODPF2wbw5qMNwOMWczWW80A1XlG/KHkCA9AqfzMx7CqAJax8JupilS9ICi14ku5/fxa1qhQR4Hzfs61DA9KZWYyeKFNixkkX2XAtErbfCEzDICKt6aO0KtDETXUokv5qeP/qbv89duB9wapbD07zgE5aUxABVsIDyaULqqq1B1OjEW4Fi9tnfyUm8+gH/hNdwBk7P9egNpiIt0jSvwONWEcdMJdzO/8vDdQwcM6Gq3N3pqPjTzPMGMyq3J85YdkmHamwNNBXytJtmqtxDPVQtYIOT39LEwO+00JuC3/t1RJ5lDB/qb/Zw9908E6GyZYpRaV+QIdEOt5HHU5K759APJuL9IaR2kjBBtxWoglc60Xny7fMS6axNZRHdS+1iL/gzRb6En32lquqfPEmTlt96pP5PC3P9yYfT5aWJbOZ2w0DhnjFHvzD9EZ4Nd2SrluYbzmyYApJXelTKicrys0HIjq1LLzqd/k4ygtMT30qB832eWWJyeJBnizx+MEmpq3kYda9gcC+LlnVgOHjw4EXaCefXLtQagEogrO/ptnX2xuNXYhMR2zmusNO+4bM4VaOfMOLHVXlA6kWvhw0GD9qooMHi5dG7Tf26vFJTjdhKwLHW/WHrhmWvCl2tqo3wC5k2SAj++RdhPldMROGzNPjYjmR8zWikvEu9vWJMYFRff7LxCfzAL4uKRU6yR0Cf/Rx8SRjqn/OJF/Od1sqD6g== 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:(13230031)(4636009)(39860400002)(346002)(376002)(136003)(396003)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(82310400011)(46966006)(40470700004)(36840700001)(40480700001)(36756003)(40460700003)(2616005)(1076003)(6666004)(478600001)(26005)(8676002)(2906002)(8936002)(70206006)(4326008)(16526019)(110136005)(316002)(70586007)(54906003)(36860700001)(47076005)(426003)(336012)(41300700001)(5660300002)(44832011)(83380400001)(81166007)(356005)(86362001)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 18:58:25.8353 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f503c48-d84a-49de-4313-08dbfa7b27d3 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: DS1PEPF00017093.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8808 X-Patchwork-Delegate: kuba@kernel.org If a reset fails, the PCI device is left in a disabled state, so don't try to disable it again on driver remove. This prevents a scary looking WARN trace in the kernel log. ionic 0000:2b:00.0: disabling already-disabled device Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index f69178b9636f..da951dc7becb 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -217,7 +217,9 @@ static void ionic_clear_pci(struct ionic *ionic) { ionic_unmap_bars(ionic); pci_release_regions(ionic->pdev); - pci_disable_device(ionic->pdev); + + if (atomic_read(&ionic->pdev->enable_cnt) > 0) + pci_disable_device(ionic->pdev); } static int ionic_setup_one(struct ionic *ionic) From patchwork Mon Dec 11 18:58:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13487948 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="w0fmxpoi" Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2060.outbound.protection.outlook.com [40.107.237.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3E37D6 for ; Mon, 11 Dec 2023 10:58:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nf0SRz6349KZ6mOAexKy9nxt3bvYkfSJ418vqMaa9KoSlLEGKW2kjvOSX9slEw1WQZllM2mxNoI/qK2M748NiPn9opLMgztfYBQdgC9EN3v8o9LtjPAHPkTxfIB6+KKlF7vzLWJEESOR5OEyuJleqiQDWlCBotA1WpeHH5hDEjk0jnzrRCr7Hc1Fal2mPbHABtWYN/KOhvs4iGX6bkTRrvcDNeGeG+QP0zdc21ddrB4Z8X5e2irCmY+yTlMvDnDvfMRee1CUvdTgCi6uYwRjz/elh84DXgCiXRPp0V8ad4Ty2CxEZTzVRsS8/I575/nmUGRDsl1n0lv1XuhTBr94TQ== 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=3CB3HErWfGN4X4SRfWbhD6+51lQ1lgpcjRLjFMFWySA=; b=Q/nemKsshcRmJhIC0dgpYWfZVSSieSZzqhvq+58RFJ94oWjk+EzGZuUfREjvnofWvW5cARtdVa4WZ56cZdpHEMrigfJjrlSx2WPX3pAJWT/F1z2GBWz/1TQEGCx/CxTWsFX0kPsLwSLJ+4TIeaw64xnycwdMDeQcG3WRblHJKzur6OW/fUgf5BCWLCJ80aFDN2saIWLn6UIJwV8fQ9eKqFIr5GE8KG8ZSbqYxhdso95Fwp9rdixFM2NBXtxUAtnWL3TIldTCL7f5taVG08AAjl283QQ5fhbP+AgWGvNec81Yv1g/L/C/asQGxHfk5r++1n5CZKbh2aIJPEZZQV7Y8g== 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 (0) 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=3CB3HErWfGN4X4SRfWbhD6+51lQ1lgpcjRLjFMFWySA=; b=w0fmxpoiPfWBj9C/NLJSveCjpvamDmtnOx8nqzl9CmQYbLH98tYMc7ZEwbDJCn2aY6CW1UAMFiSwkKiXCfz5xdY1EWBPBiwpl+rh5+FR2M91TgrBT1y/RrxudKyeswQ55Pxv9b+ycicLWB7+8L/KBVxM4oj1AOmXJ7fIxOWixTs= Received: from CH5P222CA0023.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::11) by SJ2PR12MB8009.namprd12.prod.outlook.com (2603:10b6:a03:4c7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 18:58:27 +0000 Received: from DS1PEPF00017093.namprd03.prod.outlook.com (2603:10b6:610:1ee:cafe::88) by CH5P222CA0023.outlook.office365.com (2603:10b6:610:1ee::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33 via Frontend Transport; Mon, 11 Dec 2023 18:58:26 +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 DS1PEPF00017093.mail.protection.outlook.com (10.167.17.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 18:58:26 +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.34; Mon, 11 Dec 2023 12:58:23 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net-next 5/8] ionic: no fw read when PCI reset failed Date: Mon, 11 Dec 2023 10:58:01 -0800 Message-ID: <20231211185804.18668-6-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231211185804.18668-1-shannon.nelson@amd.com> References: <20231211185804.18668-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-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017093:EE_|SJ2PR12MB8009:EE_ X-MS-Office365-Filtering-Correlation-Id: e1d08bde-a155-4d1c-28f0-08dbfa7b285b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hMQjHBWmadR0oT6/JOEbTOeV9CIVb/7jmnAvnIJr1I/yQxRN5rWpxw1PcRYNvuwaKRdBzLqXZRMNbuN025WEquIFf5Sycbrjlv3MpgDe/YekjcE8A1TmkR+lOudd3cImVHdswDImCN0m4HbO14yS+qAGPduVP+Z7VAH6KZymqIxY3VCKgU7MC/7npCDnUg1esfsmGq3ks2XuBGsq9OGSOL7su3vpHbwchrbenLJuDf/36X/IfB/n100eeuzx0Hu6qeS5XlRFQgBD8erJqdZcCSUmc7qdrC+o5Pyfa9+jmXOOLFG6BQYZVMr8K19KNLPTXO2mgrWiq9YAOVdeNyy4so+uXrtCsVMWqiS4TPfqS+pzJq7F6Xt+vY1Z3mYgwmYHTGqmAV5aQue02jl5LKkaD6BGsHVA7d/OqCrJ7W+v6wrFUR3phqEqu2wv4BnYJ5OtkaLpWrFpbNa9Po8WekwhiFjSCsAm242w/plNPr4hIo7k5InQ50BNyT6l9QdlBqtR978askZH6yEsH+XS0PUlYHoV0G+z13FJI4pYZWz6odVjaPA7oazedaM6sUhzS0dxUgI8dVlumj+lEBZ1e1CE9J+7TOfNiQSkzSONTlX2ZlHaoGYyx2+7hPWwDOcXBevobSjAE0AlDdWMKL0db5uAASx7NnsKCq3FVIF9/+7KSWbVhCwAebel/ZSPE4FL1CubLPUVP2rLC1SMhvZb0vne3o8uf+sLXCcLKxxluToOm66nuQmNsSjASi24vJv+vOZyYTh2MWKaYoZQiK5RDO4V5g== 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:(13230031)(4636009)(136003)(346002)(39860400002)(396003)(376002)(230922051799003)(64100799003)(451199024)(82310400011)(186009)(1800799012)(40470700004)(46966006)(36840700001)(40480700001)(41300700001)(40460700003)(2906002)(5660300002)(44832011)(316002)(4326008)(8936002)(8676002)(54906003)(70586007)(70206006)(356005)(82740400003)(2616005)(36860700001)(110136005)(86362001)(36756003)(81166007)(47076005)(6666004)(16526019)(426003)(478600001)(26005)(1076003)(83380400001)(336012)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 18:58:26.7103 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e1d08bde-a155-4d1c-28f0-08dbfa7b285b 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: DS1PEPF00017093.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8009 X-Patchwork-Delegate: kuba@kernel.org If there was a failed attempt to reset the PCI connection, don't later try to read from PCI as the space is unmapped and will cause a paging request crash. When clearing the PCI setup we can clear the dev_info register pointer, and check it before using it in the fw_running test. Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- .../ethernet/pensando/ionic/ionic_bus_pci.c | 5 ++++ .../net/ethernet/pensando/ionic/ionic_dev.c | 23 +++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index da951dc7becb..311d9f4ef0e2 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -215,6 +215,11 @@ static int ionic_sriov_configure(struct pci_dev *pdev, int num_vfs) static void ionic_clear_pci(struct ionic *ionic) { + ionic->idev.dev_info_regs = NULL; + ionic->idev.dev_cmd_regs = NULL; + ionic->idev.intr_status = NULL; + ionic->idev.intr_ctrl = NULL; + ionic_unmap_bars(ionic); pci_release_regions(ionic->pdev); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.c b/drivers/net/ethernet/pensando/ionic/ionic_dev.c index c0b347dd6bae..1e7c71f7f081 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.c @@ -165,9 +165,19 @@ void ionic_dev_teardown(struct ionic *ionic) } /* Devcmd Interface */ -bool ionic_is_fw_running(struct ionic_dev *idev) +static bool __ionic_is_fw_running(struct ionic_dev *idev, u8 *status_ptr) { - u8 fw_status = ioread8(&idev->dev_info_regs->fw_status); + u8 fw_status; + + if (!idev->dev_info_regs) { + if (status_ptr) + *status_ptr = 0xff; + return false; + } + + fw_status = ioread8(&idev->dev_info_regs->fw_status); + if (status_ptr) + *status_ptr = fw_status; /* firmware is useful only if the running bit is set and * fw_status != 0xff (bad PCI read) @@ -175,6 +185,11 @@ bool ionic_is_fw_running(struct ionic_dev *idev) return (fw_status != 0xff) && (fw_status & IONIC_FW_STS_F_RUNNING); } +bool ionic_is_fw_running(struct ionic_dev *idev) +{ + return __ionic_is_fw_running(idev, NULL); +} + int ionic_heartbeat_check(struct ionic *ionic) { unsigned long check_time, last_check_time; @@ -199,10 +214,8 @@ int ionic_heartbeat_check(struct ionic *ionic) goto do_check_time; } - fw_status = ioread8(&idev->dev_info_regs->fw_status); - /* If fw_status is not ready don't bother with the generation */ - if (!ionic_is_fw_running(idev)) { + if (!__ionic_is_fw_running(idev, &fw_status)) { fw_status_ready = false; } else { fw_generation = fw_status & IONIC_FW_STS_F_GENERATION; From patchwork Mon Dec 11 18:58:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13487947 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="azjJ6y0B" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2050.outbound.protection.outlook.com [40.107.223.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D7B6CF for ; Mon, 11 Dec 2023 10:58:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PVVIz63KrcTRsMNejux3wxn598L8VeZgO2fjQ7rXRos6GzYeT9RZKTYOdGWgkyGH+9rO0qcvOCgbCblfyjLoufvBvjx32IgsFJ9zQfNkmlnvFLJGH8K140ADd834hpYph3v3eT4Ea2QjmSjHpZ6t+kd59vUZCvUsgoXPAeCHDxRyvOgmIA95ue9KBZqm6NMkHKnXN0BRPzHY5LmIXM11AvQk+0h8f5qXX66cEIuewSUeHan/+jCglbPUSoqfpwLgvq+AwYRTs+XgvtFj+eQITpiY/LmIAwSxVUBW1OpdIhEXUca8IEEDA6bygPh9o33boy/JH+92fKu80luk0PSjuw== 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=TpLboh9i0uLYXVWYnR43BI0Dx8RP854F+/7D7eVXXi4=; b=Ar55TZWT2pfs8JMT+cdRyDzBHpXy1yUEZeFRahNc2MvabnpUlUuaI73d5MWmxi+tFEa/d2pKVpE+LxENNKnhdeolIDciP9WgCquyWhPLuuRPNIz4yPPbLyYmjGzHHfhsHg6eHKVk1z85yAJQe1JhHGsAaJwIO4r7TEraXInwINpBUb8sVHDTE82dFKWqCp+D7y5E7BJF8yNMG1zuDyHeh6LuEY3yAPI9Wcmic9O6PnmARk1jyaJ4aB1HJeNlH+VF4kPwgn42f3wFKpPZORICPUwPAHnWAIv8oEmh/7IeIosHG9EUfs27v0tTSSznhekytV13eftbekIHmO4piGFjjw== 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 (0) 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=TpLboh9i0uLYXVWYnR43BI0Dx8RP854F+/7D7eVXXi4=; b=azjJ6y0BPk9le3y2wOkC3Bk3XOHJGEx0Hsxmpt5oep5G/OZB742cLQ5u3PfnzKNQFtnsKkwK9aPHCjKAOa8J6C/irOqlIU+04u5w29kC1rGAL0V8efP1kTTfwXqVaByX1zfVLCAkTPOXZ7xs4NaO0eYijlL4I1USCJv0P1cfz4o= Received: from CH5P222CA0014.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::6) by LV8PR12MB9110.namprd12.prod.outlook.com (2603:10b6:408:18b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 18:58:28 +0000 Received: from DS1PEPF00017093.namprd03.prod.outlook.com (2603:10b6:610:1ee:cafe::70) by CH5P222CA0014.outlook.office365.com (2603:10b6:610:1ee::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33 via Frontend Transport; Mon, 11 Dec 2023 18:58:27 +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 DS1PEPF00017093.mail.protection.outlook.com (10.167.17.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 18:58:27 +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.34; Mon, 11 Dec 2023 12:58:24 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net-next 6/8] ionic: use timer_shutdown_sync Date: Mon, 11 Dec 2023 10:58:02 -0800 Message-ID: <20231211185804.18668-7-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231211185804.18668-1-shannon.nelson@amd.com> References: <20231211185804.18668-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-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017093:EE_|LV8PR12MB9110:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c63b68f-ae6f-4460-fa8c-08dbfa7b28ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FelV/ZiPrLPv1DjdDOSmikLUKR3S8wJFMrdcXMF85Otq8ouf716kuRvUzI149YZuE3L5wCFX+Ga+WtXzIRfdc8l9FwHF16xEJQU0mCBU0e39QJ6GiQY31ER/lTaJ8GxPPqVt3ZexVecxu7xHis7hemu8h85k06CFs09se+2upwRS3o7NUPMRqd5wfM11iLB72fspnbHk653ztnOdrX1JsHgpoX1Wyc4KHPlcwtIIXq1yfQX2wktY/yBf3F10BIF1UBUjjFwwbNZFFHOaxqQ6G39qGDzarTABkskLppxvHp6gbgqVrOyDws2uy9yjbDIUazEiW1LB08DDBzv6mTzZjvoBQOMNl25p2+QNrTr5+HYYBZAVplQ1qMHLJypFIpynsQYb0Sv1ytDlXcFP9D50FWFyIa7c4VGqEruWZvo2cUp+UoQYxhCWreXY3+ofSm/LpRl9hKW+/MvHehmrysj7tul3lbjqoq3ZTiUYiBk2i2mVcBE9cL2FXhpKlBTIdJb/Yzxwp47Rue20uoiCqj2qRZczsL2B1trOHWycOqLVdB7bpnBww+hKNuvz7T2lFg6Jv0jzRuvPMPD+YtmRZF2tV5WcsUdepqfBPyI+uB4bwUW0pc0TAUVxd7oPeSIRARCKwuQxqSasn2GtMloeZvWHmF2D5JdvZaFzaRKdMQYOOrGebWE3IMLoHSMelYw5DEg/AV/+ZYzOoQkMJdrrm4EZ5r6Rxati4yOPgF8Lu44fAI6m5RCGtWBYUG+raaClYq4AJAlDPaxupg4epIzJX/CH6Q== 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:(13230031)(4636009)(396003)(136003)(376002)(346002)(39860400002)(230922051799003)(64100799003)(451199024)(186009)(1800799012)(82310400011)(46966006)(36840700001)(40470700004)(2616005)(1076003)(36756003)(36860700001)(6666004)(478600001)(40460700003)(110136005)(316002)(86362001)(54906003)(70586007)(70206006)(8676002)(4326008)(44832011)(81166007)(82740400003)(356005)(47076005)(426003)(8936002)(26005)(336012)(83380400001)(40480700001)(16526019)(4744005)(5660300002)(41300700001)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 18:58:27.6791 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c63b68f-ae6f-4460-fa8c-08dbfa7b28ee 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: DS1PEPF00017093.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9110 X-Patchwork-Delegate: kuba@kernel.org When stopping the watchdog timer at remove time we should be using the new timer_shutdown_sync to assure the timer doesn't ever get rearmed. Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index 311d9f4ef0e2..fd2135c23862 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -396,7 +396,7 @@ static void ionic_remove(struct pci_dev *pdev) { struct ionic *ionic = pci_get_drvdata(pdev); - del_timer_sync(&ionic->watchdog_timer); + timer_shutdown_sync(&ionic->watchdog_timer); if (ionic->lif) { /* prevent adminq cmds if already known as down */ From patchwork Mon Dec 11 18:58:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13487946 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="SaDQNZgr" Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2045.outbound.protection.outlook.com [40.107.102.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 868A7B8 for ; Mon, 11 Dec 2023 10:58:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sd0lB0hkdYhrDuwN6qZ2ezjnCfzT9glgWIvnzHRF7ANAuUGluHgFU1RJo6O+b61vOZNQWz3x8X+LFJMqnkOL2MBC0FBzYwbb5aA5oceTaMGDVZTn3d9ug0vnFLm0lZclpn94m2Q5OHfDs4tczwu6jpmkZqxg3RkCyXQEObHLmGbLJr24GVNxh2/Aemegx0R67FPWfcd49D32hEG1qur1LZQkFXuXdM9c51gFuQT1Ttf0rf16JkGe5G/DjbkOZNYFfMyPVzUDQORwYgAcR2036lmMQ3gTCd+9uk+SOimXIIziXJD4+RtNSmuL3TUgdMEDj82gnG7TjFyXhqVmVc5mFA== 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=56o2xy4n3eLax01mQcl9NYsM0i8dyviYyKIXun9ROmA=; b=DJ7Zo3f45NTqvUWtStJNEN/7hOozhaOzrGuyazW/TcRv06DFT+qIoo6Q3ArkN75eA5DrcC8+xthI7PqxhwevEQPesG0y8Y3QolH3FycUyTM9MpBTrW+v6ik0nhZ7X88OGlYmJeL4AdLTkLRKDVdWuNuDJ+Q9PByr4UGsSc4UGjNTNgOnRf8h5WoPfo9yx+oicTUQ61oFF/23vIoiOixu1ZAHLEHeWapvI4/wWVhhOU7E/BBLPipXw/Lw6gVmrqQaliqFQ3Twdd0fFym/8UJ2BaGkjOjzFc5rYLUgrBUq4jw9GCuy5qvGkQEH3Fl8qGNgFZ033IUltC1nrzecxS4B5Q== 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 (0) 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=56o2xy4n3eLax01mQcl9NYsM0i8dyviYyKIXun9ROmA=; b=SaDQNZgrDNFlsXNhPl1vOPNFQcJtUQctOsPQQWsaEVr9N4vDJKKdVBHqenfBx909CLAsYbS7XDVvOqxlodPtPZSJB8dpuSRhMY3jGj6VtW6hkmxbdbhnCFpTMFpkMQEoX5xdNMqX4grIDidR+qzAq3cckmAL22hCzGp7oV5kU0E= Received: from CH5P222CA0010.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::28) by CH3PR12MB8186.namprd12.prod.outlook.com (2603:10b6:610:129::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33; Mon, 11 Dec 2023 18:58:28 +0000 Received: from DS1PEPF00017093.namprd03.prod.outlook.com (2603:10b6:610:1ee:cafe::5a) by CH5P222CA0010.outlook.office365.com (2603:10b6:610:1ee::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32 via Frontend Transport; Mon, 11 Dec 2023 18:58:28 +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 DS1PEPF00017093.mail.protection.outlook.com (10.167.17.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 18:58:28 +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.34; Mon, 11 Dec 2023 12:58:25 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net-next 7/8] ionic: lif debugfs refresh on reset Date: Mon, 11 Dec 2023 10:58:03 -0800 Message-ID: <20231211185804.18668-8-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231211185804.18668-1-shannon.nelson@amd.com> References: <20231211185804.18668-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-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017093:EE_|CH3PR12MB8186:EE_ X-MS-Office365-Filtering-Correlation-Id: 660d85e1-6119-44db-e1ed-08dbfa7b2957 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zNYBzkdTk0slG4oZ7+asWkEY+Swdfte9PEAmspYMdGoptBdfCAY3mTa3BQ9s2ohko4D37MuUnQEmuHWaHNx5rrWtX1LAq/52XOpt/YX0N7XIqUXRN+HDQn6kIivl/I8xjgLMNMlEX7OK+QnA+tNg5bG4SS2/aMAsU9WQEOvRGlxps3iP8p8C8NNYrndIoQhlDQGiEeuGmMBak+tKzUk5wsCc/ERqae6fWSlmBTrQg2V/MpLTvRAFPmvkSXfrryfzF7PO+rtAmbq4j0lC2FSKcfmQb/oRDZL3iAz6Wh8CKB+epE38M7TJ43reOG88Sup9jjgv+hJEo5/KBdjNV5S/XxYU6CcrUPN/7Mmt71xGL1ytrEd4X0SdEKJEeh7wMIF2Ds+xIbAMJOk3E1brANpaPeWk6mFkqaTQ5rkc52ml9G5oe5IqcmoNiaBpe9ubpLjEhWXdRZWNDKXoixGUb0a25AGsm2S92z6P4xp//CmKN2yJyJCPDxLLfZ5NAz8Zegomxq3Yigfp6A5ybTXTNwke0x+OxgZRX4wFvfvh4sE8mbWdwQ5uDpGDdq+Y5eIm8BLlx4/KsuEm63Y3WvGXcI5AN9tvQnjVJWqs2KUMGSXzUOOEgu+3Qta+47Ipnzk3Ly0b162GAlTFWlwXKXUoFMKMKZ01fXmAeroB+rZ3JNqvPsnmRhT1+qAj3p++YsB+kxoOh2bTfkU18REXwhTyHTr/a4UTn/Co6Ubgm0a3qXktQlDeEuFkC14XpxLKe7QtBIklzBxKzKe/nOu8PCTz6JJPIw== 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:(13230031)(4636009)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(1800799012)(451199024)(186009)(82310400011)(64100799003)(40470700004)(36840700001)(46966006)(83380400001)(2906002)(82740400003)(41300700001)(86362001)(478600001)(356005)(81166007)(40480700001)(70206006)(70586007)(54906003)(426003)(110136005)(316002)(6666004)(8676002)(4326008)(8936002)(40460700003)(44832011)(36756003)(1076003)(5660300002)(47076005)(36860700001)(26005)(16526019)(2616005)(336012)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 18:58:28.3666 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 660d85e1-6119-44db-e1ed-08dbfa7b2957 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: DS1PEPF00017093.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8186 X-Patchwork-Delegate: kuba@kernel.org Remove and restore the lif's debugfs pointers on a reset, and make sure to check for the dentry before removing it in case an earlier reset failed to rebuild the lif. Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 1 + drivers/net/ethernet/pensando/ionic/ionic_debugfs.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index fd2135c23862..60e64ef043af 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -437,6 +437,7 @@ static void ionic_reset_prepare(struct pci_dev *pdev) ionic_txrx_free(lif); ionic_lif_deinit(lif); ionic_qcqs_free(lif); + ionic_debugfs_del_lif(lif); mutex_unlock(&lif->queue_lock); ionic_dev_teardown(ionic); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c index c58217027564..91327ef670c7 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c @@ -287,6 +287,9 @@ void ionic_debugfs_add_lif(struct ionic_lif *lif) void ionic_debugfs_del_lif(struct ionic_lif *lif) { + if (!lif->dentry) + return; + debugfs_remove_recursive(lif->dentry); lif->dentry = NULL; } From patchwork Mon Dec 11 18:58:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13487949 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="NSlHwU6H" Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2079.outbound.protection.outlook.com [40.107.93.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4769DB for ; Mon, 11 Dec 2023 10:58:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PNwKgkj2vIwR1Bw0U/7ZJPv2IZxwVb7CTxyT0NIL4pS8QoLYpgg52t5cVzpKdNhbWvf4cAl0IbBKX4ZpR6mDI/tSn9NmFJCzH/xosqFSzw7iYJ92B5snYqJjBxi6/eYvafqEK/hu9SorGS46piuY4GXTZzvFuRLzjkc2E6VU9DSOBznmDbv2DIMOCWMOKJj4slHUDukM+IqXHUfmVvbjzzGv8Gx7pbwz6iqlz9j+K0WqkdiTN4r5jOBTy38/AjZtR3+1NaL3/mJtaz+F0r4IiaNL3YwfVBXGhvT+YMrYqpcVuvqaJ3zyvlbeRNbdJYkH8l52zGA97pJs4zlMer2NSQ== 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=9zJLb1MeZEmq22+DwtJXUd5sfLp66UlF2tspdckrzeQ=; b=PxkphozNcKO38i+E9OZ3MLf9poa5hrlRO4AiuhFVoAQ3q0AUJFQvjSDOZwtQiv5HhG3lAG9ZM5JS5JXbA0Hs0YjW8z21ImLZt0krlEhXHCGSoNXbc8X7rJQuM2ZDnRs+8Px2yOfDjrsRZzgq9eRxpY02yjCKiKCPAGHmKxSe5tUwW9oNEYv9HhCKVuOSiHdt2v89WKzTV8ciizvEBAlZff9ktRJumGEaXKAVQZb9FGSoq+Xz2iyH3vAQ3VCwDtTNsyXKcv3RIAsLkm9eb24moxtJukI0LAR92+hAedjnZNmK0MVrDWg7lVKyHSGr+zZsydTK8YSd/lPE9aLVkfstyg== 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 (0) 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=9zJLb1MeZEmq22+DwtJXUd5sfLp66UlF2tspdckrzeQ=; b=NSlHwU6HDki9h71bkLWXCZf1QsQ2yigG3hTylvJfnZLLFu9D/sRvG6BLyZ8lkOoQOWPfSoj1cMEdqYpoS2mNz3HZit0obHC/2iDY71U3fmX2ymJ2Np+1f5WRjKAxdnE+OhZ4mK9OPpuIMEQhCP9/MuMnYFho1OEf86aEi7G/oIo= Received: from CH5P222CA0009.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::25) by MN2PR12MB4333.namprd12.prod.outlook.com (2603:10b6:208:1d3::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 18:58:29 +0000 Received: from DS1PEPF00017093.namprd03.prod.outlook.com (2603:10b6:610:1ee:cafe::a8) by CH5P222CA0009.outlook.office365.com (2603:10b6:610:1ee::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32 via Frontend Transport; Mon, 11 Dec 2023 18:58:28 +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 DS1PEPF00017093.mail.protection.outlook.com (10.167.17.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 18:58:28 +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.34; Mon, 11 Dec 2023 12:58:26 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net-next 8/8] ionic: fill out pci error handlers Date: Mon, 11 Dec 2023 10:58:04 -0800 Message-ID: <20231211185804.18668-9-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231211185804.18668-1-shannon.nelson@amd.com> References: <20231211185804.18668-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-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017093:EE_|MN2PR12MB4333:EE_ X-MS-Office365-Filtering-Correlation-Id: ae16e821-8246-46f6-0607-08dbfa7b299d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bho4lzy2aH+3CmqrDGgdDFFV/IqUVz0iG54E4375JJTCrvCpaxJDG9vxSerKwx2z1HFNtbBCHYrbHDlVnU1S3g2DFTW+PM6fHOl/lz0sWf212Bz1R/EqsnSwgVrX54rHB0OFZQTqL76ngMnVsVr2cOeJKPabMlfM5vYTE6IOgp/Z4XRDJ6rMRwfwNf+3EprrVcuQUyeB1lB/EBi7uOfHJcjW/UkdcIen4M37j4omRIoZAGl4B3/yjywXdFnwJHo10ZqO/syai7hW+bzZtcZTFK2x15ovkI7oeRkv1UTE99Sjg1cP/dBnEV4vPHTa1DKOiDbfN7GWZOA/6Qkfj8RlzsMzAHfMm8SDHh/0bjuM1RwJXYooR4hTcZEx3NWLyjruOUMUTokVjanmatYPomYRR7BaOHFFE29J3r316h3d4QcxDrcMb4ojtkP/qXfZK/SzC68B6R1AMrodI0RNEdaNbS9P2fj02f7TnCLIqDrk4QX558Z0wsXGtNy/Ax+nwg2QrlyAuySoxGAtIaODWo0EryfDGs5IJFgxIsVUv6IIMAkbcsk93wtXfHHJWz6vUjZCBPF7klsDvMoLYnhPAfwjlFGp8OPp4vL5M8jovltFv7kvPnBmklbDaD1DHTgDBNXkeMus20sYAPYAOy0nqAM1x8fmCetHW2OMH3BhrXpg4NP9XOW2oL56vb+Rlzbp6I/zB8NTl8wfY/SYv/Fo1pgStd+XhFClfm79nzDeQw9pt5GXf7d11qijjnbqzS7qLUuEK4u8EHtuW0jAhPy4g+aXQQ== 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:(13230031)(4636009)(376002)(396003)(39860400002)(346002)(136003)(230922051799003)(186009)(1800799012)(82310400011)(64100799003)(451199024)(46966006)(36840700001)(40470700004)(40460700003)(2906002)(41300700001)(36860700001)(110136005)(36756003)(86362001)(356005)(82740400003)(2616005)(81166007)(1076003)(83380400001)(336012)(426003)(16526019)(26005)(478600001)(47076005)(6666004)(4326008)(5660300002)(44832011)(316002)(70586007)(54906003)(70206006)(8936002)(8676002)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 18:58:28.8353 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae16e821-8246-46f6-0607-08dbfa7b299d 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: DS1PEPF00017093.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4333 X-Patchwork-Delegate: kuba@kernel.org Set up the pci_error_handlers error_detected and resume to be useful in handling AER events. If the error detected is pci_channel_io_frozen we set up to do an FLR at the end of the AER handling - this tends to clear things up well enough that traffic can continue. Else, let the AER/PCI machinery do what is needed for the less serious errors seen. Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- .../ethernet/pensando/ionic/ionic_bus_pci.c | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index 60e64ef043af..c49aa358e424 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -469,10 +469,35 @@ static void ionic_reset_done(struct pci_dev *pdev) __func__, err ? "failed" : "done"); } +static pci_ers_result_t ionic_pci_error_detected(struct pci_dev *pdev, + pci_channel_state_t error) +{ + if (error == pci_channel_io_frozen) { + ionic_reset_prepare(pdev); + return PCI_ERS_RESULT_NEED_RESET; + } + + return PCI_ERS_RESULT_NONE; +} + +static void ionic_pci_error_resume(struct pci_dev *pdev) +{ + struct ionic *ionic = pci_get_drvdata(pdev); + struct ionic_lif *lif = ionic->lif; + + if (lif && test_bit(IONIC_LIF_F_FW_RESET, lif->state)) + pci_reset_function_locked(pdev); +} + static const struct pci_error_handlers ionic_err_handler = { /* FLR handling */ .reset_prepare = ionic_reset_prepare, .reset_done = ionic_reset_done, + + /* PCI bus error detected on this device */ + .error_detected = ionic_pci_error_detected, + .resume = ionic_pci_error_resume, + }; static struct pci_driver ionic_driver = {