aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ipr.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-10-02 08:39:55 -0400
committerChristoph Hellwig <hch@lst.de>2014-11-12 05:19:39 -0500
commita62182f338b39a22035531c6afc0a8d2928b1df2 (patch)
tree57ca6cea82a09d2655daf5c161024c5015373646 /drivers/scsi/ipr.c
parent1d5203284d8acbdfdf9b478d434450b34f338f28 (diff)
scsi: provide a generic change_queue_type method
Most drivers use exactly the same implementation, so provide it as a library function. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r--drivers/scsi/ipr.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 2a9578c116b7..3d689f6023e9 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -4364,24 +4364,10 @@ static int ipr_change_queue_type(struct scsi_device *sdev, int tag_type)
4364 4364
4365 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); 4365 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
4366 res = (struct ipr_resource_entry *)sdev->hostdata; 4366 res = (struct ipr_resource_entry *)sdev->hostdata;
4367 4367 if (res && ipr_is_gscsi(res))
4368 if (res) { 4368 tag_type = scsi_change_queue_type(sdev, tag_type);
4369 if (ipr_is_gscsi(res) && sdev->tagged_supported) { 4369 else
4370 /*
4371 * We don't bother quiescing the device here since the
4372 * adapter firmware does it for us.
4373 */
4374 scsi_set_tag_type(sdev, tag_type);
4375
4376 if (tag_type)
4377 scsi_activate_tcq(sdev, sdev->queue_depth);
4378 else
4379 scsi_deactivate_tcq(sdev, sdev->queue_depth);
4380 } else
4381 tag_type = 0;
4382 } else
4383 tag_type = 0; 4370 tag_type = 0;
4384
4385 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 4371 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
4386 return tag_type; 4372 return tag_type;
4387} 4373}