linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Christoph Hellwig <hch@lst.de>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/8] scsi: don't use scsi_next_command in scsi_reset_provider
Date: Wed, 01 Oct 2014 14:03:45 +0200	[thread overview]
Message-ID: <542BEDA1.3070003@acm.org> (raw)
In-Reply-To: <1410107469-896-2-git-send-email-hch@lst.de>

On 09/07/14 18:31, 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>
> ---
>   drivers/scsi/scsi_error.c | 9 +--------
>   1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index 6b20ef3..14cece9 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -2317,15 +2317,9 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
>   	if (scsi_autopm_get_host(shost) < 0)
>   		return FAILED;
>
> -	if (!get_device(&dev->sdev_gendev)) {
> -		rtn = FAILED;
> -		goto out_put_autopm_host;
> -	}
> -
>   	scmd = scsi_get_command(dev, GFP_KERNEL);
>   	if (!scmd) {
>   		rtn = FAILED;
> -		put_device(&dev->sdev_gendev);
>   		goto out_put_autopm_host;
>   	}
>
> @@ -2381,10 +2375,9 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
>   			     "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 rtn;

This patch looks fine to me.

A minor nit: if this patch has to be resent, please insert a blank line 
above the out_put_autopm_host label.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

  reply	other threads:[~2014-10-01 12:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-07 16:31 I/O path cleanup Christoph Hellwig
2014-09-07 16:31 ` [PATCH 1/8] scsi: don't use scsi_next_command in scsi_reset_provider Christoph Hellwig
2014-10-01 12:03   ` Bart Van Assche [this message]
2014-09-07 16:31 ` [PATCH 2/8] scsi: remove scsi_next_command Christoph Hellwig
2014-10-01 12:06   ` Bart Van Assche
2014-09-07 16:31 ` [PATCH 3/8] scsi: clean up S/G table freeing Christoph Hellwig
2014-10-01 12:22   ` Bart Van Assche
2014-10-01 21:05     ` Christoph Hellwig
2014-09-07 16:31 ` [PATCH 4/8] scsi: stop passing a gfp_mask argument down the command setup path Christoph Hellwig
2014-10-01 12:28   ` Bart Van Assche
2014-09-07 16:31 ` [PATCH 5/8] scsi: move scsi_dispatch_cmd to scsi_lib.c Christoph Hellwig
2014-10-01 12:30   ` Bart Van Assche
2014-09-07 16:31 ` [PATCH 6/8] scsi: move more requeue handling into scsi_requeue_command Christoph Hellwig
2014-10-01 12:33   ` Bart Van Assche
2014-09-07 16:31 ` [PATCH 7/8] scsi: split error handling slow path out of scsi_io_completion Christoph Hellwig
2014-10-01 12:46   ` Bart Van Assche
2014-09-07 16:31 ` [PATCH 8/8] scsi: merge scsi_finish_command and scsi_io_completion Christoph Hellwig
2014-10-01 12:55   ` Bart Van Assche
2014-09-08  7:22 ` I/O path cleanup Bart Van Assche
2014-09-08 15:13   ` Christoph Hellwig
2014-09-30 13:31     ` Bart Van Assche
2014-09-30 13:43       ` Christoph Hellwig

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=542BEDA1.3070003@acm.org \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).