aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/device_handler
diff options
context:
space:
mode:
authorMoger, Babu <Babu.Moger@lsi.com>2011-04-08 11:39:30 -0600
committerJames Bottomley <James.Bottomley@suse.de>2011-05-01 10:47:41 -0500
commit3425fbfe2293244abba72c80b215d09ead32d1ad (patch)
treea0d9107f9d4fe3a235ad2cb24decd243114c4e1f /drivers/scsi/device_handler
parent1c3afc423460035a6c2d0e4f01217e953bad3fd7 (diff)
downloadkernel_goldelico_gta04-3425fbfe2293244abba72c80b215d09ead32d1ad.zip
kernel_goldelico_gta04-3425fbfe2293244abba72c80b215d09ead32d1ad.tar.gz
kernel_goldelico_gta04-3425fbfe2293244abba72c80b215d09ead32d1ad.tar.bz2
[SCSI] scsi_dh_rdac : decide whether to send mode select based on operating mode
Based on the operating modes, handler decides whether to send mode select or not. Purpose here is to reduce io-shipping as much as possible whenever there is an option. Signed-off-by: Babu Moger <babu.moger@lsi.com> Reviewed-by: Yanling Qi <yanling.qi@lsi.com> Reviewed-by: Sudhir Dachepalli <Sudhir.Dachepalli@lis.com> Reviewed-by: Somasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com> Reviewed-by: Bob Stankey <Robert.Stankey@lsi.com> Reviewed-by: Vijay Chauhan <Vijay.Chauhan@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/device_handler')
-rw-r--r--drivers/scsi/device_handler/scsi_dh_rdac.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c
index 4efe638..e7fc70d 100644
--- a/drivers/scsi/device_handler/scsi_dh_rdac.c
+++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
@@ -670,12 +670,27 @@ static int rdac_activate(struct scsi_device *sdev,
{
struct rdac_dh_data *h = get_rdac_data(sdev);
int err = SCSI_DH_OK;
+ int act = 0;
err = check_ownership(sdev, h);
if (err != SCSI_DH_OK)
goto done;
- if (h->lun_state == RDAC_LUN_UNOWNED) {
+ switch (h->mode) {
+ case RDAC_MODE:
+ if (h->lun_state == RDAC_LUN_UNOWNED)
+ act = 1;
+ break;
+ case RDAC_MODE_IOSHIP:
+ if ((h->lun_state == RDAC_LUN_UNOWNED) &&
+ (h->preferred == RDAC_PREFERRED))
+ act = 1;
+ break;
+ default:
+ break;
+ }
+
+ if (act) {
err = queue_mode_select(sdev, fn, data);
if (err == SCSI_DH_OK)
return 0;