aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2010-03-18 09:48:30 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-04-11 10:24:07 -0400
commit48959f1eae3068fefb3de05cdc0c2bd8f0f96c37 (patch)
tree1eeedc861af82833be4fe3634bbd541fbb5ef186 /drivers/message
parentb3b97316d5861b1708cd7ef2df9989d12d97acb9 (diff)
[SCSI] mptfusion: mpt_detach is called properly at the time of rmmod
Current design of mptsas is as follow. MPTSAS will do probe() if pci id matches for available card in system, irrespective of mode of controller. If controller is I/T mode or I mode, things are fine. If controller is only in T mode, mptsas is not doing complete process of mptsas_probe(). It will only make sure IOC structure is created and IOC reference is available for mptstm driver. Now While removing module we should take care case of Target mode only mptsas. If we are removing IOC which is only in Target mode, We should only detach IOC instead of following rest of the cleanup process which is only required for T mode controller. Now For T mode controller, only part clean up is done instead of complete cleanup. mpt_detach will call early in case of Target mode only controller. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/fusion/mptsas.c6
-rw-r--r--drivers/message/fusion/mptscsih.c5
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index e5e9bf3487db..674461fb6a3e 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -5073,6 +5073,12 @@ static void __devexit mptsas_remove(struct pci_dev *pdev)
5073 struct mptsas_portinfo *p, *n; 5073 struct mptsas_portinfo *p, *n;
5074 int i; 5074 int i;
5075 5075
5076 if (!ioc->sh) {
5077 printk(MYIOC_s_INFO_FMT "IOC is in Target mode\n", ioc->name);
5078 mpt_detach(pdev);
5079 return;
5080 }
5081
5076 mptsas_shutdown(pdev); 5082 mptsas_shutdown(pdev);
5077 5083
5078 mptsas_del_device_components(ioc); 5084 mptsas_del_device_components(ioc);
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 929d584855d2..b966678e4419 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1149,11 +1149,6 @@ mptscsih_remove(struct pci_dev *pdev)
1149 MPT_SCSI_HOST *hd; 1149 MPT_SCSI_HOST *hd;
1150 int sz1; 1150 int sz1;
1151 1151
1152 if(!host) {
1153 mpt_detach(pdev);
1154 return;
1155 }
1156
1157 scsi_remove_host(host); 1152 scsi_remove_host(host);
1158 1153
1159 if((hd = shost_priv(host)) == NULL) 1154 if((hd = shost_priv(host)) == NULL)