From patchwork Thu Aug 24 16:17:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13364420 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 9C1682891D for ; Thu, 24 Aug 2023 16:19:28 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2067.outbound.protection.outlook.com [40.107.220.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 624A31FCE for ; Thu, 24 Aug 2023 09:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AuLjovAWJ4LqYcjiG8Dl9sw5+qTAsenau4OwVHzyv7Fr6H5OzhWJq7hR13aZaTo7YshcbrvkOCgfZBFfFp1OFeOf/5FVwRMevP6CpPLMrRkDKE4a6UBo9rKbzNKTeKHvtmid/5rGJtc0SkFGzBS8AUlvuF9OlrV1kQVXYCw7wYBVU4RdfWGlVX9k2zpHitc2va+tdu3e1uA8e7CBX4qR4ou31OAbkY+QwNnkQ4KQdze0a9RrUHUJnrZKJNHFDR7TfoCxtvd9WKbVIIj9x+rxJ0E6NbVli1mjUI/u4+Vsh+KewoQXz7zeKAPLtq2yKigcF4sR4bxpo0nGRi0A132Bmw== 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=KtpWN1mY5adwU3J5iNC7caeagtnmqXpAZr/WTuueZRc=; b=CJL9fTMc2wlG3mKilVnjsRon6B7lrZ2OG4xVAsdYEtMeNNEM7TacZRvUjfyKMGWFfUkfRrdyL1a69uxsUj0UYB7sMSwHiy6TwGiYD6OK5Y1/IJGX32g7DMLMPNaeF9Qzd/4CWk7FX1A+JFZJ4YOEma4ePQsA5wLODSAZfrICl0eA0XYyXJ34OrHtDUCCnq9ukdjkEfeZntHf6ZDrAQ+9QGRhSAwzMyWk3uXaLHP5dh3+ITYd0jeHm1eVibZcciAHmvQ+mEum4CMTl9VaEbhK+2uAVIva6Rr/wmRhvf9S+Si6PeG0j7Fh0oRxBOuu9nbH/jJVbm0fAv3DjaJR/Omq2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net 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=KtpWN1mY5adwU3J5iNC7caeagtnmqXpAZr/WTuueZRc=; b=smeEHvyx4FbohMpDXoQSQqBcX0tCsEBJ8LIy2ve9/g+Dg8ZNPCXxfdqzWP8LbrTh9/Kpo6FwQblzFlJ5QVantGiVvf0GfrRgEl9A6krVF4CpVkXoUWFNi1J6Gwu/ErSIZ5AF6CwoLSJ77kXfhIlED1ulPFIuEGMOM9g/c7C6RJ4= Received: from SN7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:124::6) by DM4PR12MB6181.namprd12.prod.outlook.com (2603:10b6:8:a9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27; Thu, 24 Aug 2023 16:18:23 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:806:124:cafe::78) by SN7P222CA0021.outlook.office365.com (2603:10b6:806:124::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27 via Frontend Transport; Thu, 24 Aug 2023 16:18:22 +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 SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.14 via Frontend Transport; Thu, 24 Aug 2023 16:18:22 +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.27; Thu, 24 Aug 2023 11:18:21 -0500 From: Shannon Nelson To: , , , , CC: Subject: [PATCH net 1/5] pds_core: protect devlink callbacks from fw_down state Date: Thu, 24 Aug 2023 09:17:50 -0700 Message-ID: <20230824161754.34264-2-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230824161754.34264-1-shannon.nelson@amd.com> References: <20230824161754.34264-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: SN1PEPF000252A1:EE_|DM4PR12MB6181:EE_ X-MS-Office365-Filtering-Correlation-Id: b3ac6fa9-8ca1-4955-de7e-08dba4bdbcc4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lTuy0+4mUq6fwXQly0ta4iJkt2KrCA8YJIxMhjWKZYyQJedQia5jyxD967UmGThO0U8aOiLnoUUkPN+ld39DmudgK6ZSZ+ME/pVGYQMawUHBnSHK/XOqhfulZun5rntk/ASoLWc0EpWwLIYRSyF1jHQHWcU/dr6dQb0dGBaOCAplxDggNcZR5JBrWYfnujdpTdy6Tn+dXP3WBItI8riGI7Ud5qpfRADuB2i5jFTgDi/K/2sgTbMY5+Y4SFUg7JEDz1RFa8TFpqETQ9AALeAKRtuDY3CrBUDE4BS6Ba+u3VEIw/YUfjZ9fBfM4SyPRmkIXn0KMSRx61Rycr4lRIIgoJCZUAlal3CUnWvQngLC8Epua53d0opNeJcM/qAQ/6+UW1bF/aIcHbZ7E9QauyWSTJf1GZEyEO1bjZ89Kk0DTUq2tFfkhCmRSXZweHLUjZcaQPgc7lf3b4lIABnWKfQmvtj+9pqPEzvsXdZVCKh6OHeIW/hMQ2cn5a0hlp98HM4qxLEGtoJ5bsskaBnoVa2y5CQ7Sbcc4J1YHXEv2Q/EO5PQ2I0UlzZA3ix6ft9YveD+daPiSlIOu2QNUP6ua6g19ffmlpNSIGQVGATQIt2xp0oKtVmnS+o353fuFCMxFSsaTkY0I2cpD9pYMzwuufjvfGOQ3a9paowwCxZuZyTlh4MYz6kYNa3MrKyOD1kcyzpcGXNMIcw0DMlm1auBHji15ktpaIWmBnN3R9oj0wHXjBMrS1zcLXvqIblKGvdvnlBBMFwylLiwCbXtkPRBIU5sQA== 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)(396003)(376002)(346002)(136003)(186009)(1800799009)(82310400011)(451199024)(46966006)(36840700001)(40470700004)(40460700003)(1076003)(2616005)(5660300002)(8676002)(8936002)(4326008)(426003)(336012)(47076005)(36756003)(83380400001)(44832011)(36860700001)(26005)(16526019)(82740400003)(356005)(6666004)(81166007)(70206006)(70586007)(40480700001)(316002)(110136005)(478600001)(41300700001)(2906002)(86362001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 16:18:22.5224 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b3ac6fa9-8ca1-4955-de7e-08dba4bdbcc4 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: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6181 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 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 Don't access structs that have been cleared when in the fw_down state and the various structs have been cleaned and are waiting to recover. This caused a panic on rmmod when already in fw_down and devlink_param_unregister() tried to check the parameters. Fixes: 40ced8944536 ("pds_core: devlink params for enabling VIF support") Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/net/ethernet/amd/pds_core/devlink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/amd/pds_core/devlink.c b/drivers/net/ethernet/amd/pds_core/devlink.c index 9c6b3653c1c7..d9607033bbf2 100644 --- a/drivers/net/ethernet/amd/pds_core/devlink.c +++ b/drivers/net/ethernet/amd/pds_core/devlink.c @@ -10,6 +10,9 @@ pdsc_viftype *pdsc_dl_find_viftype_by_id(struct pdsc *pdsc, { int vt; + if (!pdsc->viftype_status) + return NULL; + for (vt = 0; vt < PDS_DEV_TYPE_MAX; vt++) { if (pdsc->viftype_status[vt].dl_id == dl_id) return &pdsc->viftype_status[vt]; From patchwork Thu Aug 24 16:17:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13364422 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 4C0C715485 for ; Thu, 24 Aug 2023 16:19:29 +0000 (UTC) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A4F91FF2 for ; Thu, 24 Aug 2023 09:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mk6jjm2iWxPE78qVZ2RaVKtp4JOdXJN4QzFxGk4GQRHKIczqo7o8Xbz1payleVCOx/nfpqwCQFZy/DSdZr8LbI4PqfP/nDxl6jaD5cu+uol66T0tVeWJm3yd3Pikq68u7hKi9n/D3h7OJFV6kCfdPu8M4xGA32h2GN6msVWKtIIr4d4ITaYqzsln++Pk67T0o2IY8TtHhsc7WvpEqCZBshJLF1vcfvQYO9qk+0H8nNFy2gORJkzlkFoks4I4C88yQxEJp5WE2CCXkpI1KQx1wiZRkEVyoXY3m3l5iO19t4zziyXCVvuj3nR9y/Tcz7Pjiv1tOiAG8gyPxgj6RWiQlQ== 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=niR3r3Gw8pojuFj35INxRgs/LRghEwUq9MSpjBp44Xs=; b=WO1InAO7toFg+n1HWhwf2RPQr6P5///7Lc3pD6ZpKhm9tzMjRy+sNr/lu5cdjMUUR6P0SDcKbv1FkdSEf8o1nZdR72/bvO3lpbswWkbKdo7LNaX15kGunCAJWAQAZArdyQ+UO4QjxFebwBYLoj5vsILIw2hYSHaTsgz3gW4MaqGcTlplVcR5SU5MnW5+Oktka4zqO6sPrEnbCgThjmg40cOXI/f9GofEwvJjThiizoqcqrEUjO5llSHoPwVrriwY65Lpbg3VllQ5TExLWi7IAtiP/I0oJL1k3dBUzLTdDfTg4LUzh0+1AaQRNOEI4NlNfwyVTvmxvyPfIRTASw8fPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net 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=niR3r3Gw8pojuFj35INxRgs/LRghEwUq9MSpjBp44Xs=; b=RT2fTaPN1MiGLcDU3aWc7eIQLUV9TVQLnVzZ8gFnob252BPTs+FwcsYgCgKZHKtuURIGC55CO+DhJpLn0y1hYFI4C1Zl8yH9TS52x2xxt64yeG4L7DOogvyrwfQXnPVjSSGBmleHdad5pH3X7Blsj47tq17ytv3632LGqiRGhbo= Received: from SA9PR13CA0047.namprd13.prod.outlook.com (2603:10b6:806:22::22) by BL1PR12MB5900.namprd12.prod.outlook.com (2603:10b6:208:398::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.26; Thu, 24 Aug 2023 16:18:23 +0000 Received: from SN1PEPF0002529F.namprd05.prod.outlook.com (2603:10b6:806:22:cafe::bb) by SA9PR13CA0047.outlook.office365.com (2603:10b6:806:22::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6723.17 via Frontend Transport; Thu, 24 Aug 2023 16:18:23 +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 SN1PEPF0002529F.mail.protection.outlook.com (10.167.242.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.15 via Frontend Transport; Thu, 24 Aug 2023 16:18: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.27; Thu, 24 Aug 2023 11:18:22 -0500 From: Shannon Nelson To: , , , , CC: Subject: [PATCH net 2/5] pds_core: no health reporter in VF Date: Thu, 24 Aug 2023 09:17:51 -0700 Message-ID: <20230824161754.34264-3-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230824161754.34264-1-shannon.nelson@amd.com> References: <20230824161754.34264-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: SN1PEPF0002529F:EE_|BL1PR12MB5900:EE_ X-MS-Office365-Filtering-Correlation-Id: c4afe625-c426-4b1c-07c7-08dba4bdbd2e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kJNgHuvMQWTMB51VJmVXpUtHpiG89o8ixH5OuJYStCVWj9kBAGXSKsBRSyH2ohUtov3d9tPnGHH5LOBGQMyihj7cv/2Gg+AghDLHQjVAM8W06h52OPokxII6Zs0so6OGIlAIfgWzHFVW71z4QHVo2tvIUPQDhFeEws2wmnFhCKgKHMhKkr6qpsQLjZeHaIxX9TjAIHTCOGofefJqRc/UfJkWjsBywV+gCTemekclAecNpsgx0WzEpjgemA8apb1jzVbMFj8Iu2WhF+FDTF4jrjmgzaflPO3HZfQqFIi9fp0R9S2fWEHNbrVHs0dFarmWQVISdr91XfEAXIR+/uM7zOqvXjJVwn7PgX/BuJnEB008Qx/4ry5y5uDlS7DDfUo98P4thX+Gv70+LzOw1nPVcVteG9GDnHhKMp4tEl+qjXGCJLjQdURrYCvZ1ge7FwWzkZqOk3gjUuZId2TDJdVOxsG3EWQeQFnMhPEjgdsXyb8hC6Q3jdueKbfNFfGJDCXZXn96A2uLEoF8nGhuzci/wyMSMSuUk86bUBzv33mRHAWcqb8FQxTJwKFQxzG0y/zjX+vjIrEjipCmp9PitgNwe2YY6TV89A/gC8sp+4HhExSH4NStvKjwA41R/yzJiZsQ0/c0wadju6HT/P97P2eBOf41BjtKVfNI3oGRhZWOHtwZz4f+kDbaRUACeZ6hc5uG+PoMx/qG2aWJzb1b0RVKe7CmnzkrV7V6uU8kBGTcp5QQP37VWtc1o9MPkRlwm+YX19uE98VMThIO3A2Hvhl6BQ== 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)(136003)(346002)(376002)(82310400011)(186009)(1800799009)(451199024)(36840700001)(46966006)(40470700004)(6666004)(40460700003)(83380400001)(336012)(426003)(82740400003)(356005)(86362001)(81166007)(36860700001)(36756003)(47076005)(40480700001)(26005)(16526019)(2906002)(2616005)(70206006)(70586007)(316002)(41300700001)(110136005)(5660300002)(44832011)(8676002)(8936002)(4326008)(1076003)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 16:18:23.1179 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c4afe625-c426-4b1c-07c7-08dba4bdbd2e 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: SN1PEPF0002529F.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5900 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 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 Make sure the health reporter is set up before we use it in our devlink health updates, especially since the VF doesn't set up the health reporter. Fixes: 25b450c05a49 ("pds_core: add devlink health facilities") Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/net/ethernet/amd/pds_core/core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/amd/pds_core/core.c b/drivers/net/ethernet/amd/pds_core/core.c index f2c79456d745..383e3311a52c 100644 --- a/drivers/net/ethernet/amd/pds_core/core.c +++ b/drivers/net/ethernet/amd/pds_core/core.c @@ -524,7 +524,8 @@ static void pdsc_fw_down(struct pdsc *pdsc) } /* Notify clients of fw_down */ - devlink_health_report(pdsc->fw_reporter, "FW down reported", pdsc); + if (pdsc->fw_reporter) + devlink_health_report(pdsc->fw_reporter, "FW down reported", pdsc); pdsc_notify(PDS_EVENT_RESET, &reset_event); pdsc_stop(pdsc); @@ -554,8 +555,9 @@ static void pdsc_fw_up(struct pdsc *pdsc) /* Notify clients of fw_up */ pdsc->fw_recoveries++; - devlink_health_reporter_state_update(pdsc->fw_reporter, - DEVLINK_HEALTH_REPORTER_STATE_HEALTHY); + if (pdsc->fw_reporter) + devlink_health_reporter_state_update(pdsc->fw_reporter, + DEVLINK_HEALTH_REPORTER_STATE_HEALTHY); pdsc_notify(PDS_EVENT_RESET, &reset_event); return; From patchwork Thu Aug 24 16:17:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13364421 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 9E15A14263 for ; Thu, 24 Aug 2023 16:19:28 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2052.outbound.protection.outlook.com [40.107.92.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01A291FF1 for ; Thu, 24 Aug 2023 09:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DfPaXY1QAhO8xC9mAkV7LvdzmCq3ng6qu/r8BzQPU0H4oTUtYjZjZc5unvJWbiXqxgwwkfFL9Wk2K9jAJFdo5mFn96K8xfZMkCmoMNyqybQqG7Z4xvgdJKZONfmUNJW6+YseQB7TJvJKEcXpSnIGOrogYd8KyuZyEv5T4l0s5yTli2OFgUFfyYSOvY21jPcKxA0EY7P9rH3Oyq526JARih/Ov6AcQnpqZZ7ri3Z2jhU5POGXjqq3dhHZRPnouGRpfNUsJ1KGWjQBddcsJAB6dz9FfDGjlslrYrGD/lM/CDAN69TTyrBhLPAYva30J28wRVoybI6Ev7kxNsO7pbbl8g== 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=EZ3KK8tgnsFHl3oDf1XaSW9ntjihzz9jxrRCgZn+zdg=; b=EDdldyMAGeJi0v4whcGiuLfGBIiV7RoQT/hwbl6t+V0WFywIaR4/3729VSy8VZ+4aS9A6yDnU9zJ+tktcRaDX4Ft2db77C57EM4mPmnYn9PlPvfVxGS8dXBsIN2OAB0ygZI6iAFyqUGQHjDfx8U4CPU2qyBs0Xu8HRxWx4rbZBlFgG0Ifm5ODJ11sZ5Fz0loDoSVtCVcLR8sEj00BbKCiHOScaaJ0DQHS7MuhrtzzhfglZF1rvftGLj2E74tn3DHHRvU+ODq+Cu38KAOSqZfRBhy5tkPQ6IyZPgxclxpQOM7Y/7iuLObbxjzOEcoMT2pPQcagKw6IZuxTzwHG51Dsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net 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=EZ3KK8tgnsFHl3oDf1XaSW9ntjihzz9jxrRCgZn+zdg=; b=r0nEpD+PuG0aSJSTbK1xjmhSHQj0CXU3k3EwghCmECCKh+Ws8dZ5Oq8XpKb3xWX2C3kfQMAlqBBaL4TD4x5Uw41sEHM/ZKyFnnAL0ajckXZSfLUqO7p8Ejk/5L+HcIO5vHOHm3xqiuBPM0ZU74kF49Ab9RBEuKvcrf41IdCSG/Y= Received: from SA9PR13CA0046.namprd13.prod.outlook.com (2603:10b6:806:22::21) by CYXPR12MB9428.namprd12.prod.outlook.com (2603:10b6:930:d5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27; Thu, 24 Aug 2023 16:18:24 +0000 Received: from SN1PEPF0002529F.namprd05.prod.outlook.com (2603:10b6:806:22:cafe::9d) by SA9PR13CA0046.outlook.office365.com (2603:10b6:806:22::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6723.15 via Frontend Transport; Thu, 24 Aug 2023 16:18:23 +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 SN1PEPF0002529F.mail.protection.outlook.com (10.167.242.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.15 via Frontend Transport; Thu, 24 Aug 2023 16:18: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.27; Thu, 24 Aug 2023 11:18:23 -0500 From: Shannon Nelson To: , , , , CC: Subject: [PATCH net 3/5] pds_core: no reset command for VF Date: Thu, 24 Aug 2023 09:17:52 -0700 Message-ID: <20230824161754.34264-4-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230824161754.34264-1-shannon.nelson@amd.com> References: <20230824161754.34264-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: SN1PEPF0002529F:EE_|CYXPR12MB9428:EE_ X-MS-Office365-Filtering-Correlation-Id: 78509a27-f32c-4738-521d-08dba4bdbd99 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EKfTS735GCZZuljQ6VS2owcILzehJsPdV3DYrhGsvqwLB+bxn1l/PD+JhgigVaqsgGMOgyuOmlqvf1AfZgofvcswks4yvF/ulJYcFtDJI9v6Qt/MIXi7aEEmRRGqAakE6QeDGomKusUrwy9slckXnRHW4oVai83uOU7OZOJ+tXdE1nRUXjoXTzTMqFzWx/dFkwXRLDjJvT2CnwgiAIX8sEnlFcyhEW1ewHKMcNWI99ePb7rYnUFeLshzb6EB5adPg9Zj0NdQgvNC+fNGY6QwXI3lJ30zJmaFSBsKYHMXfpWNSlA2W6jcoIanxfc0hYVO/v32M9hhpohUC4JLUCNci1Eq9+VIJ7g0vdGxRMA2Ic4qFUfdroW74um+i3CuRyyR98FVZjbX4CqpMHKvzwmd90pQ8Pr43I2pzu9jIcYe50LnvZLBc21q7xOuz4vSF7i5nor0r2Wk31FGtfrScMi/nKClmI7KNtzS0oVBaSkNYVFCAkN0sEyfees+ryapDoEYpuZoNMgTpuU9t1KUseacFbTrVHLDnx1VPiUoqYvEyjbKIIWm3XYfJBDXHKt37duiqdoBfsWJNYsewdU5vPYJmmMglEkwvJ8/WnuvOrsFi4R2fCSc2oxt7Ar3IrI3eU7II+v+r3UwF81EalkiXQRNgZFAnqNbxW2yxmafkIDMDFx6zSyhHGARDsb62z2K0EralipKrbMZHw1qWuiRcsviAc+NlTcLGB78nSAcQSrZClOcEi41jgV7BC/T3CruevqVTxRhnofCAjDP4rjf2DtKfw== 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)(39860400002)(396003)(136003)(346002)(82310400011)(186009)(1800799009)(451199024)(36840700001)(40470700004)(46966006)(1076003)(40460700003)(2616005)(5660300002)(4326008)(8676002)(8936002)(336012)(47076005)(426003)(36756003)(4744005)(83380400001)(44832011)(36860700001)(26005)(40480700001)(16526019)(82740400003)(356005)(6666004)(81166007)(70586007)(70206006)(316002)(110136005)(478600001)(41300700001)(2906002)(86362001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 16:18:23.8835 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78509a27-f32c-4738-521d-08dba4bdbd99 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: SN1PEPF0002529F.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR12MB9428 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 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 The VF doesn't need to send a reset command, and in a PCI reset scenario it might not have a valid IO space to write to anyway. Fixes: 523847df1b37 ("pds_core: add devcmd device interfaces") Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/net/ethernet/amd/pds_core/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amd/pds_core/core.c b/drivers/net/ethernet/amd/pds_core/core.c index 383e3311a52c..36f9b932b9e2 100644 --- a/drivers/net/ethernet/amd/pds_core/core.c +++ b/drivers/net/ethernet/amd/pds_core/core.c @@ -464,7 +464,8 @@ void pdsc_teardown(struct pdsc *pdsc, bool removing) { int i; - pdsc_devcmd_reset(pdsc); + if (!pdsc->pdev->is_virtfn) + pdsc_devcmd_reset(pdsc); pdsc_qcq_free(pdsc, &pdsc->notifyqcq); pdsc_qcq_free(pdsc, &pdsc->adminqcq); From patchwork Thu Aug 24 16:17:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13364424 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 71728156E3 for ; Thu, 24 Aug 2023 16:19:37 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2078.outbound.protection.outlook.com [40.107.237.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88A001BD2 for ; Thu, 24 Aug 2023 09:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YGgGrzztuL+ISS+kuXuhDdusF2FxnOBVRNUGkw+PiLb7Yri90K0nu0NP/DmQwLA+AwWgd/F3+Iq+nB8DyORBI50hBf5Bxme6uB9ck9m3ei14Ft44z0B7rOdm5M0XYfuGgbP57cakB122Mk+K6P9Rnbpy/t2T1NdWvS9egPCJ8z2RAuTXTxfgZMh+HdP7+1hNlxNMq0cs473Druydfa5MLS7INQ7G/jm/hYxOi8VK/OPwapmZserUkmPaw6Qm1HIdu+thZpNIRUy1WiO5/1qgPSdBtpTDnZfFUl/COKh75Laufryj6vnIeMS616HAOp2meWFnIMNlkfNqlPGsVvht+w== 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=Q6+ROe/03hW8drri50sCjF7YkNtwxwBRSet++U/hQtY=; b=dqyrGx0KIBlo+46nqO6HVh90O0rzaDEtt7++YzPQV+97BzcjuhhQtU4Ht7UjoZSPstBOj6xTDP6U9P/e5RcimeiHyY7/Cq7nxpN8ZMt4Na6s4BzPK2I/QBo7UuuwdbE6cq72B1NLXSxvr3BEqCBnWfYecaN/BWFXoAkdfvvX2fAFDJ3yMjszIWI4iyxZGtbghnuY9X+sVnL6gpBjUiHepQCUfEo2UlysMrQwt+lzjLE8No2kES6o28ZYyiQjh8fx27ozajX8XeoQwzoV2EOWfl3mmZCmOBUXRbrixzoGiRSc4zLJct00dTCV3rgvVoAc+kN6MubbwSlbnKhegDse5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net 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=Q6+ROe/03hW8drri50sCjF7YkNtwxwBRSet++U/hQtY=; b=Y9pBAgrxq5SHlIqyWyIUZktmDYItlUEpdZsX8P0pzxTlpPSWrwKPqwWx+GtRgy9h2gDbSVOZnrLsdSMjX8ZRwRI+t8sT2lBPjJmGdQNzqjrT/VhKhffw3Er4vogjAM3qf+I/mFG5ZiXzot3YJJjbUuzHUmaFPMKJmebogjHJ0wU= Received: from SA9PR13CA0035.namprd13.prod.outlook.com (2603:10b6:806:22::10) by IA0PR12MB8088.namprd12.prod.outlook.com (2603:10b6:208:409::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27; Thu, 24 Aug 2023 16:18:44 +0000 Received: from SN1PEPF0002529F.namprd05.prod.outlook.com (2603:10b6:806:22:cafe::b0) by SA9PR13CA0035.outlook.office365.com (2603:10b6:806:22::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Thu, 24 Aug 2023 16:18:44 +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 SN1PEPF0002529F.mail.protection.outlook.com (10.167.242.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.15 via Frontend Transport; Thu, 24 Aug 2023 16:18:44 +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.27; Thu, 24 Aug 2023 11:18:23 -0500 From: Shannon Nelson To: , , , , CC: Subject: [PATCH net 4/5] pds_core: check for work queue before use Date: Thu, 24 Aug 2023 09:17:53 -0700 Message-ID: <20230824161754.34264-5-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230824161754.34264-1-shannon.nelson@amd.com> References: <20230824161754.34264-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: SN1PEPF0002529F:EE_|IA0PR12MB8088:EE_ X-MS-Office365-Filtering-Correlation-Id: d70a5e91-c447-434f-2279-08dba4bdc9a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CQz1Vu6PNPta8UKe7B42CqhUm7c5x9jwvlp6kOSsTZF1Xctb4ZiGy2QcHxWE8QY9jETqXBpdpnjrTg+Zy7EPa6nIOXDWGUqsYjm2Gya8pr5iSyu/ZUZCHdWwQn8Xeh9ziHKxRoyifM01xbMRdaKSWa5L6kSzA2NWhikywBbq8sYor1HogeBp1Ww3Gplp4QHuQsamlXhn9u29eJh3GGKJv5VtmXWnXiadpeiHH4C2iTW2enR7A1qjsTE+y/PVQprksyI9IYgGKHth2cjfdCGmsfc1ozkpzkLLtkwkPiajrmkb0HmNQeTZvtf0H6YMHi2K/VmG6/OrnVeJBPadcddHu5zwWBDVTpRG+KS0tLssijqsBkNjOeWUFnZb+mX7rxarEZmfj64G7ib1LcLB2jABbgjOuY8Ldns7/UbfIOgumdcH+N0CjGSMfYzvqbDAV0DQi8zZmvRlynUkwwo1GHXB9vumnfUVFAQ4ZfkjOYID2ezY4tYXQZk9UkAojglq+68tg4Hpvi0NExDTO2gM/SZCV5KZyNqf/NpJ6363vkZagOQDCt6yXk0lk2DemNXUynj4gT5ww7aYFYMlq/cm7GT1CrcuhXN9bvC1Zt+Of2phnZZUliHQgn95NR3G8/Quzb0Jtg5eAtgZZch9y3MGWLHH1Q1fIRQfoE+iwj5wnhPFD6AD1q/ybI+vbktpdFupkk6mMjGnE76OBPBBPm+78vPSOO2K3th2EnfPy2NyCGPpf5KODVEek97wcEMQ1jSTdWRe1nzvESCj3SgNGCdzQaLzhA== 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)(376002)(346002)(396003)(136003)(186009)(1800799009)(82310400011)(451199024)(36840700001)(40470700004)(46966006)(70206006)(70586007)(316002)(81166007)(478600001)(110136005)(40480700001)(16526019)(26005)(6666004)(82740400003)(41300700001)(86362001)(2906002)(356005)(4744005)(4326008)(8676002)(8936002)(83380400001)(2616005)(40460700003)(5660300002)(47076005)(44832011)(1076003)(426003)(336012)(36756003)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 16:18:44.0089 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d70a5e91-c447-434f-2279-08dba4bdc9a4 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: SN1PEPF0002529F.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8088 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 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 a check that the wq exists before queuing up work for a failed devcmd, as the PF is responsible for health and the VF doesn't have a wq. Fixes: c2dbb0904310 ("pds_core: health timer and workqueue") Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/net/ethernet/amd/pds_core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amd/pds_core/dev.c b/drivers/net/ethernet/amd/pds_core/dev.c index debe5216fe29..524f422ee7ac 100644 --- a/drivers/net/ethernet/amd/pds_core/dev.c +++ b/drivers/net/ethernet/amd/pds_core/dev.c @@ -183,7 +183,7 @@ int pdsc_devcmd_locked(struct pdsc *pdsc, union pds_core_dev_cmd *cmd, err = pdsc_devcmd_wait(pdsc, max_seconds); memcpy_fromio(comp, &pdsc->cmd_regs->comp, sizeof(*comp)); - if (err == -ENXIO || err == -ETIMEDOUT) + if ((err == -ENXIO || err == -ETIMEDOUT) && pdsc->wq) queue_work(pdsc->wq, &pdsc->health_work); return err; From patchwork Thu Aug 24 16:17:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13364425 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 F1E02156E3 for ; Thu, 24 Aug 2023 16:19:37 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2086.outbound.protection.outlook.com [40.107.220.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 515D81BDA for ; Thu, 24 Aug 2023 09:19:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EH9AYvq4NNHsWULvT8egbWTYlSmljY5wU/1MyeVK7SidB98i6r6xHrtQ8oKw71SS6+gdRS0CdHEQNd5KLRiXRcVbSb8XXbC1nJ51EI2FtJLVuKvDxtVmQrztVurrr5xVwbOj0rDK4gfml+3f3ADdOIo3ZdVX8WEPxOItbQTwulGXpROpQIcHaj047YvOUhMrNSGFRew6pTe0YG/88Y2m1yLVlL9lh0JiGeOQSS1pGd89ndEQCAyXe/a3oGp6xFTdceO46x8uHZw52s3F8XYIfmlv2yKgU/Xj+T2hjtuemz6j4z33HBaRa1Vz2UFxwqqFMcEB058qTUSRixdA5Slu7w== 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=gZDajan21dnAuF/3GCLg4TYztKgVRAADAFGa7eIBgFQ=; b=Ho5w1lsK3R6KAHXinhmDiOEy1w3gcRNI1TvC7kcmCXl4L8+W69nQJN4lzrZQMVJrxqVnfzjRMrbTLCefm8JBzdX8E3Iuhlm4RIFBodr/Z8EymD7gR8JS0b8BGLV5mr2DRvbgGS0RIsNwx8OrXqFSfvXM9sGg/LvMXqwsxee1wInYWqlA2U7A6O6KrNcork4uOYtoNs0dFevm4uC36gHWqG5Ebi+AQr0dcd5w3rCdx5bRd4GHsH8itMJpfCrCCylYFjO//9pvIjaWHoQgb57Wtr0gN7pQ5q9bKvzJKyW2ThZZ5waon5zBYGrtH8hB93p5Png/3XNG9/nre+hMxgLRpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net 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=gZDajan21dnAuF/3GCLg4TYztKgVRAADAFGa7eIBgFQ=; b=RqP/4n7Q10rhxsAGe404/omY24RhrM6CmeiFhSTn5EZPWCWDcPH+yDQ72QIMrix7/IXEmbKnQ5msuHebNHSJL2Eed4ukl+Vfwb/vndC3MtS9DKn4q5Xp9EdzWY/GNkj9R8xLt7IMThY8HZMY16ZIK0JBUBAqMK/GTp+W1DyvKO0= Received: from SA9PR13CA0122.namprd13.prod.outlook.com (2603:10b6:806:27::7) by CO6PR12MB5428.namprd12.prod.outlook.com (2603:10b6:5:35c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27; Thu, 24 Aug 2023 16:18:45 +0000 Received: from SN1PEPF000252A0.namprd05.prod.outlook.com (2603:10b6:806:27:cafe::a9) by SA9PR13CA0122.outlook.office365.com (2603:10b6:806:27::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6723.17 via Frontend Transport; Thu, 24 Aug 2023 16:18:44 +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 SN1PEPF000252A0.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.15 via Frontend Transport; Thu, 24 Aug 2023 16:18:44 +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.27; Thu, 24 Aug 2023 11:18:43 -0500 From: Shannon Nelson To: , , , , CC: Subject: [PATCH net 5/5] pds_core: pass opcode to devcmd_wait Date: Thu, 24 Aug 2023 09:17:54 -0700 Message-ID: <20230824161754.34264-6-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230824161754.34264-1-shannon.nelson@amd.com> References: <20230824161754.34264-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: SN1PEPF000252A0:EE_|CO6PR12MB5428:EE_ X-MS-Office365-Filtering-Correlation-Id: 35db1d52-4cdd-4029-ca3a-08dba4bdc9ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: enKvNTMNqhGhtpISB87CO5ei2rdB4eaMB71g1x+s/GmBp4HZK9D84/k6b2M7ZDm9TJ7cuIFYESxZDX8xlI6dB3D/WFxxHysg1jdgL0RCo9jLEBZtDM/wymFkvXjp1Lh8ego/fsUQ83yb0H0QcbNcwkyrdcrn2bienxTeCY0esmitaSqYOY0+kecgpjyaXwvXlc3ujn58NUvJYACC0/IhsGpkPfgcrJMlLfFXSNZS4SL8saTCV3Fb0My8ws26Eb+Z/r7SxQmYc/M2vHRgSid+re0bDjrGUNsrWV2Jsfma1h7u6SWalxZsKCx3roLUox9B/LWK0BykNI1N6AN8qrG8X2xKdjAvfNvR/pWC5XmkwSP3dXgcagsGjk5D/6AF/kTl5IROWf6v8Ey6cByW+DK5H5t//it3tJjRQEIKBPcSpzFY0ViR5ymlf5t2Ra1WQyR1fvI63myq/rEtrh1t786iMZbD0vWnerIoPkUQfH+2AhMvCUHTlNvV3pP7V0/MTT3khay7g0E8avzGeGo/q+bGsmpseNrHYhRI8GJU6lvrjMK+LBeLQwuatK9lwbKxRIYnqJfEAXyUaD4k+3S4ZnarfzFMlwCHqKnkWWtSjGA9SqZ4gGCC3NLg/1HgjXVjABYslznvwu9vkkw+lvBihsXaBq9mBRnWztxzfz+bwkGzK0t6QHqaGhMdd+r29fEenoaTdlyxmzWZKB+2k4TchrqZlnd9X3OFlEDJwnqyST0n6R3aDldpKjoWw2h73B0hIk1pOymvulVypQtT4KlPOtNxjA== 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)(136003)(396003)(39860400002)(376002)(451199024)(82310400011)(186009)(1800799009)(40470700004)(36840700001)(46966006)(70206006)(70586007)(316002)(478600001)(110136005)(26005)(36860700001)(44832011)(356005)(6666004)(16526019)(40480700001)(82740400003)(81166007)(41300700001)(86362001)(2906002)(8936002)(8676002)(4326008)(1076003)(40460700003)(2616005)(5660300002)(83380400001)(36756003)(336012)(47076005)(426003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 16:18:44.5814 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 35db1d52-4cdd-4029-ca3a-08dba4bdc9ea 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: SN1PEPF000252A0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5428 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 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 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. Fixes: 523847df1b37 ("pds_core: add devcmd device interfaces") Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/net/ethernet/amd/pds_core/dev.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/amd/pds_core/dev.c b/drivers/net/ethernet/amd/pds_core/dev.c index 524f422ee7ac..f77cd9f5a2fd 100644 --- a/drivers/net/ethernet/amd/pds_core/dev.c +++ b/drivers/net/ethernet/amd/pds_core/dev.c @@ -121,7 +121,7 @@ static const char *pdsc_devcmd_str(int opcode) } } -static int pdsc_devcmd_wait(struct pdsc *pdsc, int max_seconds) +static int pdsc_devcmd_wait(struct pdsc *pdsc, u8 opcode, int max_seconds) { struct device *dev = pdsc->dev; unsigned long start_time; @@ -131,9 +131,6 @@ static int pdsc_devcmd_wait(struct pdsc *pdsc, int max_seconds) int done = 0; int err = 0; int status; - int opcode; - - opcode = ioread8(&pdsc->cmd_regs->cmd.opcode); start_time = jiffies; max_wait = start_time + (max_seconds * HZ); @@ -180,7 +177,7 @@ int pdsc_devcmd_locked(struct pdsc *pdsc, union pds_core_dev_cmd *cmd, memcpy_toio(&pdsc->cmd_regs->cmd, cmd, sizeof(*cmd)); pdsc_devcmd_dbell(pdsc); - err = pdsc_devcmd_wait(pdsc, max_seconds); + err = pdsc_devcmd_wait(pdsc, cmd->opcode, max_seconds); memcpy_fromio(comp, &pdsc->cmd_regs->comp, sizeof(*comp)); if ((err == -ENXIO || err == -ETIMEDOUT) && pdsc->wq)