diff options
author | Christoph Hellwig <hch@lst.de> | 2014-09-05 21:00:05 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-24 13:56:40 -0500 |
commit | 0f121dd85dc2128fe989da9f57dee764284689f6 (patch) | |
tree | 40c2d00ef94a0ab475fc90053517f045e9221ab5 /drivers/scsi/scsi_error.c | |
parent | d7cb71ec3a28e525c4f523ca52d5389407b7aea0 (diff) |
scsi: don't use scsi_next_command in scsi_reset_provider
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>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index a6f6b9222b51..96627bae753c 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -2337,14 +2337,9 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg) | |||
2337 | return -EIO; | 2337 | return -EIO; |
2338 | 2338 | ||
2339 | error = -EIO; | 2339 | error = -EIO; |
2340 | if (!get_device(&dev->sdev_gendev)) | ||
2341 | goto out_put_autopm_host; | ||
2342 | |||
2343 | scmd = scsi_get_command(dev, GFP_KERNEL); | 2340 | scmd = scsi_get_command(dev, GFP_KERNEL); |
2344 | if (!scmd) { | 2341 | if (!scmd) |
2345 | put_device(&dev->sdev_gendev); | ||
2346 | goto out_put_autopm_host; | 2342 | goto out_put_autopm_host; |
2347 | } | ||
2348 | 2343 | ||
2349 | blk_rq_init(NULL, &req); | 2344 | blk_rq_init(NULL, &req); |
2350 | scmd->request = &req; | 2345 | scmd->request = &req; |
@@ -2406,10 +2401,10 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg) | |||
2406 | "waking up host to restart after TMF\n")); | 2401 | "waking up host to restart after TMF\n")); |
2407 | 2402 | ||
2408 | wake_up(&shost->host_wait); | 2403 | wake_up(&shost->host_wait); |
2409 | |||
2410 | scsi_run_host_queues(shost); | 2404 | scsi_run_host_queues(shost); |
2411 | 2405 | ||
2412 | scsi_next_command(scmd); | 2406 | scsi_put_command(scmd); |
2407 | |||
2413 | out_put_autopm_host: | 2408 | out_put_autopm_host: |
2414 | scsi_autopm_put_host(shost); | 2409 | scsi_autopm_put_host(shost); |
2415 | return error; | 2410 | return error; |