All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.de>
To: Himanshu Madhani <hmadhani@marvell.com>,
	James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, Quinn Tran <qutran@marvell.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2 04/14] qla2xxx: Optimize NPIV tear down process
Date: Thu, 26 Sep 2019 12:52:02 +0200	[thread overview]
Message-ID: <767fe8f1a50b10d430c30886031251c8f9e4c2dd.camel@suse.de> (raw)
In-Reply-To: <20190912180918.6436-5-hmadhani@marvell.com>

On Thu, 2019-09-12 at 11:09 -0700, Himanshu Madhani wrote:
> From: Quinn Tran <qutran@marvell.com>
> 
> In the case of NPIV port is being torn down, this patch will
> set a flag to indicate VPORT_DELETE. This would prevent relogin
> to be triggered.
> 
> Signed-off-by: Quinn Tran <qutran@marvell.com>
> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
> ---
>  drivers/scsi/qla2xxx/qla_attr.c   |  2 ++
>  drivers/scsi/qla2xxx/qla_def.h    |  1 +
>  drivers/scsi/qla2xxx/qla_gs.c     |  3 ++-
>  drivers/scsi/qla2xxx/qla_mid.c    | 32 ++++++++++++++++++++++-------
> ---
>  drivers/scsi/qla2xxx/qla_os.c     |  7 ++++++-
>  drivers/scsi/qla2xxx/qla_target.c |  1 +
>  6 files changed, 34 insertions(+), 12 deletions(-)
> 
> --- a/drivers/scsi/qla2xxx/qla_mid.c
> +++ b/drivers/scsi/qla2xxx/qla_mid.c
> @@ -66,6 +66,7 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha)
>  	uint16_t vp_id;
>  	struct qla_hw_data *ha = vha->hw;
>  	unsigned long flags = 0;
> +	u8 i;
>  
>  	mutex_lock(&ha->vport_lock);
>  	/*
> @@ -75,8 +76,9 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha)
>  	 * ensures no active vp_list traversal while the vport is
> removed
>  	 * from the queue)
>  	 */
> -	wait_event_timeout(vha->vref_waitq, !atomic_read(&vha-
> >vref_count),
> -	    10*HZ);
> +	for (i = 0; i < 10 && atomic_read(&vha->vref_count); i++)
> +		wait_event_timeout(vha->vref_waitq,
> +		    atomic_read(&vha->vref_count), HZ);

Are you missing a negation in this last line?
Also, what's the point of adding this loop? 


> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -1115,9 +1115,14 @@ static inline int
> test_fcport_count(scsi_qla_host_t *vha)
>  void
>  qla2x00_wait_for_sess_deletion(scsi_qla_host_t *vha)
>  {
> +	u8 i;
> +
>  	qla2x00_mark_all_devices_lost(vha, 0);
>  
> -	wait_event_timeout(vha->fcport_waitQ, test_fcport_count(vha),
> 10*HZ);
> +	for (i = 0; i < 10; i++)
> +		wait_event_timeout(vha->fcport_waitQ,
> test_fcport_count(vha),
> +		    HZ);
> +
>  	flush_workqueue(vha->hw->wq);
>  }

Perhaps here, the loop should be exited if test_fcport_count(vha) gets
TRUE? And again, why is the loop necessary?

Regards
Martin



  reply	other threads:[~2019-09-26 10:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12 18:09 [PATCH v2 00/14] qla2xxx: Bug fixes for the driver Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 01/14] qla2xxx: Silence fwdump template message Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 02/14] qla2xxx: Fix unbound sleep in fcport delete path Himanshu Madhani
2019-09-30 15:54   ` Bart Van Assche
2019-09-12 18:09 ` [PATCH v2 03/14] qla2xxx: Fix stale mem access on driver unload Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 04/14] qla2xxx: Optimize NPIV tear down process Himanshu Madhani
2019-09-26 10:52   ` Martin Wilck [this message]
2019-09-26 16:56     ` [EXT] " Quinn Tran
2019-09-27  6:33       ` Martin Wilck
2019-09-12 18:09 ` [PATCH v2 05/14] qla2xxx: Fix N2N link reset Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 06/14] qla2xxx: Fix N2N link up fail Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 07/14] qla2xxx: Fix Nport ID display value Himanshu Madhani
2019-09-13 22:32   ` Roman Bolshakov
2019-09-12 18:09 ` [PATCH v2 08/14] qla2xxx: Dual FCP-NVMe target port support Himanshu Madhani
2019-10-10  2:27   ` Martin K. Petersen
2019-09-12 18:09 ` [PATCH v2 09/14] qla2xxx: Add error handling for PLOGI ELS passthrough Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 10/14] qla2xxx: Set remove flag for all VP Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 11/14] qla2xxx: Check for MB timeout while capturing ISP27/28xx FW dump Himanshu Madhani
2019-09-12 20:22   ` Laurence Oberman
2019-09-12 18:09 ` [PATCH v2 12/14] qla2xxx: Capture FW dump on MPI heartbeat stop event Himanshu Madhani
2019-09-12 20:22   ` Laurence Oberman
2019-09-12 18:09 ` [PATCH v2 13/14] qla2xxx: Improve logging for scan thread Himanshu Madhani
2019-09-12 18:09 ` [PATCH v2 14/14] qla2xxx: Update driver version to 10.01.00.20-k Himanshu Madhani
2019-09-24  3:13 ` [PATCH v2 00/14] qla2xxx: Bug fixes for the driver Martin K. Petersen

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=767fe8f1a50b10d430c30886031251c8f9e4c2dd.camel@suse.de \
    --to=mwilck@suse.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=hmadhani@marvell.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=qutran@marvell.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.