summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorCoiby Xu <coiby.xu@gmail.com>2021-01-23 18:46:10 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-29 16:54:20 +0100
commit2352cf40fb7c8c1407534767551f9ead6a736f20 (patch)
treeeb98534f4e13d34b2d7dadae4f52a920484ee033 /drivers
parent1053c27804dfad0eb247ab3c16d5f61d9aba5562 (diff)
downloadlinux-stable-2352cf40fb7c8c1407534767551f9ead6a736f20.tar.gz
linux-stable-2352cf40fb7c8c1407534767551f9ead6a736f20.tar.bz2
linux-stable-2352cf40fb7c8c1407534767551f9ead6a736f20.zip
staging: qlge: support force_coredump option for devlink health dump
With force_coredump module parameter set, devlink health dump will reset the MPI RISC first which takes 5 secs to be finished. Note that only NIC function that owns the firmware can do the force_dumping. Otherwise devlink will receive an EPERM error. Signed-off-by: Coiby Xu <coiby.xu@gmail.com> Link: https://lore.kernel.org/r/20210123104613.38359-6-coiby.xu@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/qlge/qlge_devlink.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/staging/qlge/qlge_devlink.c b/drivers/staging/qlge/qlge_devlink.c
index bf7d75ed5eae..c6ef5163e241 100644
--- a/drivers/staging/qlge/qlge_devlink.c
+++ b/drivers/staging/qlge/qlge_devlink.c
@@ -56,10 +56,23 @@ static int qlge_reporter_coredump(struct devlink_health_reporter *reporter,
struct qlge_adapter *qdev = devlink_health_reporter_priv(reporter);
struct qlge_mpi_coredump *dump;
+ wait_queue_head_t wait;
if (!netif_running(qdev->ndev))
return 0;
+ if (test_bit(QL_FRC_COREDUMP, &qdev->flags)) {
+ if (qlge_own_firmware(qdev)) {
+ qlge_queue_fw_error(qdev);
+ init_waitqueue_head(&wait);
+ wait_event_timeout(wait, 0, 5 * HZ);
+ } else {
+ netif_err(qdev, ifup, qdev->ndev,
+ "Force Coredump failed because this NIC function doesn't own the firmware\n");
+ return -EPERM;
+ }
+ }
+
dump = kvmalloc(sizeof(*dump), GFP_KERNEL);
if (!dump)
return -ENOMEM;