diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2009-10-15 20:46:39 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:00:41 -0500 |
commit | e881a172dac4d9ea3b2a1540041d872963c269bd (patch) | |
tree | 9eb1f344b107806c0041c4e0a64192a055117289 /drivers/message | |
parent | dbf9bfe615717d1145f263c0049fe2328e6ed395 (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/message')
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 9 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.h | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index f68ec48a881e..57752751712b 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -2351,11 +2351,12 @@ mptscsih_slave_destroy(struct scsi_device *sdev) | |||
2351 | * mptscsih_change_queue_depth - This function will set a devices queue depth | 2351 | * mptscsih_change_queue_depth - This function will set a devices queue depth |
2352 | * @sdev: per scsi_device pointer | 2352 | * @sdev: per scsi_device pointer |
2353 | * @qdepth: requested queue depth | 2353 | * @qdepth: requested queue depth |
2354 | * @reason: calling context | ||
2354 | * | 2355 | * |
2355 | * Adding support for new 'change_queue_depth' api. | 2356 | * Adding support for new 'change_queue_depth' api. |
2356 | */ | 2357 | */ |
2357 | int | 2358 | int |
2358 | mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth) | 2359 | mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason) |
2359 | { | 2360 | { |
2360 | MPT_SCSI_HOST *hd = shost_priv(sdev->host); | 2361 | MPT_SCSI_HOST *hd = shost_priv(sdev->host); |
2361 | VirtTarget *vtarget; | 2362 | VirtTarget *vtarget; |
@@ -2367,6 +2368,9 @@ mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth) | |||
2367 | starget = scsi_target(sdev); | 2368 | starget = scsi_target(sdev); |
2368 | vtarget = starget->hostdata; | 2369 | vtarget = starget->hostdata; |
2369 | 2370 | ||
2371 | if (reason != SCSI_QDEPTH_DEFAULT) | ||
2372 | return -EOPNOTSUPP; | ||
2373 | |||
2370 | if (ioc->bus_type == SPI) { | 2374 | if (ioc->bus_type == SPI) { |
2371 | if (!(vtarget->tflags & MPT_TARGET_FLAGS_Q_YES)) | 2375 | if (!(vtarget->tflags & MPT_TARGET_FLAGS_Q_YES)) |
2372 | max_depth = 1; | 2376 | max_depth = 1; |
@@ -2433,7 +2437,8 @@ mptscsih_slave_configure(struct scsi_device *sdev) | |||
2433 | ioc->name, vtarget->negoFlags, vtarget->maxOffset, | 2437 | ioc->name, vtarget->negoFlags, vtarget->maxOffset, |
2434 | vtarget->minSyncFactor)); | 2438 | vtarget->minSyncFactor)); |
2435 | 2439 | ||
2436 | mptscsih_change_queue_depth(sdev, MPT_SCSI_CMD_PER_DEV_HIGH); | 2440 | mptscsih_change_queue_depth(sdev, MPT_SCSI_CMD_PER_DEV_HIGH, |
2441 | SCSI_QDEPTH_DEFAULT); | ||
2437 | dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 2442 | dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
2438 | "tagged %d, simple %d, ordered %d\n", | 2443 | "tagged %d, simple %d, ordered %d\n", |
2439 | ioc->name,sdev->tagged_supported, sdev->simple_tags, | 2444 | ioc->name,sdev->tagged_supported, sdev->simple_tags, |
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h index e0b33e04a33b..45a5ff3eff61 100644 --- a/drivers/message/fusion/mptscsih.h +++ b/drivers/message/fusion/mptscsih.h | |||
@@ -128,7 +128,8 @@ extern int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_F | |||
128 | extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); | 128 | extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); |
129 | extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); | 129 | extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); |
130 | extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); | 130 | extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); |
131 | extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth); | 131 | extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth, |
132 | int reason); | ||
132 | extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id); | 133 | extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id); |
133 | extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id); | 134 | extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id); |
134 | extern struct device_attribute *mptscsih_host_attrs[]; | 135 | extern struct device_attribute *mptscsih_host_attrs[]; |