diff options
author | Sreekanth Reddy <sreekanth.reddy@avagotech.com> | 2015-11-11 07:00:25 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2015-11-11 18:40:12 -0500 |
commit | 45506049c7abd4c17c35ad43adc07bf1236a3fcf (patch) | |
tree | 756a3087b2a21e9a592a595070d7fc2c02ffce79 | |
parent | 471ef9d4e4982595b2a6081d314a69ca626245ae (diff) |
mpt3sas: Don't send PHYDISK_HIDDEN RAID action request on SAS2 HBAs
Avoid sending PHYDISK_HIDDEN RAID action requests to SAS2 controllers
since they don't support it.
Also enable fast_path only for SAS3 HBAs.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_scsih.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index a638920dbfb3..80469d0a3843 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c | |||
@@ -1165,8 +1165,10 @@ scsih_target_alloc(struct scsi_target *starget) | |||
1165 | if (test_bit(sas_device->handle, ioc->pd_handles)) | 1165 | if (test_bit(sas_device->handle, ioc->pd_handles)) |
1166 | sas_target_priv_data->flags |= | 1166 | sas_target_priv_data->flags |= |
1167 | MPT_TARGET_FLAGS_RAID_COMPONENT; | 1167 | MPT_TARGET_FLAGS_RAID_COMPONENT; |
1168 | #ifndef SCSI_MPT2SAS | ||
1168 | if (sas_device->fast_path) | 1169 | if (sas_device->fast_path) |
1169 | sas_target_priv_data->flags |= MPT_TARGET_FASTPATH_IO; | 1170 | sas_target_priv_data->flags |= MPT_TARGET_FASTPATH_IO; |
1171 | #endif | ||
1170 | } | 1172 | } |
1171 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); | 1173 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); |
1172 | 1174 | ||
@@ -3719,11 +3721,13 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd) | |||
3719 | ioc->build_zero_len_sge(ioc, &mpi_request->SGL); | 3721 | ioc->build_zero_len_sge(ioc, &mpi_request->SGL); |
3720 | 3722 | ||
3721 | if (likely(mpi_request->Function == MPI2_FUNCTION_SCSI_IO_REQUEST)) { | 3723 | if (likely(mpi_request->Function == MPI2_FUNCTION_SCSI_IO_REQUEST)) { |
3724 | #ifndef SCSI_MPT2SAS | ||
3722 | if (sas_target_priv_data->flags & MPT_TARGET_FASTPATH_IO) { | 3725 | if (sas_target_priv_data->flags & MPT_TARGET_FASTPATH_IO) { |
3723 | mpi_request->IoFlags = cpu_to_le16(scmd->cmd_len | | 3726 | mpi_request->IoFlags = cpu_to_le16(scmd->cmd_len | |
3724 | MPI25_SCSIIO_IOFLAGS_FAST_PATH); | 3727 | MPI25_SCSIIO_IOFLAGS_FAST_PATH); |
3725 | mpt3sas_base_put_smid_fast_path(ioc, smid, handle); | 3728 | mpt3sas_base_put_smid_fast_path(ioc, smid, handle); |
3726 | } else | 3729 | } else |
3730 | #endif | ||
3727 | mpt3sas_base_put_smid_scsi_io(ioc, smid, handle); | 3731 | mpt3sas_base_put_smid_scsi_io(ioc, smid, handle); |
3728 | } else | 3732 | } else |
3729 | mpt3sas_base_put_smid_default(ioc, smid); | 3733 | mpt3sas_base_put_smid_default(ioc, smid); |
@@ -5031,8 +5035,10 @@ _scsih_add_device(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 phy_num, | |||
5031 | sas_device->device_info = device_info; | 5035 | sas_device->device_info = device_info; |
5032 | sas_device->sas_address = sas_address; | 5036 | sas_device->sas_address = sas_address; |
5033 | sas_device->phy = sas_device_pg0.PhyNum; | 5037 | sas_device->phy = sas_device_pg0.PhyNum; |
5038 | #ifndef SCSI_MPT2SAS | ||
5034 | sas_device->fast_path = (le16_to_cpu(sas_device_pg0.Flags) & | 5039 | sas_device->fast_path = (le16_to_cpu(sas_device_pg0.Flags) & |
5035 | MPI25_SAS_DEVICE0_FLAGS_FAST_PATH_CAPABLE) ? 1 : 0; | 5040 | MPI25_SAS_DEVICE0_FLAGS_FAST_PATH_CAPABLE) ? 1 : 0; |
5041 | #endif | ||
5036 | 5042 | ||
5037 | if (sas_device_pg0.Flags & MPI2_SAS_DEVICE0_FLAGS_ENCL_LEVEL_VALID) { | 5043 | if (sas_device_pg0.Flags & MPI2_SAS_DEVICE0_FLAGS_ENCL_LEVEL_VALID) { |
5038 | sas_device->enclosure_level = | 5044 | sas_device->enclosure_level = |
@@ -5731,6 +5737,7 @@ _scsih_sas_discovery_event(struct MPT3SAS_ADAPTER *ioc, | |||
5731 | } | 5737 | } |
5732 | } | 5738 | } |
5733 | 5739 | ||
5740 | #ifndef SCSI_MPT2SAS | ||
5734 | /** | 5741 | /** |
5735 | * _scsih_ir_fastpath - turn on fastpath for IR physdisk | 5742 | * _scsih_ir_fastpath - turn on fastpath for IR physdisk |
5736 | * @ioc: per adapter object | 5743 | * @ioc: per adapter object |
@@ -5750,7 +5757,6 @@ _scsih_ir_fastpath(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 phys_disk_num) | |||
5750 | u16 ioc_status; | 5757 | u16 ioc_status; |
5751 | u32 log_info; | 5758 | u32 log_info; |
5752 | 5759 | ||
5753 | |||
5754 | mutex_lock(&ioc->scsih_cmds.mutex); | 5760 | mutex_lock(&ioc->scsih_cmds.mutex); |
5755 | 5761 | ||
5756 | if (ioc->scsih_cmds.status != MPT3_CMD_NOT_USED) { | 5762 | if (ioc->scsih_cmds.status != MPT3_CMD_NOT_USED) { |
@@ -5825,6 +5831,8 @@ _scsih_ir_fastpath(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 phys_disk_num) | |||
5825 | FORCE_BIG_HAMMER); | 5831 | FORCE_BIG_HAMMER); |
5826 | return rc; | 5832 | return rc; |
5827 | } | 5833 | } |
5834 | /* End of not defined SCSI_MPT2SAS */ | ||
5835 | #endif | ||
5828 | 5836 | ||
5829 | /** | 5837 | /** |
5830 | * _scsih_reprobe_lun - reprobing lun | 5838 | * _scsih_reprobe_lun - reprobing lun |
@@ -6017,8 +6025,10 @@ _scsih_sas_pd_hide(struct MPT3SAS_ADAPTER *ioc, | |||
6017 | if (!sas_device) | 6025 | if (!sas_device) |
6018 | return; | 6026 | return; |
6019 | 6027 | ||
6028 | #ifndef SCSI_MPT2SAS | ||
6020 | /* hiding raid component */ | 6029 | /* hiding raid component */ |
6021 | _scsih_ir_fastpath(ioc, handle, element->PhysDiskNum); | 6030 | _scsih_ir_fastpath(ioc, handle, element->PhysDiskNum); |
6031 | #endif | ||
6022 | if (starget) | 6032 | if (starget) |
6023 | starget_for_each_device(starget, (void *)1, _scsih_reprobe_lun); | 6033 | starget_for_each_device(starget, (void *)1, _scsih_reprobe_lun); |
6024 | } | 6034 | } |
@@ -6067,7 +6077,9 @@ _scsih_sas_pd_add(struct MPT3SAS_ADAPTER *ioc, | |||
6067 | sas_device = _scsih_sas_device_find_by_handle(ioc, handle); | 6077 | sas_device = _scsih_sas_device_find_by_handle(ioc, handle); |
6068 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); | 6078 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); |
6069 | if (sas_device) { | 6079 | if (sas_device) { |
6080 | #ifndef SCSI_MPT2SAS | ||
6070 | _scsih_ir_fastpath(ioc, handle, element->PhysDiskNum); | 6081 | _scsih_ir_fastpath(ioc, handle, element->PhysDiskNum); |
6082 | #endif | ||
6071 | return; | 6083 | return; |
6072 | } | 6084 | } |
6073 | 6085 | ||
@@ -6091,7 +6103,9 @@ _scsih_sas_pd_add(struct MPT3SAS_ADAPTER *ioc, | |||
6091 | mpt3sas_transport_update_links(ioc, sas_address, handle, | 6103 | mpt3sas_transport_update_links(ioc, sas_address, handle, |
6092 | sas_device_pg0.PhyNum, MPI2_SAS_NEG_LINK_RATE_1_5); | 6104 | sas_device_pg0.PhyNum, MPI2_SAS_NEG_LINK_RATE_1_5); |
6093 | 6105 | ||
6106 | #ifndef SCSI_MPT2SAS | ||
6094 | _scsih_ir_fastpath(ioc, handle, element->PhysDiskNum); | 6107 | _scsih_ir_fastpath(ioc, handle, element->PhysDiskNum); |
6108 | #endif | ||
6095 | _scsih_add_device(ioc, handle, 0, 1); | 6109 | _scsih_add_device(ioc, handle, 0, 1); |
6096 | } | 6110 | } |
6097 | 6111 | ||
@@ -6202,13 +6216,14 @@ _scsih_sas_ir_config_change_event(struct MPT3SAS_ADAPTER *ioc, | |||
6202 | 6216 | ||
6203 | element = (Mpi2EventIrConfigElement_t *)&event_data->ConfigElement[0]; | 6217 | element = (Mpi2EventIrConfigElement_t *)&event_data->ConfigElement[0]; |
6204 | if (ioc->shost_recovery) { | 6218 | if (ioc->shost_recovery) { |
6205 | 6219 | #ifndef SCSI_MPT2SAS | |
6206 | for (i = 0; i < event_data->NumElements; i++, element++) { | 6220 | for (i = 0; i < event_data->NumElements; i++, element++) { |
6207 | if (element->ReasonCode == MPI2_EVENT_IR_CHANGE_RC_HIDE) | 6221 | if (element->ReasonCode == MPI2_EVENT_IR_CHANGE_RC_HIDE) |
6208 | _scsih_ir_fastpath(ioc, | 6222 | _scsih_ir_fastpath(ioc, |
6209 | le16_to_cpu(element->PhysDiskDevHandle), | 6223 | le16_to_cpu(element->PhysDiskDevHandle), |
6210 | element->PhysDiskNum); | 6224 | element->PhysDiskNum); |
6211 | } | 6225 | } |
6226 | #endif | ||
6212 | return; | 6227 | return; |
6213 | } | 6228 | } |
6214 | for (i = 0; i < event_data->NumElements; i++, element++) { | 6229 | for (i = 0; i < event_data->NumElements; i++, element++) { |