diff options
author | Sumit Saxena <sumit.saxena@avagotech.com> | 2015-11-05 18:47:37 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2015-11-09 19:06:12 +0300 |
commit | aed335eecf8f09c28588b01c7f7e24ee78156e28 (patch) | |
tree | d4ed8436b5800f0acc7c8060c0eac6a846c73cd4 /drivers/scsi/megaraid | |
parent | f3951a3709ff50990bf3e188c27d346792103432 (diff) | |
download | linux-aed335eecf8f09c28588b01c7f7e24ee78156e28.tar.xz |
megaraid_sas: Make tape drives visible on PERC5 controllers
The DELL PERC5 controller firmware does not list tape drives in response
to MR_DCMD_PD_LIST_QUERY. This causes tape drives not be exposed to the
OS when connected to a PERC5 controller.
This patch permits detection of tape drives connected to a PERC5
controller by exposing non-TYPE_DISK devices unconditionally.
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.h | 1 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 20 |
2 files changed, 18 insertions, 3 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 97b0c8f343f1..c0f7c8ce54aa 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -1790,6 +1790,7 @@ struct megasas_instance { u8 UnevenSpanSupport; u8 supportmax256vd; + u8 allow_fw_scan; u16 fw_supported_vd_count; u16 fw_supported_pd_count; diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index cc953725d9be..6efab726edbf 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -1760,6 +1760,20 @@ static void megasas_set_dma_alignment(struct scsi_device *sdev) static int megasas_slave_configure(struct scsi_device *sdev) { + u16 pd_index = 0; + struct megasas_instance *instance; + + instance = megasas_lookup_instance(sdev->host->host_no); + if (instance->allow_fw_scan) { + if (sdev->channel < MEGASAS_MAX_PD_CHANNELS && + sdev->type == TYPE_DISK) { + pd_index = (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) + + sdev->id; + if (instance->pd_list[pd_index].driveState != + MR_PD_STATE_SYSTEM) + return -ENXIO; + } + } megasas_set_dma_alignment(sdev); /* * The RAID firmware may require extended timeouts. @@ -1783,9 +1797,8 @@ static int megasas_slave_alloc(struct scsi_device *sdev) pd_index = (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) + sdev->id; - if ((instance->pd_list[pd_index].driveState == - MR_PD_STATE_SYSTEM) || - (instance->pd_list[pd_index].driveType != TYPE_DISK)) { + if ((instance->allow_fw_scan || instance->pd_list[pd_index].driveState == + MR_PD_STATE_SYSTEM)) { return 0; } return -ENXIO; @@ -4699,6 +4712,7 @@ static int megasas_init_fw(struct megasas_instance *instance) case PCI_DEVICE_ID_DELL_PERC5: default: instance->instancet = &megasas_instance_template_xscale; + instance->allow_fw_scan = 1; break; } |