public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Leech <cleech@redhat.com>
To: Mike Christie <michael.christie@oracle.com>,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	mrangankar@marvell.com, njavali@marvell.com,
	GR-QLogic-Storage-Upstream@marvell.com, lduncan@suse.com,
	liuzhengyuang521@gmail.com
Subject: Re: [PATCH 3/6] scsi: iscsi: Remove iscsi_scan_finished.
Date: Mon, 28 Feb 2022 12:07:25 -0800	[thread overview]
Message-ID: <a34c4491-209b-dbe6-53b2-322de090efa6@redhat.com> (raw)
In-Reply-To: <20220226230435.38733-4-michael.christie@oracle.com>

On 2/26/22 3:04 PM, Mike Christie wrote:
> qla4xxx does not use iscsi_scan_finished anymore so remove it.
> 
> Signed-off-by: Mike Christie <michael.christie@oracle.com>
> ---
>  drivers/scsi/scsi_transport_iscsi.c | 39 +++--------------------------
>  include/scsi/scsi_transport_iscsi.h |  2 --
>  2 files changed, 4 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index 732938f5436b..05cd4bca979e 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -1557,7 +1557,6 @@ static int iscsi_setup_host(struct transport_container *tc, struct device *dev,
>  	struct iscsi_cls_host *ihost = shost->shost_data;
>  
>  	memset(ihost, 0, sizeof(*ihost));
> -	atomic_set(&ihost->nr_scans, 0);
>  	mutex_init(&ihost->mutex);
>  
>  	iscsi_bsg_host_add(shost, ihost);
> @@ -1744,25 +1743,6 @@ void iscsi_host_for_each_session(struct Scsi_Host *shost,
>  }
>  EXPORT_SYMBOL_GPL(iscsi_host_for_each_session);
>  
> -/**
> - * iscsi_scan_finished - helper to report when running scans are done
> - * @shost: scsi host
> - * @time: scan run time
> - *
> - * This function can be used by drives like qla4xxx to report to the scsi
> - * layer when the scans it kicked off at module load time are done.
> - */
> -int iscsi_scan_finished(struct Scsi_Host *shost, unsigned long time)
> -{
> -	struct iscsi_cls_host *ihost = shost->shost_data;
> -	/*
> -	 * qla4xxx will have kicked off some session unblocks before calling
> -	 * scsi_scan_host, so just wait for them to complete.
> -	 */
> -	return !atomic_read(&ihost->nr_scans);
> -}
> -EXPORT_SYMBOL_GPL(iscsi_scan_finished);
> -
>  struct iscsi_scan_data {
>  	unsigned int channel;
>  	unsigned int id;
> @@ -1831,8 +1811,6 @@ static void iscsi_scan_session(struct work_struct *work)
>  {
>  	struct iscsi_cls_session *session =
>  			container_of(work, struct iscsi_cls_session, scan_work);
> -	struct Scsi_Host *shost = iscsi_session_to_shost(session);
> -	struct iscsi_cls_host *ihost = shost->shost_data;
>  	struct iscsi_scan_data scan_data;
>  
>  	scan_data.channel = 0;
> @@ -1841,7 +1819,6 @@ static void iscsi_scan_session(struct work_struct *work)
>  	scan_data.rescan = SCSI_SCAN_RESCAN;
>  
>  	iscsi_user_scan_session(&session->dev, &scan_data);
> -	atomic_dec(&ihost->nr_scans);
>  }
>  
>  /**
> @@ -1912,8 +1889,6 @@ static void __iscsi_unblock_session(struct work_struct *work)
>  	struct iscsi_cls_session *session =
>  			container_of(work, struct iscsi_cls_session,
>  				     unblock_work);
> -	struct Scsi_Host *shost = iscsi_session_to_shost(session);
> -	struct iscsi_cls_host *ihost = shost->shost_data;
>  	unsigned long flags;
>  
>  	ISCSI_DBG_TRANS_SESSION(session, "Unblocking session\n");
> @@ -1924,15 +1899,6 @@ static void __iscsi_unblock_session(struct work_struct *work)
>  	spin_unlock_irqrestore(&session->lock, flags);
>  	/* start IO */
>  	scsi_target_unblock(&session->dev, SDEV_RUNNING);
> -	/*
> -	 * Only do kernel scanning if the driver is properly hooked into
> -	 * the async scanning code (drivers like iscsi_tcp do login and
> -	 * scanning from userspace).
> -	 */
> -	if (shost->hostt->scan_finished) {
> -		if (scsi_queue_work(shost, &session->scan_work))
> -			atomic_inc(&ihost->nr_scans);
> -	}
>  	ISCSI_DBG_TRANS_SESSION(session, "Completed unblocking session\n");
>  }
>  
> @@ -2192,7 +2158,10 @@ void iscsi_remove_session(struct iscsi_cls_session *session)
>  	spin_unlock_irqrestore(&session->lock, flags);
>  
>  	scsi_target_unblock(&session->dev, SDEV_TRANSPORT_OFFLINE);
> -	/* flush running scans then delete devices */
> +	/*
> +	 * qla4xxx can perform it's own scans when it runs in kernel only
> +	 * mode. Make sure to flush those scans.
> +	 */
>  	flush_work(&session->scan_work);
>  	/* flush running unbind operations */
>  	flush_work(&session->unbind_work);
> diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
> index c5d7810fd792..90b55db46d7c 100644
> --- a/include/scsi/scsi_transport_iscsi.h
> +++ b/include/scsi/scsi_transport_iscsi.h
> @@ -278,7 +278,6 @@ struct iscsi_cls_session {
>  	iscsi_dev_to_session(_stgt->dev.parent)
>  
>  struct iscsi_cls_host {
> -	atomic_t nr_scans;
>  	struct mutex mutex;
>  	struct request_queue *bsg_q;
>  	uint32_t port_speed;
> @@ -448,7 +447,6 @@ extern void iscsi_get_conn(struct iscsi_cls_conn *conn);
>  extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn);
>  extern void iscsi_unblock_session(struct iscsi_cls_session *session);
>  extern void iscsi_block_session(struct iscsi_cls_session *session);
> -extern int iscsi_scan_finished(struct Scsi_Host *shost, unsigned long time);
>  extern struct iscsi_endpoint *iscsi_create_endpoint(int dd_size);
>  extern void iscsi_destroy_endpoint(struct iscsi_endpoint *ep);
>  extern struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle);

Reviewed-by: Chris Leech <cleech@redhat.com>


  parent reply	other threads:[~2022-02-28 20:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-26 23:04 [PATCH 0/6] iscsi: Speed up failover with lots of devices Mike Christie
2022-02-26 23:04 ` [PATCH 1/6] scsi: iscsi: Fix recovery and ublocking race Mike Christie
2022-02-27 19:49   ` Lee Duncan
2022-02-28 20:06   ` Chris Leech
2022-02-26 23:04 ` [PATCH 2/6] scsi: iscsi: Speed up session unblocking and removal Mike Christie
2022-02-28 16:05   ` Lee Duncan
2022-02-28 20:06   ` Chris Leech
2022-02-26 23:04 ` [PATCH 3/6] scsi: iscsi: Remove iscsi_scan_finished Mike Christie
2022-02-28 18:05   ` Lee Duncan
2022-02-28 20:39     ` Mike Christie
2022-02-28 20:07   ` Chris Leech [this message]
2022-02-26 23:04 ` [PATCH 4/6] scsi: iscsi, ql4: Use per session workqueue for unbinding Mike Christie
2022-02-28 18:19   ` Lee Duncan
2022-02-28 20:07   ` Chris Leech
2022-02-26 23:04 ` [PATCH 5/6] scsi: iscsi: Use the session workqueue for recovery Mike Christie
2022-02-28 20:08   ` Chris Leech
2022-02-28 20:09   ` Lee Duncan
2022-02-26 23:04 ` [PATCH 6/6] scsi: iscsi: Drop temp workq_name Mike Christie
2022-02-28 20:08   ` Chris Leech
2022-02-28 22:49   ` Lee Duncan
2022-02-28 15:53 ` [PATCH 0/6] iscsi: Speed up failover with lots of devices Mike Christie
2022-03-02  4:20 ` Martin K. Petersen
2022-03-09  4:14 ` 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=a34c4491-209b-dbe6-53b2-322de090efa6@redhat.com \
    --to=cleech@redhat.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=lduncan@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=liuzhengyuang521@gmail.com \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=mrangankar@marvell.com \
    --cc=njavali@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox