]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
hpsa: fix rmmod issues
authorDon Brace <don.brace@pmcs.com>
Fri, 6 Nov 2015 14:04:55 +0000 (06:04 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 19:56:41 +0000 (11:56 -0800)
The driver is calling hpsa_shutdown before calling scsi_remove_host.
hpsa_shutdown is disabling interrupts.

scsi_remove_host can trigger I/O operations, such as
SYNCHRONIZE CACHE when multipath is enabled which hang the system.

Call scsi_remove_host before calling hpsa_shutdown.

Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
drivers/scsi/hpsa.c

index c4522764b55afcb0fde5cb9c38da72db791bee62..4dcbd8d0e66a9a37ca181c70fc371ca9ee18630f 100644 (file)
@@ -8344,6 +8344,14 @@ static void hpsa_remove_one(struct pci_dev *pdev)
        destroy_workqueue(h->rescan_ctlr_wq);
        destroy_workqueue(h->resubmit_wq);
 
+       /*
+        * Call before disabling interrupts.
+        * scsi_remove_host can trigger I/O operations especially
+        * when multipath is enabled. There can be SYNCHRONIZE CACHE
+        * operations which cannot complete and will hang the system.
+        */
+       if (h->scsi_host)
+               scsi_remove_host(h->scsi_host);         /* init_one 8 */
        /* includes hpsa_free_irqs - init_one 4 */
        /* includes hpsa_disable_interrupt_mode - pci_init 2 */
        hpsa_shutdown(pdev);
@@ -8352,8 +8360,6 @@ static void hpsa_remove_one(struct pci_dev *pdev)
 
        kfree(h->hba_inquiry_data);                     /* init_one 10 */
        h->hba_inquiry_data = NULL;                     /* init_one 10 */
-       if (h->scsi_host)
-               scsi_remove_host(h->scsi_host);         /* init_one 8 */
        hpsa_free_ioaccel2_sg_chain_blocks(h);
        hpsa_free_performant_mode(h);                   /* init_one 7 */
        hpsa_free_sg_chain_blocks(h);                   /* init_one 6 */