aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid
diff options
context:
space:
mode:
authorSalyzyn, Mark <Mark_Salyzyn@adaptec.com>2008-02-08 08:48:22 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-02-11 11:20:54 -0500
commit8ef2224707996aede1808f40116cd467b7c8d549 (patch)
tree4e5889e402e8770b28f9b27f52ebf28c3034b3a3 /drivers/scsi/aacraid
parent07df8afa0dd54b8b89ad8aa93994c0d55a4a5921 (diff)
[SCSI] aacraid: add optional MSI support
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. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/aacraid')
-rw-r--r--drivers/scsi/aacraid/aachba.c56
-rw-r--r--drivers/scsi/aacraid/aacraid.h2
-rw-r--r--drivers/scsi/aacraid/linit.c32
-rw-r--r--drivers/scsi/aacraid/rx.c5
-rw-r--r--drivers/scsi/aacraid/sa.c5
5 files changed, 67 insertions, 33 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index bfd0e64964ac..f8d2ae301283 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -144,51 +144,77 @@ static char *aac_get_status_string(u32 status);
144 */ 144 */
145 145
146static int nondasd = -1; 146static int nondasd = -1;
147static int aac_cache = 0; 147static int aac_cache;
148static int dacmode = -1; 148static int dacmode = -1;
149 149int aac_msi;
150int aac_commit = -1; 150int aac_commit = -1;
151int startup_timeout = 180; 151int startup_timeout = 180;
152int aif_timeout = 120; 152int aif_timeout = 120;
153 153
154module_param(nondasd, int, S_IRUGO|S_IWUSR); 154module_param(nondasd, int, S_IRUGO|S_IWUSR);
155MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices. 0=off, 1=on"); 155MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices."
156 " 0=off, 1=on");
156module_param_named(cache, aac_cache, int, S_IRUGO|S_IWUSR); 157module_param_named(cache, aac_cache, int, S_IRUGO|S_IWUSR);
157MODULE_PARM_DESC(cache, "Disable Queue Flush commands:\n\tbit 0 - Disable FUA in WRITE SCSI commands\n\tbit 1 - Disable SYNCHRONIZE_CACHE SCSI command\n\tbit 2 - Disable only if Battery not protecting Cache"); 158MODULE_PARM_DESC(cache, "Disable Queue Flush commands:\n"
159 "\tbit 0 - Disable FUA in WRITE SCSI commands\n"
160 "\tbit 1 - Disable SYNCHRONIZE_CACHE SCSI command\n"
161 "\tbit 2 - Disable only if Battery not protecting Cache");
158module_param(dacmode, int, S_IRUGO|S_IWUSR); 162module_param(dacmode, int, S_IRUGO|S_IWUSR);
159MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC. 0=off, 1=on"); 163MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC."
164 " 0=off, 1=on");
160module_param_named(commit, aac_commit, int, S_IRUGO|S_IWUSR); 165module_param_named(commit, aac_commit, int, S_IRUGO|S_IWUSR);
161MODULE_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"); 166MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the"
167 " adapter for foreign arrays.\n"
168 "This is typically needed in systems that do not have a BIOS."
169 " 0=off, 1=on");
170module_param_named(msi, aac_msi, int, S_IRUGO|S_IWUSR);
171MODULE_PARM_DESC(msi, "IRQ handling."
172 " 0=PIC(default), 1=MSI, 2=MSI-X(unsupported, uses MSI)");
162module_param(startup_timeout, int, S_IRUGO|S_IWUSR); 173module_param(startup_timeout, int, S_IRUGO|S_IWUSR);
163MODULE_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."); 174MODULE_PARM_DESC(startup_timeout, "The duration of time in seconds to wait for"
175 " adapter to have it's kernel up and\n"
176 "running. This is typically adjusted for large systems that do not"
177 " have a BIOS.");
164module_param(aif_timeout, int, S_IRUGO|S_IWUSR); 178module_param(aif_timeout, int, S_IRUGO|S_IWUSR);
165MODULE_PARM_DESC(aif_timeout, "The duration of time in seconds to wait for applications to pick up AIFs before\nderegistering them. This is typically adjusted for heavily burdened systems."); 179MODULE_PARM_DESC(aif_timeout, "The duration of time in seconds to wait for"
180 " applications to pick up AIFs before\n"
181 "deregistering them. This is typically adjusted for heavily burdened"
182 " systems.");
166 183
167int numacb = -1; 184int numacb = -1;
168module_param(numacb, int, S_IRUGO|S_IWUSR); 185module_param(numacb, int, S_IRUGO|S_IWUSR);
169MODULE_PARM_DESC(numacb, "Request a limit to the number of adapter control blocks (FIB) allocated. Valid values are 512 and down. Default is to use suggestion from Firmware."); 186MODULE_PARM_DESC(numacb, "Request a limit to the number of adapter control"
187 " blocks (FIB) allocated. Valid values are 512 and down. Default is"
188 " to use suggestion from Firmware.");
170 189
171int acbsize = -1; 190int acbsize = -1;
172module_param(acbsize, int, S_IRUGO|S_IWUSR); 191module_param(acbsize, int, S_IRUGO|S_IWUSR);
173MODULE_PARM_DESC(acbsize, "Request a specific adapter control block (FIB) size. Valid values are 512, 2048, 4096 and 8192. Default is to use suggestion from Firmware."); 192MODULE_PARM_DESC(acbsize, "Request a specific adapter control block (FIB)"
193 " size. Valid values are 512, 2048, 4096 and 8192. Default is to use"
194 " suggestion from Firmware.");
174 195
175int update_interval = 30 * 60; 196int update_interval = 30 * 60;
176module_param(update_interval, int, S_IRUGO|S_IWUSR); 197module_param(update_interval, int, S_IRUGO|S_IWUSR);
177MODULE_PARM_DESC(update_interval, "Interval in seconds between time sync updates issued to adapter."); 198MODULE_PARM_DESC(update_interval, "Interval in seconds between time sync"
199 " updates issued to adapter.");
178 200
179int check_interval = 24 * 60 * 60; 201int check_interval = 24 * 60 * 60;
180module_param(check_interval, int, S_IRUGO|S_IWUSR); 202module_param(check_interval, int, S_IRUGO|S_IWUSR);
181MODULE_PARM_DESC(check_interval, "Interval in seconds between adapter health checks."); 203MODULE_PARM_DESC(check_interval, "Interval in seconds between adapter health"
204 " checks.");
182 205
183int aac_check_reset = 1; 206int aac_check_reset = 1;
184module_param_named(check_reset, aac_check_reset, int, S_IRUGO|S_IWUSR); 207module_param_named(check_reset, aac_check_reset, int, S_IRUGO|S_IWUSR);
185MODULE_PARM_DESC(aac_check_reset, "If adapter fails health check, reset the adapter. a value of -1 forces the reset to adapters programmed to ignore it."); 208MODULE_PARM_DESC(aac_check_reset, "If adapter fails health check, reset the"
209 " adapter. a value of -1 forces the reset to adapters programmed to"
210 " ignore it.");
186 211
187int expose_physicals = -1; 212int expose_physicals = -1;
188module_param(expose_physicals, int, S_IRUGO|S_IWUSR); 213module_param(expose_physicals, int, S_IRUGO|S_IWUSR);
189MODULE_PARM_DESC(expose_physicals, "Expose physical components of the arrays. -1=protect 0=off, 1=on"); 214MODULE_PARM_DESC(expose_physicals, "Expose physical components of the arrays."
215 " -1=protect 0=off, 1=on");
190 216
191int aac_reset_devices = 0; 217int aac_reset_devices;
192module_param_named(reset_devices, aac_reset_devices, int, S_IRUGO|S_IWUSR); 218module_param_named(reset_devices, aac_reset_devices, int, S_IRUGO|S_IWUSR);
193MODULE_PARM_DESC(reset_devices, "Force an adapter reset at initialization."); 219MODULE_PARM_DESC(reset_devices, "Force an adapter reset at initialization.");
194 220
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 3195d29f2177..ace0b751c131 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -1026,6 +1026,7 @@ struct aac_dev
1026 u8 raw_io_64; 1026 u8 raw_io_64;
1027 u8 printf_enabled; 1027 u8 printf_enabled;
1028 u8 in_reset; 1028 u8 in_reset;
1029 u8 msi;
1029}; 1030};
1030 1031
1031#define aac_adapter_interrupt(dev) \ 1032#define aac_adapter_interrupt(dev) \
@@ -1881,6 +1882,7 @@ extern int startup_timeout;
1881extern int aif_timeout; 1882extern int aif_timeout;
1882extern int expose_physicals; 1883extern int expose_physicals;
1883extern int aac_reset_devices; 1884extern int aac_reset_devices;
1885extern int aac_msi;
1884extern int aac_commit; 1886extern int aac_commit;
1885extern int update_interval; 1887extern int update_interval;
1886extern int check_interval; 1888extern int check_interval;
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index e80d2a0c46af..7232e7326ded 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -275,9 +275,9 @@ static const char *aac_info(struct Scsi_Host *shost)
275 275
276/** 276/**
277 * aac_get_driver_ident 277 * aac_get_driver_ident
278 * @devtype: index into lookup table 278 * @devtype: index into lookup table
279 * 279 *
280 * Returns a pointer to the entry in the driver lookup table. 280 * Returns a pointer to the entry in the driver lookup table.
281 */ 281 */
282 282
283struct aac_driver_ident* aac_get_driver_ident(int devtype) 283struct aac_driver_ident* aac_get_driver_ident(int devtype)
@@ -1004,32 +1004,32 @@ static const struct file_operations aac_cfg_fops = {
1004 1004
1005static struct scsi_host_template aac_driver_template = { 1005static struct scsi_host_template aac_driver_template = {
1006 .module = THIS_MODULE, 1006 .module = THIS_MODULE,
1007 .name = "AAC", 1007 .name = "AAC",
1008 .proc_name = AAC_DRIVERNAME, 1008 .proc_name = AAC_DRIVERNAME,
1009 .info = aac_info, 1009 .info = aac_info,
1010 .ioctl = aac_ioctl, 1010 .ioctl = aac_ioctl,
1011#ifdef CONFIG_COMPAT 1011#ifdef CONFIG_COMPAT
1012 .compat_ioctl = aac_compat_ioctl, 1012 .compat_ioctl = aac_compat_ioctl,
1013#endif 1013#endif
1014 .queuecommand = aac_queuecommand, 1014 .queuecommand = aac_queuecommand,
1015 .bios_param = aac_biosparm, 1015 .bios_param = aac_biosparm,
1016 .shost_attrs = aac_attrs, 1016 .shost_attrs = aac_attrs,
1017 .slave_configure = aac_slave_configure, 1017 .slave_configure = aac_slave_configure,
1018 .change_queue_depth = aac_change_queue_depth, 1018 .change_queue_depth = aac_change_queue_depth,
1019 .sdev_attrs = aac_dev_attrs, 1019 .sdev_attrs = aac_dev_attrs,
1020 .eh_abort_handler = aac_eh_abort, 1020 .eh_abort_handler = aac_eh_abort,
1021 .eh_host_reset_handler = aac_eh_reset, 1021 .eh_host_reset_handler = aac_eh_reset,
1022 .can_queue = AAC_NUM_IO_FIB, 1022 .can_queue = AAC_NUM_IO_FIB,
1023 .this_id = MAXIMUM_NUM_CONTAINERS, 1023 .this_id = MAXIMUM_NUM_CONTAINERS,
1024 .sg_tablesize = 16, 1024 .sg_tablesize = 16,
1025 .max_sectors = 128, 1025 .max_sectors = 128,
1026#if (AAC_NUM_IO_FIB > 256) 1026#if (AAC_NUM_IO_FIB > 256)
1027 .cmd_per_lun = 256, 1027 .cmd_per_lun = 256,
1028#else 1028#else
1029 .cmd_per_lun = AAC_NUM_IO_FIB, 1029 .cmd_per_lun = AAC_NUM_IO_FIB,
1030#endif 1030#endif
1031 .use_clustering = ENABLE_CLUSTERING, 1031 .use_clustering = ENABLE_CLUSTERING,
1032 .emulated = 1, 1032 .emulated = 1,
1033}; 1033};
1034 1034
1035static void __aac_shutdown(struct aac_dev * aac) 1035static void __aac_shutdown(struct aac_dev * aac)
@@ -1039,6 +1039,8 @@ static void __aac_shutdown(struct aac_dev * aac)
1039 aac_send_shutdown(aac); 1039 aac_send_shutdown(aac);
1040 aac_adapter_disable_int(aac); 1040 aac_adapter_disable_int(aac);
1041 free_irq(aac->pdev->irq, aac); 1041 free_irq(aac->pdev->irq, aac);
1042 if (aac->msi)
1043 pci_disable_msi(aac->pdev);
1042} 1044}
1043 1045
1044static int __devinit aac_probe_one(struct pci_dev *pdev, 1046static int __devinit aac_probe_one(struct pci_dev *pdev,
@@ -1254,7 +1256,7 @@ static struct pci_driver aac_pci_driver = {
1254 .id_table = aac_pci_tbl, 1256 .id_table = aac_pci_tbl,
1255 .probe = aac_probe_one, 1257 .probe = aac_probe_one,
1256 .remove = __devexit_p(aac_remove_one), 1258 .remove = __devexit_p(aac_remove_one),
1257 .shutdown = aac_shutdown, 1259 .shutdown = aac_shutdown,
1258}; 1260};
1259 1261
1260static int __init aac_init(void) 1262static int __init aac_init(void)
@@ -1271,7 +1273,7 @@ static int __init aac_init(void)
1271 aac_cfg_major = register_chrdev( 0, "aac", &aac_cfg_fops); 1273 aac_cfg_major = register_chrdev( 0, "aac", &aac_cfg_fops);
1272 if (aac_cfg_major < 0) { 1274 if (aac_cfg_major < 0) {
1273 printk(KERN_WARNING 1275 printk(KERN_WARNING
1274 "aacraid: unable to register \"aac\" device.\n"); 1276 "aacraid: unable to register \"aac\" device.\n");
1275 } 1277 }
1276 1278
1277 return 0; 1279 return 0;
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index a08bbf1fd76c..1f18b83e1e02 100644
--- a/drivers/scsi/aacraid/rx.c
+++ b/drivers/scsi/aacraid/rx.c
@@ -625,8 +625,11 @@ int _aac_rx_init(struct aac_dev *dev)
625 if (aac_init_adapter(dev) == NULL) 625 if (aac_init_adapter(dev) == NULL)
626 goto error_iounmap; 626 goto error_iounmap;
627 aac_adapter_comm(dev, dev->comm_interface); 627 aac_adapter_comm(dev, dev->comm_interface);
628 if (request_irq(dev->scsi_host_ptr->irq, dev->a_ops.adapter_intr, 628 dev->msi = aac_msi && !pci_enable_msi(dev->pdev);
629 if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
629 IRQF_SHARED|IRQF_DISABLED, "aacraid", dev) < 0) { 630 IRQF_SHARED|IRQF_DISABLED, "aacraid", dev) < 0) {
631 if (dev->msi)
632 pci_disable_msi(dev->pdev);
630 printk(KERN_ERR "%s%d: Interrupt unavailable.\n", 633 printk(KERN_ERR "%s%d: Interrupt unavailable.\n",
631 name, instance); 634 name, instance);
632 goto error_iounmap; 635 goto error_iounmap;
diff --git a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c
index 85b91bc578c9..cfc3410ec073 100644
--- a/drivers/scsi/aacraid/sa.c
+++ b/drivers/scsi/aacraid/sa.c
@@ -31,6 +31,7 @@
31#include <linux/kernel.h> 31#include <linux/kernel.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/types.h> 33#include <linux/types.h>
34#include <linux/pci.h>
34#include <linux/spinlock.h> 35#include <linux/spinlock.h>
35#include <linux/slab.h> 36#include <linux/slab.h>
36#include <linux/blkdev.h> 37#include <linux/blkdev.h>
@@ -385,7 +386,7 @@ int aac_sa_init(struct aac_dev *dev)
385 386
386 if(aac_init_adapter(dev) == NULL) 387 if(aac_init_adapter(dev) == NULL)
387 goto error_irq; 388 goto error_irq;
388 if (request_irq(dev->scsi_host_ptr->irq, dev->a_ops.adapter_intr, 389 if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
389 IRQF_SHARED|IRQF_DISABLED, 390 IRQF_SHARED|IRQF_DISABLED,
390 "aacraid", (void *)dev ) < 0) { 391 "aacraid", (void *)dev ) < 0) {
391 printk(KERN_WARNING "%s%d: Interrupt unavailable.\n", 392 printk(KERN_WARNING "%s%d: Interrupt unavailable.\n",
@@ -403,7 +404,7 @@ int aac_sa_init(struct aac_dev *dev)
403 404
404error_irq: 405error_irq:
405 aac_sa_disable_interrupt(dev); 406 aac_sa_disable_interrupt(dev);
406 free_irq(dev->scsi_host_ptr->irq, (void *)dev); 407 free_irq(dev->pdev->irq, (void *)dev);
407 408
408error_iounmap: 409error_iounmap:
409 410