aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2010-06-17 05:10:10 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:02:32 -0400
commit51106ab5306b752cd53d40626f78774276bb1368 (patch)
tree0e8a12734f5c75b1478fd7bbc49193dec36a1517 /drivers/message/fusion
parentaca794ddd688f1bbb7551f569b0620255c052d80 (diff)
[SCSI] mptfusion: Added sanity to check B_T mapping for device before adding to OS
Added sanity check before treating any device is a valid device. It is possible that firmware can have device page0 in its table, but that devicemay not be available in topology. Device will be available in topology only if there is Bus Target mapping is done in firmware. Driver will always check B_T mapping of firmware before reporting device to upper layer. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/message/fusion')
-rw-r--r--drivers/message/fusion/mptsas.c37
-rw-r--r--drivers/message/fusion/mptsas.h1
2 files changed, 38 insertions, 0 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 1caf03ea8557..8963f5c44c23 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -2549,6 +2549,7 @@ mptsas_sas_device_pg0(MPT_ADAPTER *ioc, struct mptsas_devinfo *device_info,
2549 device_info->sas_address = le64_to_cpu(sas_address); 2549 device_info->sas_address = le64_to_cpu(sas_address);
2550 device_info->device_info = 2550 device_info->device_info =
2551 le32_to_cpu(buffer->DeviceInfo); 2551 le32_to_cpu(buffer->DeviceInfo);
2552 device_info->flags = le16_to_cpu(buffer->Flags);
2552 2553
2553 out_free_consistent: 2554 out_free_consistent:
2554 pci_free_consistent(ioc->pcidev, hdr.ExtPageLength * 4, 2555 pci_free_consistent(ioc->pcidev, hdr.ExtPageLength * 4,
@@ -3840,6 +3841,13 @@ mptsas_probe_devices(MPT_ADAPTER *ioc)
3840 MPI_SAS_DEVICE_INFO_SATA_DEVICE)) == 0) 3841 MPI_SAS_DEVICE_INFO_SATA_DEVICE)) == 0)
3841 continue; 3842 continue;
3842 3843
3844 /* If there is no FW B_T mapping for this device then continue
3845 * */
3846 if (!(sas_device.flags & MPI_SAS_DEVICE0_FLAGS_DEVICE_PRESENT)
3847 || !(sas_device.flags &
3848 MPI_SAS_DEVICE0_FLAGS_DEVICE_MAPPED))
3849 continue;
3850
3843 phy_info = mptsas_refreshing_device_handles(ioc, &sas_device); 3851 phy_info = mptsas_refreshing_device_handles(ioc, &sas_device);
3844 if (!phy_info) 3852 if (!phy_info)
3845 continue; 3853 continue;
@@ -4149,6 +4157,14 @@ mptsas_adding_inactive_raid_components(MPT_ADAPTER *ioc, u8 channel, u8 id)
4149 phys_disk.PhysDiskID)) 4157 phys_disk.PhysDiskID))
4150 continue; 4158 continue;
4151 4159
4160 /* If there is no FW B_T mapping for this device then continue
4161 * */
4162 if (!(sas_device.flags & MPI_SAS_DEVICE0_FLAGS_DEVICE_PRESENT)
4163 || !(sas_device.flags &
4164 MPI_SAS_DEVICE0_FLAGS_DEVICE_MAPPED))
4165 continue;
4166
4167
4152 phy_info = mptsas_find_phyinfo_by_sas_address(ioc, 4168 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
4153 sas_device.sas_address); 4169 sas_device.sas_address);
4154 mptsas_add_end_device(ioc, phy_info); 4170 mptsas_add_end_device(ioc, phy_info);
@@ -4199,6 +4215,13 @@ mptsas_hotplug_work(MPT_ADAPTER *ioc, struct fw_event_work *fw_event,
4199 (hot_plug_info->channel << 8) + 4215 (hot_plug_info->channel << 8) +
4200 hot_plug_info->id); 4216 hot_plug_info->id);
4201 4217
4218 /* If there is no FW B_T mapping for this device then break
4219 * */
4220 if (!(sas_device.flags & MPI_SAS_DEVICE0_FLAGS_DEVICE_PRESENT)
4221 || !(sas_device.flags &
4222 MPI_SAS_DEVICE0_FLAGS_DEVICE_MAPPED))
4223 break;
4224
4202 if (!sas_device.handle) 4225 if (!sas_device.handle)
4203 return; 4226 return;
4204 4227
@@ -4241,6 +4264,13 @@ mptsas_hotplug_work(MPT_ADAPTER *ioc, struct fw_event_work *fw_event,
4241 break; 4264 break;
4242 } 4265 }
4243 4266
4267 /* If there is no FW B_T mapping for this device then break
4268 * */
4269 if (!(sas_device.flags & MPI_SAS_DEVICE0_FLAGS_DEVICE_PRESENT)
4270 || !(sas_device.flags &
4271 MPI_SAS_DEVICE0_FLAGS_DEVICE_MAPPED))
4272 break;
4273
4244 phy_info = mptsas_find_phyinfo_by_sas_address( 4274 phy_info = mptsas_find_phyinfo_by_sas_address(
4245 ioc, sas_device.sas_address); 4275 ioc, sas_device.sas_address);
4246 4276
@@ -4294,6 +4324,13 @@ mptsas_hotplug_work(MPT_ADAPTER *ioc, struct fw_event_work *fw_event,
4294 break; 4324 break;
4295 } 4325 }
4296 4326
4327 /* If there is no FW B_T mapping for this device then break
4328 * */
4329 if (!(sas_device.flags & MPI_SAS_DEVICE0_FLAGS_DEVICE_PRESENT)
4330 || !(sas_device.flags &
4331 MPI_SAS_DEVICE0_FLAGS_DEVICE_MAPPED))
4332 break;
4333
4297 phy_info = mptsas_find_phyinfo_by_sas_address(ioc, 4334 phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
4298 sas_device.sas_address); 4335 sas_device.sas_address);
4299 if (!phy_info) { 4336 if (!phy_info) {
diff --git a/drivers/message/fusion/mptsas.h b/drivers/message/fusion/mptsas.h
index 7b249edbda78..57e86ab77661 100644
--- a/drivers/message/fusion/mptsas.h
+++ b/drivers/message/fusion/mptsas.h
@@ -140,6 +140,7 @@ struct mptsas_devinfo {
140 u64 sas_address; /* WWN of this device, 140 u64 sas_address; /* WWN of this device,
141 SATA is assigned by HBA,expander */ 141 SATA is assigned by HBA,expander */
142 u32 device_info; /* bitfield detailed info about this device */ 142 u32 device_info; /* bitfield detailed info about this device */
143 u16 flags; /* sas device pg0 flags */
143}; 144};
144 145
145/* 146/*