All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>, linux-scsi@vger.kernel.org
Cc: Bart Van Assche <bvanassche@acm.org>
Subject: Re: [PATCH 1/6] scsi: don't use scsi_next_command in scsi_reset_provider
Date: Thu, 06 Nov 2014 09:18:03 +0100	[thread overview]
Message-ID: <545B2EBB.2010801@suse.de> (raw)
In-Reply-To: <1415259630-20784-2-git-send-email-hch@lst.de>

On 11/06/2014 08:40 AM, Christoph Hellwig wrote:
> scsi_reset_provider already manually runs all queues for the given host,
> so it doesn't need the scsi_run_queues call from it, and it doesn't need
> a reference on the device because it's synchronous.
> 
> So let's just call scsi_put_command directly and avoid the device reference
> dance to simplify the code.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/scsi/scsi_error.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index ba19687..a1ffdb0 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -2335,14 +2335,9 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg)
>  		return -EIO;
>  
>  	error = -EIO;
> -	if (!get_device(&dev->sdev_gendev))
> -		goto out_put_autopm_host;
> -
>  	scmd = scsi_get_command(dev, GFP_KERNEL);
> -	if (!scmd) {
> -		put_device(&dev->sdev_gendev);
> +	if (!scmd)
>  		goto out_put_autopm_host;
> -	}
>  
>  	blk_rq_init(NULL, &req);
>  	scmd->request = &req;
> @@ -2404,10 +2399,10 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg)
>  			     "waking up host to restart after TMF\n"));
>  
>  	wake_up(&shost->host_wait);
> -
>  	scsi_run_host_queues(shost);
>  
> -	scsi_next_command(scmd);
> +	scsi_put_command(scmd);
> +
>  out_put_autopm_host:
>  	scsi_autopm_put_host(shost);
>  	return error;
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-11-06  8:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06  7:40 I/O path cleanup V2 Christoph Hellwig
2014-11-06  7:40 ` [PATCH 1/6] scsi: don't use scsi_next_command in scsi_reset_provider Christoph Hellwig
2014-11-06  8:18   ` Hannes Reinecke [this message]
2014-11-06  7:40 ` [PATCH 2/6] scsi: remove scsi_next_command Christoph Hellwig
2014-11-06  8:21   ` Hannes Reinecke
2014-11-06 15:34     ` Christoph Hellwig
2014-11-11 16:37       ` Christoph Hellwig
2014-11-11 19:02         ` Hannes Reinecke
2014-11-06  7:40 ` [PATCH 3/6] scsi: clean up S/G table freeing Christoph Hellwig
2014-11-06  8:23   ` Hannes Reinecke
2014-11-18 18:14   ` Bart Van Assche
2014-11-20  8:16     ` Christoph Hellwig
2014-11-06  7:40 ` [PATCH 4/6] scsi: stop passing a gfp_mask argument down the command setup path Christoph Hellwig
2014-11-06  8:24   ` Hannes Reinecke
2014-11-06  7:40 ` [PATCH 5/6] scsi: move scsi_dispatch_cmd to scsi_lib.c Christoph Hellwig
2014-11-06  8:25   ` Hannes Reinecke
2014-11-06  7:40 ` [PATCH 6/6] scsi: move more requeue handling into scsi_requeue_command Christoph Hellwig
2014-11-06  8:26   ` Hannes Reinecke

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=545B2EBB.2010801@suse.de \
    --to=hare@suse.de \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --cc=linux-scsi@vger.kernel.org \
    /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.