]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
scsi: lpfc: Correct localport timeout duration error
authorJames Smart <jsmart2021@gmail.com>
Tue, 12 Mar 2019 23:30:16 +0000 (16:30 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 13 Nov 2019 23:47:34 +0000 (18:47 -0500)
BugLink: https://bugs.launchpad.net/bugs/1852492
[ Upstream commit 2a0fb340fcc816975b8b0f2fef913d11999c39cf ]

Current code incorrectly specifies a completion wait timeout duration in 5
jiffies, when it should have been 5 seconds.

Fix the adjust for units for the completion timeout call.

[mkp: manual merge]

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/scsi/lpfc/lpfc_nvmet.c
drivers/scsi/lpfc/lpfc_nvmet.h

index 39e13fe7a72d6a57d540a59cdaabe7b73c9c3fba..8752960e1da35127381891fbfedea67509dbf89c 100644 (file)
@@ -1576,7 +1576,11 @@ lpfc_nvmet_destroy_targetport(struct lpfc_hba *phba)
                }
                tgtp->tport_unreg_cmp = &tport_unreg_cmp;
                nvmet_fc_unregister_targetport(phba->targetport);
-               wait_for_completion_timeout(&tport_unreg_cmp, 5);
+               if (!wait_for_completion_timeout(tgtp->tport_unreg_cmp,
+                                       msecs_to_jiffies(LPFC_NVMET_WAIT_TMO)))
+                       lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
+                                       "6179 Unreg targetport %p timeout "
+                                       "reached.\n", phba->targetport);
                lpfc_nvmet_cleanup_io_context(phba);
        }
        phba->targetport = NULL;
index f7b8d8b716db663600f8d8e42ab909a21bdd384e..94f66bfddf6024bb07496fcd3a89518346024208 100644 (file)
@@ -29,6 +29,8 @@
 #define LPFC_NVMET_MRQ_AUTO            0
 #define LPFC_NVMET_MRQ_MAX             16
 
+#define LPFC_NVMET_WAIT_TMO            (5 * MSEC_PER_SEC)
+
 /* Used for NVME Target */
 struct lpfc_nvmet_tgtport {
        struct lpfc_hba *phba;