[PATCH 1/1] aacraid: add optional MSI support.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Added support for MSI utilizing the aacraid.msi=1 parameter. This patch adds some localized or like-minded janitor fixes. Since the default is disabled, there is no impact on the code paths unless the customer wishes to experiment with the MSI performance.

This patch is against current scsi-misc-2.6

ObligatoryDisclaimer: Please accept my condolences regarding Outlook's handling of patch attachments. Please use the attached file to patch, the inlined patch is a hand filtered diff -rub unusable to patch but usable for inspection clarity.

Signed-off-by: Mark Salyzyn <aacraid@xxxxxxxxxxx>

 drivers/scsi/aacraid/aachba.c  |   56 ++++++++++++++++++++++++++++++-----------
 drivers/scsi/aacraid/aacraid.h |    2 +
 drivers/scsi/aacraid/linit.c   |   32 ++++++++++++-----------
 drivers/scsi/aacraid/rx.c      |    5 ++-
 drivers/scsi/aacraid/sa.c      |    4 +-
 5 files changed, 66 insertions(+), 33 deletions(-)

diff -rub a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
--- a/drivers/scsi/aacraid/aachba.c     2008-02-06 15:33:31.356341806 -0500
+++ b/drivers/scsi/aacraid/aachba.c     2008-02-06 15:52:33.988699503 -0500
@@ -144,51 +144,77 @@
  */

 static int nondasd = -1;
-static int aac_cache = 0;
+static int aac_cache;
 static int dacmode = -1;
-
+int aac_msi;
 int aac_commit = -1;
 int startup_timeout = 180;
 int aif_timeout = 120;
@@ -159,6 +153,9 @@
 MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC. 0=off, 1=on");
 module_param_named(commit, aac_commit, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the adapter for foreign arrays.\nThis is typically needed in systems that do not have a BIOS. 0=off, 1=on");
+module_param_named(msi, aac_msi, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(msi, "IRQ handling."
+       " 0=PIC(default), 1=MSI, 2=MSI-X(unsupported, uses MSI)");
 module_param(startup_timeout, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(startup_timeout, "The duration of time in seconds to wait for adapter to have it's kernel up and\nrunning. This is typically adjusted for large systems that do not have a BIOS.");
 module_param(aif_timeout, int, S_IRUGO|S_IWUSR);
@@ -181,7 +184,7 @@
 module_param(expose_physicals, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(expose_physicals, "Expose physical components of the arrays. - 1=protect 0=off, 1=on");

-int aac_reset_devices = 0;
+int aac_reset_devices;
 module_param_named(reset_devices, aac_reset_devices, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(reset_devices, "Force an adapter reset at initialization.");

diff -rub a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
--- a/drivers/scsi/aacraid/aacraid.h    2008-02-06 15:33:31.357341679 -0500
+++ b/drivers/scsi/aacraid/aacraid.h    2008-02-06 15:44:11.908258253 -0500
@@ -1026,6 +1026,7 @@
        u8                      raw_io_64;
        u8                      printf_enabled;
        u8                      in_reset;
+       u8                      msi;
 };

 #define aac_adapter_interrupt(dev) \
@@ -1881,6 +1882,7 @@
 extern int aif_timeout;
 extern int expose_physicals;
 extern int aac_reset_devices;
+extern int aac_msi;
 extern int aac_commit;
 extern int update_interval;
 extern int check_interval;
diff -rub a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
--- a/drivers/scsi/aacraid/linit.c      2008-02-06 15:33:31.358341553 -0500
+++ b/drivers/scsi/aacraid/linit.c      2008-02-06 15:44:11.908258253 -0500
@@ -1039,6 +1039,8 @@
        aac_send_shutdown(aac);
        aac_adapter_disable_int(aac);
        free_irq(aac->pdev->irq, aac);
+       if (aac->msi)
+               pci_disable_msi(aac->pdev);
 }

 static int __devinit aac_probe_one(struct pci_dev *pdev,
diff -rub a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
--- a/drivers/scsi/aacraid/rx.c 2008-02-06 15:33:31.359341426 -0500
+++ b/drivers/scsi/aacraid/rx.c 2008-02-06 15:44:11.909258127 -0500
@@ -625,8 +625,11 @@
        if (aac_init_adapter(dev) == NULL)
                goto error_iounmap;
        aac_adapter_comm(dev, dev->comm_interface);
-       if (request_irq(dev->scsi_host_ptr->irq, dev->a_ops.adapter_intr,
+       dev->msi = aac_msi && !pci_enable_msi(dev->pdev);
+       if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
                        IRQF_SHARED|IRQF_DISABLED, "aacraid", dev) < 0) {
+               if (dev->msi)
+                       pci_disable_msi(dev->pdev);
                printk(KERN_ERR "%s%d: Interrupt unavailable.\n",
                        name, instance);
                goto error_iounmap;
diff -rub a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c
--- a/drivers/scsi/aacraid/sa.c 2008-02-06 15:33:31.359341426 -0500
+++ b/drivers/scsi/aacraid/sa.c 2008-02-06 15:44:11.909258127 -0500
@@ -385,7 +385,7 @@

        if(aac_init_adapter(dev) == NULL)
                goto error_irq;
-       if (request_irq(dev->scsi_host_ptr->irq, dev->a_ops.adapter_intr,
+       if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
                        IRQF_SHARED|IRQF_DISABLED,
                        "aacraid", (void *)dev ) < 0) {
                printk(KERN_WARNING "%s%d: Interrupt unavailable.\n",
@@ -403,7 +403,7 @@

 error_irq:
        aac_sa_disable_interrupt(dev);
-       free_irq(dev->scsi_host_ptr->irq, (void *)dev);
+       free_irq(dev->pdev->irq, (void *)dev);

 error_iounmap:

Attachment: aacraid_msi.patch
Description: aacraid_msi.patch


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux