aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2010-06-17 05:11:48 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:02:35 -0400
commitcc7e9f5f9999d9c015686ab4a622e1fb529391eb (patch)
tree55bde51c2d1687a57b9bac9608961c33e9db20b3
parentb68bf096d4211bb6490955f86842d8291e8ae218 (diff)
[SCSI] mptfusion: Added code for occationally SATA hotplug failure.
Issue: SATA hotplug does not work sometimes. At the time of ADD device/ADD phys disk, drive may fail to add SATA device due to temporary SAS Address for SATA device generated by firmware. Final SAS address for SATA driver will be generated only after disk spinup is done. This may take some times for slow spining SATA drives. At phy link up driver gets attached device sas address and stores into phyinfo. At the time of ADD event driver will read sas device page0 using channel and FW ID provided in ADD Device event. Here in case of SATA drives, driver will see miss match in phyinfo->sas_address and latest sas address read from SAS DEVICE PAGE0 and eventually device won't be added to OS. Fix: When Driver read SAS DEVICE PAGE0, it can identify Device type looking at device_info. If device is SATA drive and sas address mismatch happens, Driver will do same stuffs which happened at the time of LINK UP to get correct piece of information from Pages. ( Find parent device and refresh parent device phys either HBA refresh/Exp refresh) Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/message/fusion/mptsas.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index a94655162347..f42781b92bdd 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -4210,6 +4210,7 @@ mptsas_hotplug_work(MPT_ADAPTER *ioc, struct fw_event_work *fw_event,
4210 struct mptsas_devinfo sas_device; 4210 struct mptsas_devinfo sas_device;
4211 VirtTarget *vtarget; 4211 VirtTarget *vtarget;
4212 int i; 4212 int i;
4213 struct mptsas_portinfo *port_info;
4213 4214
4214 switch (hot_plug_info->event_type) { 4215 switch (hot_plug_info->event_type) {
4215 4216
@@ -4249,8 +4250,36 @@ mptsas_hotplug_work(MPT_ADAPTER *ioc, struct fw_event_work *fw_event,
4249 return; 4250 return;
4250 4251
4251 phy_info = mptsas_refreshing_device_handles(ioc, &sas_device); 4252 phy_info = mptsas_refreshing_device_handles(ioc, &sas_device);
4252 if (!phy_info) 4253 /* Only For SATA Device ADD */
4254 if (!phy_info && (sas_device.device_info &
4255 MPI_SAS_DEVICE_INFO_SATA_DEVICE)) {
4256 devtprintk(ioc, printk(MYIOC_s_DEBUG_FMT
4257 "%s %d SATA HOT PLUG: "
4258 "parent handle of device %x\n", ioc->name,
4259 __func__, __LINE__, sas_device.handle_parent));
4260 port_info = mptsas_find_portinfo_by_handle(ioc,
4261 sas_device.handle_parent);
4262
4263 if (port_info == ioc->hba_port_info)
4264 mptsas_probe_hba_phys(ioc);
4265 else if (port_info)
4266 mptsas_expander_refresh(ioc, port_info);
4267 else {
4268 dfailprintk(ioc, printk(MYIOC_s_ERR_FMT
4269 "%s %d port info is NULL\n",
4270 ioc->name, __func__, __LINE__));
4271 break;
4272 }
4273 phy_info = mptsas_refreshing_device_handles
4274 (ioc, &sas_device);
4275 }
4276
4277 if (!phy_info) {
4278 dfailprintk(ioc, printk(MYIOC_s_ERR_FMT
4279 "%s %d phy info is NULL\n",
4280 ioc->name, __func__, __LINE__));
4253 break; 4281 break;
4282 }
4254 4283
4255 if (mptsas_get_rphy(phy_info)) 4284 if (mptsas_get_rphy(phy_info))
4256 break; 4285 break;