]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
be2iscsi 4.1.239.0 [PATCH 02/10] Fixing the /proc/interrupts problem V3
authorChuck Anderson <chuck.anderson@oracle.com>
Sat, 17 Dec 2011 04:03:30 +0000 (20:03 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 17 Dec 2011 04:03:30 +0000 (20:03 -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 : 8fcfb21073ea4f4261c8ee3ccd2fde8e281a4f28

 [SCSI] be2iscsi: Fixing the /proc/interrupts problem V3

 Fix be2iscsi driver to use a separate pointer for each irq action->name
 field and avoid display corruption in /proc/interrupts. The be2iscsi driver
 was using a single static array in a function for the irq action->name field.
 This results in garbage output from  /proc/interrupts

 The pointer for action->name is garbage and scribbles the output on the screen.

 This patch fixes the problem:

 156:          0          0          0          0          0          0
 0          0          0          0          0          0          0
 0          0          0          0          0          0          0
 0          0          0          0       PCI-MSI-X  beiscsi_msix_0017
---
 be_main.c |   34 ++++++++++++++++++++++++++--------
 be_main.h |    3 +++
 2 files changed, 29 insertions(+), 8 deletions(-)

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

index 94b9a07845d567a950857afdae79296da1f6fb1f..82280e341e2ebde98aa3b6e0899d0ec1a55156e5 100644 (file)
@@ -875,33 +875,47 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
        struct hwi_controller *phwi_ctrlr;
        struct hwi_context_memory *phwi_context;
        int ret, msix_vec, i, j;
-       char desc[32];
 
        phwi_ctrlr = phba->phwi_ctrlr;
        phwi_context = phwi_ctrlr->phwi_ctxt;
 
        if (phba->msix_enabled) {
                for (i = 0; i < phba->num_cpus; i++) {
-                       sprintf(desc, "beiscsi_msix_%04x", i);
+                       phba->msi_name[i] = kzalloc(BEISCSI_MSI_NAME,
+                                                   GFP_KERNEL);
+                       if (!phba->msi_name[i]) {
+                               ret = -ENOMEM;
+                               goto free_msix_irqs;
+                       }
+
+                       sprintf(phba->msi_name[i], "beiscsi_%02x_%02x",
+                               phba->shost->host_no, i);
                        msix_vec = phba->msix_entries[i].vector;
-                       ret = request_irq(msix_vec, be_isr_msix, 0, desc,
+                       ret = request_irq(msix_vec, be_isr_msix, 0,
+                                         phba->msi_name[i],
                                          &phwi_context->be_eq[i]);
                        if (ret) {
                                shost_printk(KERN_ERR, phba->shost,
                                             "beiscsi_init_irqs-Failed to"
                                             "register msix for i = %d\n", i);
-                               if (!i)
-                                       return ret;
+                               kfree(phba->msi_name[i]);
                                goto free_msix_irqs;
                        }
                }
+               phba->msi_name[i] = kzalloc(BEISCSI_MSI_NAME, GFP_KERNEL);
+               if (!phba->msi_name[i]) {
+                       ret = -ENOMEM;
+                       goto free_msix_irqs;
+               }
+               sprintf(phba->msi_name[i], "beiscsi_mcc_%02x",
+                       phba->shost->host_no);
                msix_vec = phba->msix_entries[i].vector;
-               ret = request_irq(msix_vec, be_isr_mcc, 0, "beiscsi_msix_mcc",
+               ret = request_irq(msix_vec, be_isr_mcc, 0, phba->msi_name[i],
                                  &phwi_context->be_eq[i]);
                if (ret) {
                        shost_printk(KERN_ERR, phba->shost, "beiscsi_init_irqs-"
                                     "Failed to register beiscsi_msix_mcc\n");
-                       i++;
+                       kfree(phba->msi_name[i]);
                        goto free_msix_irqs;
                }
 
@@ -916,8 +930,11 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
        }
        return 0;
 free_msix_irqs:
-       for (j = i - 1; j == 0; j++)
+       for (j = i - 1; j >= 0; j--) {
+               kfree(phba->msi_name[j]);
+               msix_vec = phba->msix_entries[j].vector;
                free_irq(msix_vec, &phwi_context->be_eq[j]);
+       }
        return ret;
 }
 
@@ -4123,6 +4140,7 @@ static void beiscsi_remove(struct pci_dev *pcidev)
                for (i = 0; i <= phba->num_cpus; i++) {
                        msix_vec = phba->msix_entries[i].vector;
                        free_irq(msix_vec, &phwi_context->be_eq[i]);
+                       kfree(phba->msi_name[i]);
                }
        } else
                if (phba->pcidev->irq)
index 081c171a1ed60965d3c47701a409fc263fd6ece3..1a55aee16936df8a0c81965c5aac54b44e7c3757 100644 (file)
@@ -162,6 +162,8 @@ do {                                                        \
 #define PAGES_REQUIRED(x) \
        ((x < PAGE_SIZE) ? 1 :  ((x + PAGE_SIZE - 1) / PAGE_SIZE))
 
+#define BEISCSI_MSI_NAME 20 /* size of msi_name string */
+
 enum be_mem_enum {
        HWI_MEM_ADDN_CONTEXT,
        HWI_MEM_WRB,
@@ -287,6 +289,7 @@ struct beiscsi_hba {
        unsigned int num_cpus;
        unsigned int nxt_cqid;
        struct msix_entry msix_entries[MAX_CPUS + 1];
+       char *msi_name[MAX_CPUS + 1];
        bool msix_enabled;
        struct be_mem_descriptor *init_mem;