public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: "James E.J. Bottomley" <JBottomley@odin.com>
Cc: KY Srinivasan <kys@microsoft.com>,
	"linux-scsi\@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"devel\@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Long Li <longli@microsoft.com>
Subject: Re: [PATCH] scsi: storvsc: use shost_for_each_device() instead of open coding
Date: Thu, 13 Aug 2015 10:53:00 +0200	[thread overview]
Message-ID: <87wpwzefir.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <BLUPR03MB407E00F2C97FE0104AC9D7ACE960@BLUPR03MB407.namprd03.prod.outlook.com> (Long Li's message of "Fri, 3 Jul 2015 19:44:16 +0000")

Long Li <longli@microsoft.com> writes:

>> -----Original Message-----
>> From: KY Srinivasan
>> Sent: Friday, July 03, 2015 11:35 AM
>> To: Vitaly Kuznetsov; linux-scsi@vger.kernel.org
>> Cc: Long Li; Haiyang Zhang; James E.J. Bottomley; devel@linuxdriverproject.org;
>> linux-kernel@vger.kernel.org
>> Subject: RE: [PATCH] scsi: storvsc: use shost_for_each_device() instead of open
>> coding
>> 
>> 
>> 
>> > -----Original Message-----
>> > From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
>> > Sent: Wednesday, July 1, 2015 2:31 AM
>> > To: linux-scsi@vger.kernel.org
>> > Cc: Long Li; KY Srinivasan; Haiyang Zhang; James E.J. Bottomley;
>> > devel@linuxdriverproject.org; linux-kernel@vger.kernel.org
>> > Subject: [PATCH] scsi: storvsc: use shost_for_each_device() instead of
>> > open coding
>> >
>> > Comment in struct Scsi_Host says that drivers are not supposed to
>> > access __devices directly. storvsc_host_scan() doesn't happen in irq
>> > context so we can just use shost_for_each_device().
>> >
>> > Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> 
>> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> Reviewed-by: Long Li <longli@microsoft.com>

Sorry for the ping but it seems the fix never made it to scsi tree...

>> > ---
>> >  drivers/scsi/storvsc_drv.c | 9 +--------
>> >  1 file changed, 1 insertion(+), 8 deletions(-)
>> >
>> > diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
>> > index 3c6584f..9ea912b 100644
>> > --- a/drivers/scsi/storvsc_drv.c
>> > +++ b/drivers/scsi/storvsc_drv.c
>> > @@ -426,7 +426,6 @@ static void storvsc_host_scan(struct work_struct
>> > *work)
>> >  	struct storvsc_scan_work *wrk;
>> >  	struct Scsi_Host *host;
>> >  	struct scsi_device *sdev;
>> > -	unsigned long flags;
>> >
>> >  	wrk = container_of(work, struct storvsc_scan_work, work);
>> >  	host = wrk->host;
>> > @@ -443,14 +442,8 @@ static void storvsc_host_scan(struct work_struct
>> > *work)
>> >  	 * may have been removed this way.
>> >  	 */
>> >  	mutex_lock(&host->scan_mutex);
>> > -	spin_lock_irqsave(host->host_lock, flags);
>> > -	list_for_each_entry(sdev, &host->__devices, siblings) {
>> > -		spin_unlock_irqrestore(host->host_lock, flags);
>> > +	shost_for_each_device(sdev, host)
>> >  		scsi_test_unit_ready(sdev, 1, 1, NULL);
>> > -		spin_lock_irqsave(host->host_lock, flags);
>> > -		continue;
>> > -	}
>> > -	spin_unlock_irqrestore(host->host_lock, flags);
>> >  	mutex_unlock(&host->scan_mutex);
>> >  	/*
>> >  	 * Now scan the host to discover LUNs that may have been added.
>> > --
>> > 2.4.3

-- 
  Vitaly

      reply	other threads:[~2015-08-13  8:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01  9:31 [PATCH] scsi: storvsc: use shost_for_each_device() instead of open coding Vitaly Kuznetsov
2015-07-03 18:34 ` KY Srinivasan
2015-07-03 19:44   ` Long Li
2015-08-13  8:53     ` Vitaly Kuznetsov [this message]

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=87wpwzefir.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=JBottomley@odin.com \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=longli@microsoft.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