aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2009-12-16 08:20:06 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-02-08 19:19:37 -0500
commitd7384b28afb2bf2b7be835ddc8c852bdc5e0ce1c (patch)
treebebd03f6a93e3a7b1d720a5913f8b1adc62ce702
parent0f88009d5cfae890bd3466126d1622ad4f16b798 (diff)
[SCSI] mpt2sas: Delete volume before HBA detach.
The driver hangs when doing `rmmod mpt2sas` if there are any IR volumes present.The hang is due the scsi midlayer trying to access the IR volumes after the driver releases controller resources. Perhaps when scsi_remove_host is called,the scsi mid layer is sending some request. This doesn't occur for bare drives becuase the driver is already reporting those drives deleted prior to calling mpt2sas_base_detach. To solve this issue, we need to delete the volumes as well. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index efabea1a3ce4..cd551768bfbf 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -5998,6 +5998,8 @@ _scsih_remove(struct pci_dev *pdev)
5998 struct _sas_port *mpt2sas_port; 5998 struct _sas_port *mpt2sas_port;
5999 struct _sas_device *sas_device; 5999 struct _sas_device *sas_device;
6000 struct _sas_node *expander_sibling; 6000 struct _sas_node *expander_sibling;
6001 struct _raid_device *raid_device, *next;
6002 struct MPT2SAS_TARGET *sas_target_priv_data;
6001 struct workqueue_struct *wq; 6003 struct workqueue_struct *wq;
6002 unsigned long flags; 6004 unsigned long flags;
6003 6005
@@ -6011,6 +6013,21 @@ _scsih_remove(struct pci_dev *pdev)
6011 if (wq) 6013 if (wq)
6012 destroy_workqueue(wq); 6014 destroy_workqueue(wq);
6013 6015
6016 /* release all the volumes */
6017 list_for_each_entry_safe(raid_device, next, &ioc->raid_device_list,
6018 list) {
6019 if (raid_device->starget) {
6020 sas_target_priv_data =
6021 raid_device->starget->hostdata;
6022 sas_target_priv_data->deleted = 1;
6023 scsi_remove_target(&raid_device->starget->dev);
6024 }
6025 printk(MPT2SAS_INFO_FMT "removing handle(0x%04x), wwid"
6026 "(0x%016llx)\n", ioc->name, raid_device->handle,
6027 (unsigned long long) raid_device->wwid);
6028 _scsih_raid_device_remove(ioc, raid_device);
6029 }
6030
6014 /* free ports attached to the sas_host */ 6031 /* free ports attached to the sas_host */
6015 retry_again: 6032 retry_again:
6016 list_for_each_entry(mpt2sas_port, 6033 list_for_each_entry(mpt2sas_port,