aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authornagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com>2011-10-19 06:07:24 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-10-30 04:54:42 -0400
commit918134efe9893629407af04adf242ee3095bea4a (patch)
treeff1ff5b2669f29d2df5e7e28a2ed4fe9f6f07899 /drivers/scsi
parentf3db032f1af6dd3280037ea526fee7cddcc36c41 (diff)
[SCSI] mpt2sas: Fix for deadlock between hot plug worker threads and host reset context
This is due to driver reporting a device missing to the OS then the OS sending a SYNC_CACHE request to driver while the IO queues are locked due to host reset. To fix the issue, the driver will be waking up the port enable context immediately when the driver receives the reply message, instead of waiting on the hot plug worker threads. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index f9ce31950314..1f289882a298 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -3059,6 +3059,7 @@ _scsih_tm_tr_send(struct MPT2SAS_ADAPTER *ioc, u16 handle)
3059 "handle(0x%04x), sas_addr(0x%016llx)\n", ioc->name, handle, 3059 "handle(0x%04x), sas_addr(0x%016llx)\n", ioc->name, handle,
3060 (unsigned long long)sas_address)); 3060 (unsigned long long)sas_address));
3061 _scsih_ublock_io_device(ioc, handle); 3061 _scsih_ublock_io_device(ioc, handle);
3062 sas_target_priv_data->handle = MPT2SAS_INVALID_DEVICE_HANDLE;
3062 } 3063 }
3063 3064
3064 smid = mpt2sas_base_get_smid_hpr(ioc, ioc->tm_tr_cb_idx); 3065 smid = mpt2sas_base_get_smid_hpr(ioc, ioc->tm_tr_cb_idx);
@@ -5201,6 +5202,9 @@ _scsih_remove_device(struct MPT2SAS_ADAPTER *ioc,
5201 if (sas_device_backup.starget && sas_device_backup.starget->hostdata) { 5202 if (sas_device_backup.starget && sas_device_backup.starget->hostdata) {
5202 sas_target_priv_data = sas_device_backup.starget->hostdata; 5203 sas_target_priv_data = sas_device_backup.starget->hostdata;
5203 sas_target_priv_data->deleted = 1; 5204 sas_target_priv_data->deleted = 1;
5205 _scsih_ublock_io_device(ioc, sas_device_backup.handle);
5206 sas_target_priv_data->handle =
5207 MPT2SAS_INVALID_DEVICE_HANDLE;
5204 } 5208 }
5205 5209
5206 _scsih_ublock_io_device(ioc, sas_device_backup.handle); 5210 _scsih_ublock_io_device(ioc, sas_device_backup.handle);
@@ -5354,7 +5358,7 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc,
5354 _scsih_sas_topology_change_event_debug(ioc, event_data); 5358 _scsih_sas_topology_change_event_debug(ioc, event_data);
5355#endif 5359#endif
5356 5360
5357 if (ioc->shost_recovery || ioc->remove_host || ioc->pci_error_recovery) 5361 if (ioc->remove_host || ioc->pci_error_recovery)
5358 return; 5362 return;
5359 5363
5360 if (!ioc->sas_hba.num_phys) 5364 if (!ioc->sas_hba.num_phys)
@@ -5415,6 +5419,9 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc,
5415 switch (reason_code) { 5419 switch (reason_code) {
5416 case MPI2_EVENT_SAS_TOPO_RC_PHY_CHANGED: 5420 case MPI2_EVENT_SAS_TOPO_RC_PHY_CHANGED:
5417 5421
5422 if (ioc->shost_recovery)
5423 break;
5424
5418 if (link_rate == prev_link_rate) 5425 if (link_rate == prev_link_rate)
5419 break; 5426 break;
5420 5427
@@ -5428,6 +5435,9 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc,
5428 break; 5435 break;
5429 case MPI2_EVENT_SAS_TOPO_RC_TARG_ADDED: 5436 case MPI2_EVENT_SAS_TOPO_RC_TARG_ADDED:
5430 5437
5438 if (ioc->shost_recovery)
5439 break;
5440
5431 mpt2sas_transport_update_links(ioc, sas_address, 5441 mpt2sas_transport_update_links(ioc, sas_address,
5432 handle, phy_number, link_rate); 5442 handle, phy_number, link_rate);
5433 5443
@@ -7091,7 +7101,13 @@ mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase)
7091 _scsih_search_responding_sas_devices(ioc); 7101 _scsih_search_responding_sas_devices(ioc);
7092 _scsih_search_responding_raid_devices(ioc); 7102 _scsih_search_responding_raid_devices(ioc);
7093 _scsih_search_responding_expanders(ioc); 7103 _scsih_search_responding_expanders(ioc);
7104 if (!ioc->is_driver_loading) {
7105 _scsih_prep_device_scan(ioc);
7106 _scsih_search_responding_sas_devices(ioc);
7107 _scsih_search_responding_raid_devices(ioc);
7108 _scsih_search_responding_expanders(ioc);
7094 _scsih_error_recovery_delete_devices(ioc); 7109 _scsih_error_recovery_delete_devices(ioc);
7110 }
7095 break; 7111 break;
7096 } 7112 }
7097} 7113}
@@ -7126,17 +7142,7 @@ _firmware_event_work(struct work_struct *work)
7126 _scsih_scan_for_devices_after_reset(ioc); 7142 _scsih_scan_for_devices_after_reset(ioc);
7127 break; 7143 break;
7128 case MPT2SAS_PORT_ENABLE_COMPLETE: 7144 case MPT2SAS_PORT_ENABLE_COMPLETE:
7129 if (!ioc->is_driver_loading && ioc->shost_recovery) { 7145 ioc->start_scan = 0;
7130 _scsih_prep_device_scan(ioc);
7131 _scsih_search_responding_sas_devices(ioc);
7132 _scsih_search_responding_raid_devices(ioc);
7133 _scsih_search_responding_expanders(ioc);
7134 }
7135
7136 if (ioc->start_scan)
7137 ioc->start_scan = 0;
7138 else
7139 complete(&ioc->port_enable_done);
7140 7146
7141 7147
7142 7148