aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2009-08-07 10:04:26 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-08-13 17:26:00 -0400
commit20f5895d55d9281830bfb7819c5c5b70b05297a6 (patch)
treedb360859d1fd134fb36e2bfea4602f98af643415 /drivers/scsi/mpt2sas
parent15052c9e85bf0cdadcb69eb89623bf12bad8b4f8 (diff)
[SCSI] mpt2sas: Expander fix oops saying "Already part of another port"
Kernel panic is seen because driver did not tear down the port which should be dnoe using mpt2sas_transport_port_remove(). without this fix When expander is added back we would oops inside sas_port_add_phy. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index b1326bf78c9a..918445e1e65f 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -3426,7 +3426,7 @@ _scsih_expander_add(struct MPT2SAS_ADAPTER *ioc, u16 handle)
3426 __le64 sas_address; 3426 __le64 sas_address;
3427 int i; 3427 int i;
3428 unsigned long flags; 3428 unsigned long flags;
3429 struct _sas_port *mpt2sas_port; 3429 struct _sas_port *mpt2sas_port = NULL;
3430 int rc = 0; 3430 int rc = 0;
3431 3431
3432 if (!handle) 3432 if (!handle)
@@ -3518,12 +3518,20 @@ _scsih_expander_add(struct MPT2SAS_ADAPTER *ioc, u16 handle)
3518 &expander_pg1, i, handle))) { 3518 &expander_pg1, i, handle))) {
3519 printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", 3519 printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
3520 ioc->name, __FILE__, __LINE__, __func__); 3520 ioc->name, __FILE__, __LINE__, __func__);
3521 continue; 3521 rc = -1;
3522 goto out_fail;
3522 } 3523 }
3523 sas_expander->phy[i].handle = handle; 3524 sas_expander->phy[i].handle = handle;
3524 sas_expander->phy[i].phy_id = i; 3525 sas_expander->phy[i].phy_id = i;
3525 mpt2sas_transport_add_expander_phy(ioc, &sas_expander->phy[i], 3526
3526 expander_pg1, sas_expander->parent_dev); 3527 if ((mpt2sas_transport_add_expander_phy(ioc,
3528 &sas_expander->phy[i], expander_pg1,
3529 sas_expander->parent_dev))) {
3530 printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
3531 ioc->name, __FILE__, __LINE__, __func__);
3532 rc = -1;
3533 goto out_fail;
3534 }
3527 } 3535 }
3528 3536
3529 if (sas_expander->enclosure_handle) { 3537 if (sas_expander->enclosure_handle) {
@@ -3540,8 +3548,9 @@ _scsih_expander_add(struct MPT2SAS_ADAPTER *ioc, u16 handle)
3540 3548
3541 out_fail: 3549 out_fail:
3542 3550
3543 if (sas_expander) 3551 if (mpt2sas_port)
3544 kfree(sas_expander->phy); 3552 mpt2sas_transport_port_remove(ioc, sas_expander->sas_address,
3553 sas_expander->parent_handle);
3545 kfree(sas_expander); 3554 kfree(sas_expander);
3546 return rc; 3555 return rc;
3547} 3556}