summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mvsas
diff options
context:
space:
mode:
authorJack Wang <jinpu.wang@profitbricks.com>2015-11-05 12:34:18 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2015-11-10 01:37:38 +0100
commit08d8a817cfda033da9d2f2c5314ef9b993f60010 (patch)
tree3495030a3d43e85c12f78c2097d743c8044851f6 /drivers/scsi/mvsas
parentaic94xx: remove SCSI host before detaching from SAS transport (diff)
downloadlinux-08d8a817cfda033da9d2f2c5314ef9b993f60010.tar.xz
linux-08d8a817cfda033da9d2f2c5314ef9b993f60010.zip
mvsas: remove SCSI host before detaching from SAS transport
commit cff549e4860f ("scsi: proper state checking and module refcount handling in scsi_device_get") the reference count of scsi device was changed, which could lead to when rmmod with at least on drive attached, SCSI error handle will run into infinite loop, and lockup the system. Fix it by remove scsi host first, this way scsi core will not send commands down after detaching SAS transport. This is a follow up fix for Benjamin's fix for pm80xx. See also: http://www.spinics.net/lists/linux-scsi/msg90088.html Signed-off-by: Jack Wang <jinpu.wang@profitbricks.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mvsas')
-rw-r--r--drivers/scsi/mvsas/mv_init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
index e2d555c1bffc..1960d956c671 100644
--- a/drivers/scsi/mvsas/mv_init.c
+++ b/drivers/scsi/mvsas/mv_init.c
@@ -641,9 +641,9 @@ static void mvs_pci_remove(struct pci_dev *pdev)
tasklet_kill(&((struct mvs_prv_info *)sha->lldd_ha)->mv_tasklet);
#endif
+ scsi_remove_host(mvi->shost);
sas_unregister_ha(sha);
sas_remove_host(mvi->shost);
- scsi_remove_host(mvi->shost);
MVS_CHIP_DISP->interrupt_disable(mvi);
free_irq(mvi->pdev->irq, sha);