aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2009-10-15 20:46:39 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:00:41 -0500
commite881a172dac4d9ea3b2a1540041d872963c269bd (patch)
tree9eb1f344b107806c0041c4e0a64192a055117289 /drivers/scsi/mpt2sas
parentdbf9bfe615717d1145f263c0049fe2328e6ed395 (diff)
[SCSI] modify change_queue_depth to take in reason why it is being called
This patch modifies scsi_host_template->change_queue_depth so that it takes an argument indicating why it is being called. This will be used so that if a LLD needs to do some extra processing when handling queue fulls or later ramp ups, it can do so. This is a simple port of the drivers setting a change_queue_depth callback. In the patch I just have these LLDs adjust the queue depth if the user was requesting it. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> [Vasu.Dev: v2 Also converted pmcraid_change_queue_depth and then verified all modules compile using "make allmodconfig" for any new build warnings on X86_64. Updated original description after combing two original patches from Mike to make this patch git bisectable.] Signed-off-by: Vasu Dev <vasu.dev@intel.com> [jejb: fixed up 53c700] Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 8dc682f00fd2..55ee014a7e08 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -1099,11 +1099,12 @@ _scsih_build_scatter_gather(struct MPT2SAS_ADAPTER *ioc,
1099 * _scsih_change_queue_depth - setting device queue depth 1099 * _scsih_change_queue_depth - setting device queue depth
1100 * @sdev: scsi device struct 1100 * @sdev: scsi device struct
1101 * @qdepth: requested queue depth 1101 * @qdepth: requested queue depth
1102 * @reason: calling context
1102 * 1103 *
1103 * Returns queue depth. 1104 * Returns queue depth.
1104 */ 1105 */
1105static int 1106static int
1106_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth) 1107_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
1107{ 1108{
1108 struct Scsi_Host *shost = sdev->host; 1109 struct Scsi_Host *shost = sdev->host;
1109 int max_depth; 1110 int max_depth;
@@ -1114,6 +1115,9 @@ _scsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
1114 struct _sas_device *sas_device; 1115 struct _sas_device *sas_device;
1115 unsigned long flags; 1116 unsigned long flags;
1116 1117
1118 if (reason != SCSI_QDEPTH_DEFAULT)
1119 return -EOPNOTSUPP;
1120
1117 max_depth = shost->can_queue; 1121 max_depth = shost->can_queue;
1118 1122
1119 /* limit max device queue for SATA to 32 */ 1123 /* limit max device queue for SATA to 32 */
@@ -1569,7 +1573,7 @@ _scsih_slave_configure(struct scsi_device *sdev)
1569 r_level, raid_device->handle, 1573 r_level, raid_device->handle,
1570 (unsigned long long)raid_device->wwid, 1574 (unsigned long long)raid_device->wwid,
1571 raid_device->num_pds, ds); 1575 raid_device->num_pds, ds);
1572 _scsih_change_queue_depth(sdev, qdepth); 1576 _scsih_change_queue_depth(sdev, qdepth, SCSI_QDEPTH_DEFAULT);
1573 return 0; 1577 return 0;
1574 } 1578 }
1575 1579
@@ -1615,7 +1619,7 @@ _scsih_slave_configure(struct scsi_device *sdev)
1615 _scsih_display_sata_capabilities(ioc, sas_device, sdev); 1619 _scsih_display_sata_capabilities(ioc, sas_device, sdev);
1616 } 1620 }
1617 1621
1618 _scsih_change_queue_depth(sdev, qdepth); 1622 _scsih_change_queue_depth(sdev, qdepth, SCSI_QDEPTH_DEFAULT);
1619 1623
1620 if (ssp_target) 1624 if (ssp_target)
1621 sas_read_port_mode_page(sdev); 1625 sas_read_port_mode_page(sdev);