aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authornagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com>2011-10-21 00:36:33 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-10-30 04:46:26 -0400
commit0167ac67ff6f35bf2364f7672c8012b0cd40277f (patch)
tree7759b2fc49358380740d70198f3238431c53e379 /drivers/scsi
parent921cd8024b908f8f49f772c8d3a02381b4db2ed2 (diff)
[SCSI] mpt2sas: Fix for system hang when discovery in progress
Fix for issue : While discovery is in progress, hot unplug and hot plug of enclosure connected to the controller card is causing system to hang. When a device is in the process of being detected at driver load time then if it is removed, the device that is no longer present will not be added to the list. So the code in _scsih_probe_sas() is rearranged as such so the devices that failed to be detected are not added to the list. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Cc: stable@kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 7a3865d9c959..c13efc3268d8 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -7657,22 +7657,27 @@ _scsih_probe_sas(struct MPT2SAS_ADAPTER *ioc)
7657 /* SAS Device List */ 7657 /* SAS Device List */
7658 list_for_each_entry_safe(sas_device, next, &ioc->sas_device_init_list, 7658 list_for_each_entry_safe(sas_device, next, &ioc->sas_device_init_list,
7659 list) { 7659 list) {
7660 spin_lock_irqsave(&ioc->sas_device_lock, flags);
7661 list_move_tail(&sas_device->list, &ioc->sas_device_list);
7662 spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
7663 7660
7664 if (ioc->hide_drives) 7661 if (ioc->hide_drives)
7665 continue; 7662 continue;
7666 7663
7667 if (!mpt2sas_transport_port_add(ioc, sas_device->handle, 7664 if (!mpt2sas_transport_port_add(ioc, sas_device->handle,
7668 sas_device->sas_address_parent)) { 7665 sas_device->sas_address_parent)) {
7669 _scsih_sas_device_remove(ioc, sas_device); 7666 list_del(&sas_device->list);
7667 kfree(sas_device);
7668 continue;
7670 } else if (!sas_device->starget) { 7669 } else if (!sas_device->starget) {
7671 mpt2sas_transport_port_remove(ioc, 7670 mpt2sas_transport_port_remove(ioc,
7672 sas_device->sas_address, 7671 sas_device->sas_address,
7673 sas_device->sas_address_parent); 7672 sas_device->sas_address_parent);
7674 _scsih_sas_device_remove(ioc, sas_device); 7673 list_del(&sas_device->list);
7674 kfree(sas_device);
7675 continue;
7676
7675 } 7677 }
7678 spin_lock_irqsave(&ioc->sas_device_lock, flags);
7679 list_move_tail(&sas_device->list, &ioc->sas_device_list);
7680 spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
7676 } 7681 }
7677} 7682}
7678 7683