]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
be2iscsi 4.1.239.0 [PATCH 03/10] Adding a shutdown Routine
authorChuck Anderson <chuck.anderson@oracle.com>
Sat, 17 Dec 2011 04:04:19 +0000 (20:04 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 17 Dec 2011 04:04:19 +0000 (20:04 -0800)
Dec. 16, 2011
Oracle bugzilla 13257
Oracle bug 13465921
be2iscsi HBA driver v4.1.239.0 patch set for UEK R2(2.6.39)
jayamohan.kallickal@emulex.com

Ported driver version 4.1.239.0 to UEK2 2.6.39-100.0.17 (was 2.103.298.0)

Comments from the patch headers:

 Commit ID : 25602c97f50e4b7fea84d2c81326dc5e372ca868
 [SCSI] be2iscsi: Adding a shutdown Routine

 This patch adds a shutdown routine. It fixes a bug where when be2net
 and be2iscsi are both used be2iscsi was not cleaning up its resources
 properly causing be2net to fail to get loaded when the system is
 rebooted.
---
 be_main.c |   38 ++++++++++++++++++++++++++++++--------
 1 files changed, 30 insertions(+), 8 deletions(-)

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
drivers/scsi/be2iscsi/be_main.c

index 82280e341e2ebde98aa3b6e0899d0ec1a55156e5..629273ac2af92f5a1c241efce7a0f59b76d1cca4 100644 (file)
@@ -4117,9 +4117,8 @@ static int beiscsi_task_xmit(struct iscsi_task *task)
        return beiscsi_iotask(task, sg, num_sg, xferlen, writedir);
 }
 
-static void beiscsi_remove(struct pci_dev *pcidev)
+static void beiscsi_quiesce(struct beiscsi_hba *phba)
 {
-       struct beiscsi_hba *phba = NULL;
        struct hwi_controller *phwi_ctrlr;
        struct hwi_context_memory *phwi_context;
        struct be_eq_obj *pbe_eq;
@@ -4127,12 +4126,6 @@ static void beiscsi_remove(struct pci_dev *pcidev)
        u8 *real_offset = 0;
        u32 value = 0;
 
-       phba = (struct beiscsi_hba *)pci_get_drvdata(pcidev);
-       if (!phba) {
-               dev_err(&pcidev->dev, "beiscsi_remove called with no phba\n");
-               return;
-       }
-
        phwi_ctrlr = phba->phwi_ctrlr;
        phwi_context = phwi_ctrlr->phwi_ctxt;
        hwi_disable_intr(phba);
@@ -4168,6 +4161,20 @@ static void beiscsi_remove(struct pci_dev *pcidev)
                            phba->ctrl.mbox_mem_alloced.size,
                            phba->ctrl.mbox_mem_alloced.va,
                            phba->ctrl.mbox_mem_alloced.dma);
+}
+
+static void beiscsi_remove(struct pci_dev *pcidev)
+{
+
+       struct beiscsi_hba *phba = NULL;
+
+       phba = pci_get_drvdata(pcidev);
+       if (!phba) {
+               dev_err(&pcidev->dev, "beiscsi_remove called with no phba\n");
+               return;
+       }
+
+       beiscsi_quiesce(phba);
        if (phba->boot_kset)
                iscsi_boot_destroy_kset(phba->boot_kset);
        iscsi_host_remove(phba->shost);
@@ -4175,6 +4182,20 @@ static void beiscsi_remove(struct pci_dev *pcidev)
        iscsi_host_free(phba->shost);
 }
 
+static void beiscsi_shutdown(struct pci_dev *pcidev)
+{
+
+       struct beiscsi_hba *phba = NULL;
+
+       phba = (struct beiscsi_hba *)pci_get_drvdata(pcidev);
+       if (!phba) {
+               dev_err(&pcidev->dev, "beiscsi_shutdown called with no phba\n");
+               return;
+       }
+
+       beiscsi_quiesce(phba);
+}
+
 static void beiscsi_msix_enable(struct beiscsi_hba *phba)
 {
        int i, status;
@@ -4431,6 +4452,7 @@ static struct pci_driver beiscsi_pci_driver = {
        .name = DRV_NAME,
        .probe = beiscsi_dev_probe,
        .remove = beiscsi_remove,
+       .shutdown = beiscsi_shutdown,
        .id_table = beiscsi_pci_id_table
 };