]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
hpsa: break hpsa_free_irqs_and_disable_msix into two functions
authorRobert Elliott <elliott@hp.com>
Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 19:46:59 +0000 (11:46 -0800)
replace calls to hpsa_free_irqs_and_disable_msix with
hpsa_free_irqs and hpsa_disable_interrupt_mode

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.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 236dfc98840b0148bcba2bbd8bd4763bae0666ba..a9b314d6aaf59f5aebde7aa9ac31b6bbb4fff99c 100644 (file)
@@ -6357,10 +6357,20 @@ static int find_PCI_BAR_index(struct pci_dev *pdev, unsigned long pci_bar_addr)
        return -1;
 }
 
+static void hpsa_disable_interrupt_mode(struct ctlr_info *h)
+{
+       if (h->msix_vector) {
+               if (h->pdev->msix_enabled)
+                       pci_disable_msix(h->pdev);
+       } else if (h->msi_vector) {
+               if (h->pdev->msi_enabled)
+                       pci_disable_msi(h->pdev);
+       }
+}
+
 /* If MSI/MSI-X is supported by the kernel we will try to enable it on
  * controllers that are capable. If not, we use legacy INTx mode.
  */
-
 static void hpsa_interrupt_mode(struct ctlr_info *h)
 {
 #ifdef CONFIG_PCI_MSI
@@ -7001,20 +7011,6 @@ static int hpsa_kdump_soft_reset(struct ctlr_info *h)
        return 0;
 }
 
-static void hpsa_free_irqs_and_disable_msix(struct ctlr_info *h)
-{
-       hpsa_free_irqs(h);
-#ifdef CONFIG_PCI_MSI
-       if (h->msix_vector) {
-               if (h->pdev->msix_enabled)
-                       pci_disable_msix(h->pdev);
-       } else if (h->msi_vector) {
-               if (h->pdev->msi_enabled)
-                       pci_disable_msi(h->pdev);
-       }
-#endif /* CONFIG_PCI_MSI */
-}
-
 static void hpsa_free_reply_queues(struct ctlr_info *h)
 {
        int i;
@@ -7031,7 +7027,7 @@ static void hpsa_free_reply_queues(struct ctlr_info *h)
 
 static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h)
 {
-       hpsa_free_irqs_and_disable_msix(h);
+       hpsa_free_irqs(h);
        hpsa_free_sg_chain_blocks(h);
        hpsa_free_cmd_pool(h);
        kfree(h->ioaccel1_blockFetchTable);
@@ -7043,6 +7039,7 @@ static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h)
                iounmap(h->transtable);
        if (h->cfgtable)
                iounmap(h->cfgtable);
+       hpsa_disable_interrupt_mode(h);
        pci_disable_device(h->pdev);
        pci_release_regions(h->pdev);
        kfree(h);
@@ -7530,7 +7527,8 @@ static void hpsa_shutdown(struct pci_dev *pdev)
         */
        hpsa_flush_cache(h);
        h->access.set_intr_mask(h, HPSA_INTR_OFF);
-       hpsa_free_irqs_and_disable_msix(h);
+       hpsa_free_irqs(h);
+       hpsa_disable_interrupt_mode(h);         /* pci_init 2 */
 }
 
 static void hpsa_free_device_info(struct ctlr_info *h)
@@ -7561,7 +7559,10 @@ static void hpsa_remove_one(struct pci_dev *pdev)
        destroy_workqueue(h->rescan_ctlr_wq);
        destroy_workqueue(h->resubmit_wq);
        hpsa_unregister_scsi(h);        /* unhook from SCSI subsystem */
+
+       /* includes hpsa_free_irqs and hpsa_disable_interrupt_mode */
        hpsa_shutdown(pdev);
+
        iounmap(h->vaddr);
        iounmap(h->transtable);
        iounmap(h->cfgtable);