]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pds_core: no health reporter in VF
authorShannon Nelson <shannon.nelson@amd.com>
Thu, 24 Aug 2023 16:17:51 +0000 (09:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:08 +0000 (09:48 +0200)
[ Upstream commit e48b894a1db7f6ce66bff0402ab21ff9f0e56034 ]

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 <shannon.nelson@amd.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20230824161754.34264-3-shannon.nelson@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/amd/pds_core/core.c

index 483a070d96fa9c23f8a2986f9a4597b92b0a9eac..2a315f2da37d7eb68e6e53f0288907393ca1ee36 100644 (file)
@@ -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;