Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-07-03 12:53:48 +0200
committerJohannes Thumshirn <jthumshirn@suse.de>2018-07-03 12:53:55 +0200
commit473acfa4bb5bbecd0f637db169a76733f5f3e38c (patch)
tree726e39f596bdce4b9bc2bc88d7e4e9450af0a26a
parent7b131debba71a465a878f1c000ab76eb25210382 (diff)
scsi: lpfc: Fix crash in blk_mq layer when executing modprobe
-r lpfc (bsc#1095453).
-rw-r--r--patches.drivers/scsi-lpfc-fix-crash-in-blk_mq-layer-when-executing-modprobe-r-lpfc.patch63
-rw-r--r--series.conf1
2 files changed, 64 insertions, 0 deletions
diff --git a/patches.drivers/scsi-lpfc-fix-crash-in-blk_mq-layer-when-executing-modprobe-r-lpfc.patch b/patches.drivers/scsi-lpfc-fix-crash-in-blk_mq-layer-when-executing-modprobe-r-lpfc.patch
new file mode 100644
index 0000000000..0b9728303e
--- /dev/null
+++ b/patches.drivers/scsi-lpfc-fix-crash-in-blk_mq-layer-when-executing-modprobe-r-lpfc.patch
@@ -0,0 +1,63 @@
+From: James Smart <jsmart2021@gmail.com>
+Date: Thu, 24 May 2018 21:08:59 -0700
+Subject: scsi: lpfc: Fix crash in blk_mq layer when executing modprobe -r lpfc
+Git-commit: 7438273fa23bea6d1e647e66c451570b86e2758b
+Patch-mainline: v4.18-rc1
+References: bsc#1095453
+
+modprobe -r lpfc produces the following:
+
+Call Trace:
+ __blk_mq_run_hw_queue+0xa2/0xb0
+ __blk_mq_delay_run_hw_queue+0x9d/0xb0
+ ? blk_mq_hctx_has_pending+0x32/0x80
+ blk_mq_run_hw_queue+0x50/0xd0
+ blk_mq_sched_insert_request+0x110/0x1b0
+ blk_execute_rq_nowait+0x76/0x180
+ nvme_keep_alive_work+0x8a/0xd0 [nvme_core]
+ process_one_work+0x17f/0x440
+ worker_thread+0x126/0x3c0
+ ? manage_workers.isra.24+0x2a0/0x2a0
+ kthread+0xd1/0xe0
+ ? insert_kthread_work+0x40/0x40
+ ret_from_fork_nospec_begin+0x21/0x21
+ ? insert_kthread_work+0x40/0x40
+
+However, rmmod lpfc would run correctly.
+
+When an nvme remoteport is unregistered with the host nvme transport, it
+needs to set the remoteport->dev_loss_tmo value 0 to indicate an immediate
+termination of device loss and prevent any further keep alives to that
+rport. The driver was never setting dev_loss_tmo causing the nvme
+transport to continue to send the keep alive.
+
+Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
+Signed-off-by: James Smart <james.smart@broadcom.com>
+Reviewed-by: Hannes Reinecke <hare@suse.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ drivers/scsi/lpfc/lpfc_nvme.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
+index 288dd3caff8a..76a5a99605aa 100644
+--- a/drivers/scsi/lpfc/lpfc_nvme.c
++++ b/drivers/scsi/lpfc/lpfc_nvme.c
+@@ -2862,6 +2862,15 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
+ * The transport will update it.
+ */
+ ndlp->upcall_flags |= NLP_WAIT_FOR_UNREG;
++
++ /* Don't let the host nvme transport keep sending keep-alives
++ * on this remoteport. Vport is unloading, no recovery. The
++ * return values is ignored. The upcall is a courtesy to the
++ * transport.
++ */
++ if (vport->load_flag & FC_UNLOADING)
++ (void)nvme_fc_set_remoteport_devloss(remoteport, 0);
++
+ ret = nvme_fc_unregister_remoteport(remoteport);
+ if (ret != 0) {
+ lpfc_nlp_put(ndlp);
+
diff --git a/series.conf b/series.conf
index 986e0c0c70..1c6b781c43 100644
--- a/series.conf
+++ b/series.conf
@@ -18758,6 +18758,7 @@
# bsc#1095453
patches.drivers/scsi-lpfc-correct-oversubscription-of-nvme-io-requests-for-an-adapter.patch
patches.drivers/scsi-lpfc-fix-16gb-hbas-failing-cq-create.patch
+ patches.drivers/scsi-lpfc-fix-crash-in-blk_mq-layer-when-executing-modprobe-r-lpfc.patch
patches.drivers/nvme-remove-nvme_revalidate_ns.patch
patches.drivers/nvme-Fix-setting-logical-block-format-when-revalidat.patch