public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: jsmart2021@gmail.com
To: linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org,
	sagi@grimberg.me, martin.petersen@oracle.com
Cc: James Smart <jsmart2021@gmail.com>,
	Dick Kennedy <dick.kennedy@broadcom.com>,
	James Smart <james.smart@broadcom.com>
Subject: [PATCH-v1 02/22] Fix nvme unregister port timeout.
Date: Wed, 19 Apr 2017 21:46:21 -0700	[thread overview]
Message-ID: <20170420044641.10657-3-jsmart2021@gmail.com> (raw)
In-Reply-To: <20170420044641.10657-1-jsmart2021@gmail.com>

From: James Smart <jsmart2021@gmail.com>

During some link event testing it was observed that the
wait_for_completion_timeout in the lpfc_nvme_unregister_port
was timing out all the time.

The initiator is claiming the nvme_fc_unregister_remoteport upcall is
not completing the unregister in the time allotted.
[ 2186.151317] lpfc 0000:07:00.0: 0:(0):6169 Unreg nvme wait failed 0

 The wait_for_completion_timeout returns 0 when the wait has
been outstanding for the jiffies passed by the caller.  In this error
message, the nvme initiator passed value 5 - meaning 5 jiffies -
and this is just wrong.

Calculate 5 seconds in Jiffies and pass that value
from the current jiffies.

Also the log message for the unregister timeout was reduced
because timeout failure is the same as timeout.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
---
 drivers/scsi/lpfc/lpfc_nvme.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
index 0024de1..a39d72c 100644
--- a/drivers/scsi/lpfc/lpfc_nvme.c
+++ b/drivers/scsi/lpfc/lpfc_nvme.c
@@ -2409,6 +2409,7 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
 	struct lpfc_nvme_lport *lport;
 	struct lpfc_nvme_rport *rport;
 	struct nvme_fc_remote_port *remoteport;
+	unsigned long wait_tmo;
 
 	localport = vport->localport;
 
@@ -2451,11 +2452,12 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
 		 * before proceeding.  This guarantees the transport and driver
 		 * have completed the unreg process.
 		 */
-		ret = wait_for_completion_timeout(&rport->rport_unreg_done, 5);
+		wait_tmo = msecs_to_jiffies(5000);
+		ret = wait_for_completion_timeout(&rport->rport_unreg_done,
+						  wait_tmo);
 		if (ret == 0) {
 			lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_DISC,
-					 "6169 Unreg nvme wait failed %d\n",
-					 ret);
+					 "6169 Unreg nvme wait timeout\n");
 		}
 	}
 	return;
-- 
2.1.0

  parent reply	other threads:[~2017-04-20  4:46 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20  4:46 [PATCH-v1 00/22] lpfc updates for 11.2.0.12 jsmart2021
2017-04-20  4:46 ` [PATCH-v1 01/22] Standardize nvme SGL segment count jsmart2021
2017-04-20  7:15   ` Johannes Thumshirn
2017-04-20  4:46 ` jsmart2021 [this message]
2017-04-20  7:15   ` [PATCH-v1 02/22] Fix nvme unregister port timeout Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 03/22] Fix rejected nvme LS Req jsmart2021
2017-04-20  7:29   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 04/22] Fix log message in completion path jsmart2021
2017-04-20  7:32   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 05/22] Add debug messages for nvme/fcp resource allocation jsmart2021
2017-04-20  7:33   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 06/22] Fix spelling in comments jsmart2021
2017-04-20  7:34   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 07/22] Remove unused defines for NVME PostBuf jsmart2021
2017-04-20  7:34   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 08/22] Remove NULL ptr check before kfree jsmart2021
2017-04-20  7:34   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 09/22] Fix extra line print in rqpair debug print jsmart2021
2017-04-20  7:35   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 10/22] Fix PRLI ACC rsp for NVME jsmart2021
2017-04-20  7:35   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 11/22] Fix driver unload/reload operation jsmart2021
2017-04-20  7:37   ` Johannes Thumshirn
2017-04-20  9:08     ` Junichi Nomura
2017-04-20  4:46 ` [PATCH-v1 12/22] Fix driver usage of 128B WQEs when WQ_CREATE is V1 jsmart2021
2017-04-20  7:37   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 13/22] Fix nvme initiator handling when not enabled jsmart2021
2017-04-20  7:38   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 14/22] Remove hba lock from NVMET issue WQE jsmart2021
2017-04-20  7:40   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 15/22] Fix driver load issues when MRQ=8 jsmart2021
2017-04-20  7:42   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 16/22] Fix crash after issuing lip reset jsmart2021
2017-04-20  7:42   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 17/22] Fix max_sgl_segments settings for NVME / NVMET jsmart2021
2017-04-20  4:46 ` [PATCH-v1 18/22] Add Fabric assigned WWN support jsmart2021
2017-04-20  7:49   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 19/22] Fix implicit logo and RSCN handling for NVMET jsmart2021
2017-04-20  7:53   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 20/22] Update ABORT processing " jsmart2021
2017-04-20  8:10   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 21/22] Fix Express lane queue creation jsmart2021
2017-04-20  8:11   ` Johannes Thumshirn
2017-04-20  4:46 ` [PATCH-v1 22/22] lpfc revison 11.2.0.12 jsmart2021
2017-04-20  8:11   ` Johannes Thumshirn
2017-04-20 18:30 ` [PATCH-v1 00/22] lpfc updates for 11.2.0.12 Jens Axboe
2017-04-20 18:54   ` James Smart
2017-04-21  7:00   ` Johannes Thumshirn
2017-04-21 11:24     ` Martin K. Petersen
2017-04-21 16:41       ` James Smart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170420044641.10657-3-jsmart2021@gmail.com \
    --to=jsmart2021@gmail.com \
    --cc=dick.kennedy@broadcom.com \
    --cc=james.smart@broadcom.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox