* [PATCH 1/1] aacraid: pci_set_dma_max_seg_size opened up for late model controllers [not found] ` <20080206101148L.fujita.tomonori@lab.ntt.co.jp> @ 2008-02-06 17:00 ` Salyzyn, Mark 2008-02-06 17:54 ` James Bottomley 0 siblings, 1 reply; 8+ messages in thread From: Salyzyn, Mark @ 2008-02-06 17:00 UTC (permalink / raw) To: FUJITA Tomonori Cc: tomof@acm.org, akpm@linux-foundation.org, torvalds@linux-foundation.org, James.Bottomley@steeleye.com, jeff@garzik.org, jens.axboe@oracle.com, 'linux-scsi@vger.kernel.org' [-- Attachment #1: Type: text/plain, Size: 2988 bytes --] This patch depends on 'RE: [patch 048/265] iommu sg merging: aacraid: use pci_set_dma_max_seg_size' and ensures that the modern adapters get a maximum sg segment size on par with the maximum transfer size. Added some localized janitor fixes to the discussion patch I used with Fujita. FUJITA Tomonori [mailto:fujita.tomonori@lab.ntt.co.jp] sez: > I think that setting the proper maximum segment size for the late > model cards (as you did above) makes sense. This attached patch is against current linux-2.6. It will not apply to current scsi-misc-2.6 without the above mentioned dependency. ObligatoryDisclaimer: Please accept my condolences regarding Outlook's handling of patch attachments. Please use the attached file to patch Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> drivers/scsi/aacraid/linit.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff -ru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c --- a/drivers/scsi/aacraid/linit.c 2008-02-06 11:35:55.111631591 -0500 +++ b/drivers/scsi/aacraid/linit.c 2008-02-06 11:52:11.095208736 -0500 @@ -1130,31 +1130,29 @@ if (error < 0) goto out_deinit; - if (!(aac->adapter_info.options & AAC_OPT_NEW_COMM)) { - error = pci_set_dma_max_seg_size(pdev, 65536); - if (error) - goto out_deinit; - } - /* * Lets override negotiations and drop the maximum SG limit to 34 */ if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) && - (aac->scsi_host_ptr->sg_tablesize > 34)) { - aac->scsi_host_ptr->sg_tablesize = 34; - aac->scsi_host_ptr->max_sectors - = (aac->scsi_host_ptr->sg_tablesize * 8) + 112; + (shost->sg_tablesize > 34)) { + shost->sg_tablesize = 34; + shost->max_sectors = (shost->sg_tablesize * 8) + 112; } if ((aac_drivers[index].quirks & AAC_QUIRK_17SG) && - (aac->scsi_host_ptr->sg_tablesize > 17)) { - aac->scsi_host_ptr->sg_tablesize = 17; - aac->scsi_host_ptr->max_sectors - = (aac->scsi_host_ptr->sg_tablesize * 8) + 112; + (shost->sg_tablesize > 17)) { + shost->sg_tablesize = 17; + shost->max_sectors = (shost->sg_tablesize * 8) + 112; } + error = pci_set_dma_max_seg_size(pdev, + (aac->adapter_info.options & AAC_OPT_NEW_COMM) ? + (shost->max_sectors << 9) : 65536); + if (error) + goto out_deinit; + /* - * Firware printf works only with older firmware. + * Firmware printf works only with older firmware. */ if (aac_drivers[index].quirks & AAC_QUIRK_34SG) aac->printf_enabled = 1; [-- Attachment #2: aacraid_pci_set_dma.patch --] [-- Type: application/octet-stream, Size: 1595 bytes --] diff -ru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c --- a/drivers/scsi/aacraid/linit.c 2008-02-06 11:35:55.111631591 -0500 +++ b/drivers/scsi/aacraid/linit.c 2008-02-06 11:52:11.095208736 -0500 @@ -1130,31 +1130,29 @@ if (error < 0) goto out_deinit; - if (!(aac->adapter_info.options & AAC_OPT_NEW_COMM)) { - error = pci_set_dma_max_seg_size(pdev, 65536); - if (error) - goto out_deinit; - } - /* * Lets override negotiations and drop the maximum SG limit to 34 */ if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) && - (aac->scsi_host_ptr->sg_tablesize > 34)) { - aac->scsi_host_ptr->sg_tablesize = 34; - aac->scsi_host_ptr->max_sectors - = (aac->scsi_host_ptr->sg_tablesize * 8) + 112; + (shost->sg_tablesize > 34)) { + shost->sg_tablesize = 34; + shost->max_sectors = (shost->sg_tablesize * 8) + 112; } if ((aac_drivers[index].quirks & AAC_QUIRK_17SG) && - (aac->scsi_host_ptr->sg_tablesize > 17)) { - aac->scsi_host_ptr->sg_tablesize = 17; - aac->scsi_host_ptr->max_sectors - = (aac->scsi_host_ptr->sg_tablesize * 8) + 112; + (shost->sg_tablesize > 17)) { + shost->sg_tablesize = 17; + shost->max_sectors = (shost->sg_tablesize * 8) + 112; } + error = pci_set_dma_max_seg_size(pdev, + (aac->adapter_info.options & AAC_OPT_NEW_COMM) ? + (shost->max_sectors << 9) : 65536); + if (error) + goto out_deinit; + /* - * Firware printf works only with older firmware. + * Firmware printf works only with older firmware. */ if (aac_drivers[index].quirks & AAC_QUIRK_34SG) aac->printf_enabled = 1; ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] aacraid: pci_set_dma_max_seg_size opened up for late model controllers 2008-02-06 17:00 ` [PATCH 1/1] aacraid: pci_set_dma_max_seg_size opened up for late model controllers Salyzyn, Mark @ 2008-02-06 17:54 ` James Bottomley 2008-02-06 18:08 ` [PATCH 1/1] aacraid: pci_set_dma_max_seg_size opened up for late model controllers (take 2) Salyzyn, Mark 2008-02-06 21:20 ` [PATCH 1/1] aacraid: add optional MSI support Salyzyn, Mark 0 siblings, 2 replies; 8+ messages in thread From: James Bottomley @ 2008-02-06 17:54 UTC (permalink / raw) To: Salyzyn, Mark Cc: FUJITA Tomonori, tomof@acm.org, akpm@linux-foundation.org, torvalds@linux-foundation.org, jeff@garzik.org, jens.axboe@oracle.com, 'linux-scsi@vger.kernel.org' On Wed, 2008-02-06 at 09:00 -0800, Salyzyn, Mark wrote: > This patch depends on 'RE: [patch 048/265] iommu sg merging: aacraid: use pci_set_dma_max_seg_size' and ensures that the modern adapters get a maximum sg segment size on par with the maximum transfer size. Added some localized janitor fixes to the discussion patch I used with Fujita. > > FUJITA Tomonori [mailto:fujita.tomonori@lab.ntt.co.jp] sez: > > I think that setting the proper maximum segment size for the late > > model cards (as you did above) makes sense. > > This attached patch is against current linux-2.6. It will not apply to current scsi-misc-2.6 without the above mentioned dependency. > > ObligatoryDisclaimer: Please accept my condolences regarding Outlook's handling of patch attachments. Please use the attached file to patch > > Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> OK, I have this, but someone really needs to do a little more checkpatch love: jejb@mulgrave> ./scripts/checkpatch.pl ~/tmp.mail ERROR: use tabs not spaces #44: FILE: drivers/scsi/aacraid/linit.c:1138: + ^I^Ishost->sg_tablesize = 34;$ ERROR: use tabs not spaces #45: FILE: drivers/scsi/aacraid/linit.c:1139: + ^I^Ishost->max_sectors = (shost->sg_tablesize * 8) + 112;$ ERROR: use tabs not spaces #54: FILE: drivers/scsi/aacraid/linit.c:1144: + ^I^Ishost->sg_tablesize = 17;$ ERROR: use tabs not spaces #55: FILE: drivers/scsi/aacraid/linit.c:1145: + ^I^Ishost->max_sectors = (shost->sg_tablesize * 8) + 112;$ ERROR: use tabs not spaces #60: FILE: drivers/scsi/aacraid/linit.c:1150: + ^I^I^I(shost->max_sectors << 9) : 65536);$ total: 5 errors, 0 warnings, 44 lines checked Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS. James ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/1] aacraid: pci_set_dma_max_seg_size opened up for late model controllers (take 2) 2008-02-06 17:54 ` James Bottomley @ 2008-02-06 18:08 ` Salyzyn, Mark 2008-02-06 21:20 ` [PATCH 1/1] aacraid: add optional MSI support Salyzyn, Mark 1 sibling, 0 replies; 8+ messages in thread From: Salyzyn, Mark @ 2008-02-06 18:08 UTC (permalink / raw) To: James Bottomley Cc: FUJITA Tomonori, tomof@acm.org, akpm@linux-foundation.org, torvalds@linux-foundation.org, jeff@garzik.org, jens.axboe@oracle.com, 'linux-scsi@vger.kernel.org' [-- Attachment #1: Type: text/plain, Size: 2762 bytes --] Merde, excuse my english. No idea how those spaces snuck in, a last minute vi fumble finger?! Updated patch enclosed. My apologies for the gaff! Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> drivers/scsi/aacraid/linit.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) Sincerely -- Mark Salyzyn > -----Original Message----- > From: James Bottomley [mailto:James.Bottomley@HansenPartnership.com] > Sent: Wednesday, February 06, 2008 12:55 PM > To: Salyzyn, Mark > Cc: FUJITA Tomonori; tomof@acm.org; > akpm@linux-foundation.org; torvalds@linux-foundation.org; > jeff@garzik.org; jens.axboe@oracle.com; 'linux-scsi@vger.kernel.org' > Subject: Re: [PATCH 1/1] aacraid: pci_set_dma_max_seg_size > opened up for late model controllers > > On Wed, 2008-02-06 at 09:00 -0800, Salyzyn, Mark wrote: > > This patch depends on 'RE: [patch 048/265] iommu sg > merging: aacraid: use pci_set_dma_max_seg_size' and ensures > that the modern adapters get a maximum sg segment size on par > with the maximum transfer size. Added some localized janitor > fixes to the discussion patch I used with Fujita. > > > > FUJITA Tomonori [mailto:fujita.tomonori@lab.ntt.co.jp] sez: > > > I think that setting the proper maximum segment size for the late > > > model cards (as you did above) makes sense. > > > > This attached patch is against current linux-2.6. It will > not apply to current scsi-misc-2.6 without the above > mentioned dependency. > > > > ObligatoryDisclaimer: Please accept my condolences > regarding Outlook's handling of patch attachments. Please use > the attached file to patch > > > > Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> > > OK, I have this, but someone really needs to do a little more > checkpatch > love: > > jejb@mulgrave> ./scripts/checkpatch.pl ~/tmp.mail > ERROR: use tabs not spaces > #44: FILE: drivers/scsi/aacraid/linit.c:1138: > + ^I^Ishost->sg_tablesize = 34;$ > > ERROR: use tabs not spaces > #45: FILE: drivers/scsi/aacraid/linit.c:1139: > + ^I^Ishost->max_sectors = (shost->sg_tablesize * 8) + 112;$ > > ERROR: use tabs not spaces > #54: FILE: drivers/scsi/aacraid/linit.c:1144: > + ^I^Ishost->sg_tablesize = 17;$ > > ERROR: use tabs not spaces > #55: FILE: drivers/scsi/aacraid/linit.c:1145: > + ^I^Ishost->max_sectors = (shost->sg_tablesize * 8) + 112;$ > > ERROR: use tabs not spaces > #60: FILE: drivers/scsi/aacraid/linit.c:1150: > + ^I^I^I(shost->max_sectors << 9) : 65536);$ > > total: 5 errors, 0 warnings, 44 lines checked > > Your patch has style problems, please review. If any of these errors > are false positives report them to the maintainer, see > CHECKPATCH in MAINTAINERS. > > James [-- Attachment #2: aacraid_pci_set_dma1.patch --] [-- Type: application/octet-stream, Size: 1984 bytes --] diff -ru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c --- a/drivers/scsi/aacraid/linit.c 2008-02-06 11:35:55.111631591 -0500 +++ b/drivers/scsi/aacraid/linit.c 2008-02-06 12:59:34.606561834 -0500 @@ -1130,38 +1130,36 @@ if (error < 0) goto out_deinit; - if (!(aac->adapter_info.options & AAC_OPT_NEW_COMM)) { - error = pci_set_dma_max_seg_size(pdev, 65536); - if (error) - goto out_deinit; - } - /* - * Lets override negotiations and drop the maximum SG limit to 34 - */ + * Lets override negotiations and drop the maximum SG limit to 34 + */ if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) && - (aac->scsi_host_ptr->sg_tablesize > 34)) { - aac->scsi_host_ptr->sg_tablesize = 34; - aac->scsi_host_ptr->max_sectors - = (aac->scsi_host_ptr->sg_tablesize * 8) + 112; - } - - if ((aac_drivers[index].quirks & AAC_QUIRK_17SG) && - (aac->scsi_host_ptr->sg_tablesize > 17)) { - aac->scsi_host_ptr->sg_tablesize = 17; - aac->scsi_host_ptr->max_sectors - = (aac->scsi_host_ptr->sg_tablesize * 8) + 112; - } + (shost->sg_tablesize > 34)) { + shost->sg_tablesize = 34; + shost->max_sectors = (shost->sg_tablesize * 8) + 112; + } + + if ((aac_drivers[index].quirks & AAC_QUIRK_17SG) && + (shost->sg_tablesize > 17)) { + shost->sg_tablesize = 17; + shost->max_sectors = (shost->sg_tablesize * 8) + 112; + } + + error = pci_set_dma_max_seg_size(pdev, + (aac->adapter_info.options & AAC_OPT_NEW_COMM) ? + (shost->max_sectors << 9) : 65536); + if (error) + goto out_deinit; /* - * Firware printf works only with older firmware. + * Firmware printf works only with older firmware. */ if (aac_drivers[index].quirks & AAC_QUIRK_34SG) aac->printf_enabled = 1; else aac->printf_enabled = 0; - /* + /* * max channel will be the physical channels plus 1 virtual channel * all containers are on the virtual channel 0 (CONTAINER_CHANNEL) * physical channels are address by their actual physical number+1 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/1] aacraid: add optional MSI support. 2008-02-06 17:54 ` James Bottomley 2008-02-06 18:08 ` [PATCH 1/1] aacraid: pci_set_dma_max_seg_size opened up for late model controllers (take 2) Salyzyn, Mark @ 2008-02-06 21:20 ` Salyzyn, Mark 2008-02-08 0:30 ` James Bottomley 1 sibling, 1 reply; 8+ messages in thread From: Salyzyn, Mark @ 2008-02-06 21:20 UTC (permalink / raw) To: 'linux-scsi@vger.kernel.org' [-- Attachment #1: Type: text/plain, Size: 5509 bytes --] 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@adaptec.com> 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 #2: aacraid_msi.patch --] [-- Type: application/octet-stream, Size: 9812 bytes --] diff -ru 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; module_param(nondasd, int, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices. 0=off, 1=on"); +MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices." + " 0=off, 1=on"); module_param_named(cache, aac_cache, int, S_IRUGO|S_IWUSR); -MODULE_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"); +MODULE_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"); module_param(dacmode, int, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC. 0=off, 1=on"); +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_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the" + " adapter for foreign arrays.\n" + "This 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_PARM_DESC(startup_timeout, "The duration of time in seconds to wait for" + " adapter to have it's kernel up and\n" + "running. This is typically adjusted for large systems that do not" + " have a BIOS."); module_param(aif_timeout, int, S_IRUGO|S_IWUSR); -MODULE_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."); +MODULE_PARM_DESC(aif_timeout, "The duration of time in seconds to wait for" + " applications to pick up AIFs before\n" + "deregistering them. This is typically adjusted for heavily burdened" + " systems."); int numacb = -1; module_param(numacb, int, S_IRUGO|S_IWUSR); -MODULE_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."); +MODULE_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."); int acbsize = -1; module_param(acbsize, int, S_IRUGO|S_IWUSR); -MODULE_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."); +MODULE_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."); int update_interval = 30 * 60; module_param(update_interval, int, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(update_interval, "Interval in seconds between time sync updates issued to adapter."); +MODULE_PARM_DESC(update_interval, "Interval in seconds between time sync" + " updates issued to adapter."); int check_interval = 24 * 60 * 60; module_param(check_interval, int, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(check_interval, "Interval in seconds between adapter health checks."); +MODULE_PARM_DESC(check_interval, "Interval in seconds between adapter health" + " checks."); int aac_check_reset = 1; module_param_named(check_reset, aac_check_reset, int, S_IRUGO|S_IWUSR); -MODULE_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."); +MODULE_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."); int expose_physicals = -1; 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"); +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 -ru 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 -ru 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 @@ -275,9 +275,9 @@ /** * aac_get_driver_ident - * @devtype: index into lookup table + * @devtype: index into lookup table * - * Returns a pointer to the entry in the driver lookup table. + * Returns a pointer to the entry in the driver lookup table. */ struct aac_driver_ident* aac_get_driver_ident(int devtype) @@ -1004,32 +1004,32 @@ static struct scsi_host_template aac_driver_template = { .module = THIS_MODULE, - .name = "AAC", + .name = "AAC", .proc_name = AAC_DRIVERNAME, - .info = aac_info, - .ioctl = aac_ioctl, + .info = aac_info, + .ioctl = aac_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = aac_compat_ioctl, #endif - .queuecommand = aac_queuecommand, - .bios_param = aac_biosparm, + .queuecommand = aac_queuecommand, + .bios_param = aac_biosparm, .shost_attrs = aac_attrs, .slave_configure = aac_slave_configure, .change_queue_depth = aac_change_queue_depth, .sdev_attrs = aac_dev_attrs, .eh_abort_handler = aac_eh_abort, .eh_host_reset_handler = aac_eh_reset, - .can_queue = AAC_NUM_IO_FIB, - .this_id = MAXIMUM_NUM_CONTAINERS, - .sg_tablesize = 16, - .max_sectors = 128, + .can_queue = AAC_NUM_IO_FIB, + .this_id = MAXIMUM_NUM_CONTAINERS, + .sg_tablesize = 16, + .max_sectors = 128, #if (AAC_NUM_IO_FIB > 256) .cmd_per_lun = 256, #else - .cmd_per_lun = AAC_NUM_IO_FIB, + .cmd_per_lun = AAC_NUM_IO_FIB, #endif .use_clustering = ENABLE_CLUSTERING, - .emulated = 1, + .emulated = 1, }; static void __aac_shutdown(struct aac_dev * aac) @@ -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, @@ -1254,7 +1256,7 @@ .id_table = aac_pci_tbl, .probe = aac_probe_one, .remove = __devexit_p(aac_remove_one), - .shutdown = aac_shutdown, + .shutdown = aac_shutdown, }; static int __init aac_init(void) @@ -1271,7 +1273,7 @@ aac_cfg_major = register_chrdev( 0, "aac", &aac_cfg_fops); if (aac_cfg_major < 0) { printk(KERN_WARNING - "aacraid: unable to register \"aac\" device.\n"); + "aacraid: unable to register \"aac\" device.\n"); } return 0; diff -ru 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 -ru 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: ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] aacraid: add optional MSI support. 2008-02-06 21:20 ` [PATCH 1/1] aacraid: add optional MSI support Salyzyn, Mark @ 2008-02-08 0:30 ` James Bottomley 2008-02-08 13:48 ` [PATCH 1/1] aacraid: add optional MSI support (take 2) Salyzyn, Mark 0 siblings, 1 reply; 8+ messages in thread From: James Bottomley @ 2008-02-08 0:30 UTC (permalink / raw) To: Salyzyn, Mark; +Cc: 'linux-scsi@vger.kernel.org' On Wed, 2008-02-06 at 13:20 -0800, Salyzyn, Mark wrote: > 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 It doesn't seem to compile: drivers/scsi/aacraid/sa.c: In function 'aac_sa_init': drivers/scsi/aacraid/sa.c:388: error: dereferencing pointer to incomplete type drivers/scsi/aacraid/sa.c:406: error: dereferencing pointer to incomplete type It looks like this can be corrected by #include <linux/pci.h> since it's struct pci_dev that's the incomplete type. James ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/1] aacraid: add optional MSI support (take 2) 2008-02-08 0:30 ` James Bottomley @ 2008-02-08 13:48 ` Salyzyn, Mark 2008-02-08 16:36 ` [PATCH 1/1] aacraid: ignore adapter reset check polarity Salyzyn, Mark 2008-02-08 17:01 ` [PATCH 1/1] aacraid: informational sysfs value corrections Salyzyn, Mark 0 siblings, 2 replies; 8+ messages in thread From: Salyzyn, Mark @ 2008-02-08 13:48 UTC (permalink / raw) To: James Bottomley; +Cc: 'linux-scsi@vger.kernel.org' [-- Attachment #1: Type: text/plain, Size: 2256 bytes --] Thanks for performing my compile check for me ;-}. You nailed the problem on the head. <excuse>In my efforts to trim down the patch from my internal version of the driver, I neglected to pass the '#include <linux/pci.h>' chunk. Sadly, my only compile check was done against an older FC release, related to the customer request, and one should note that we removed the include <linux/pci.h> line in sa.c in May last year (join_rx_rkt.patch) post that FC release only to need to reinstate it a year later with this patch. Sigh.</excuse> This patch is against current scsi-misc-2.6. It has been checkpatch.pl and compile tested against today's scsi-misc-2.6! ObligatoryDisclaimer: Please accept my condolences regarding Outlook's handling of patch attachments. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> 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 | 5 ++- 5 files changed, 67 insertions(+), 33 deletions(-) Sincerely -- Mark Salyzyn > -----Original Message----- > From: James Bottomley [mailto:James.Bottomley@HansenPartnership.com] > Sent: Thursday, February 07, 2008 7:31 PM > To: Salyzyn, Mark > Cc: 'linux-scsi@vger.kernel.org' > Subject: Re: [PATCH 1/1] aacraid: add optional MSI support. > > > On Wed, 2008-02-06 at 13:20 -0800, Salyzyn, Mark wrote: > > 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 > > It doesn't seem to compile: > > drivers/scsi/aacraid/sa.c: In function 'aac_sa_init': > drivers/scsi/aacraid/sa.c:388: error: dereferencing pointer > to incomplete type > drivers/scsi/aacraid/sa.c:406: error: dereferencing pointer > to incomplete type > > It looks like this can be corrected by #include <linux/pci.h> > since it's > struct pci_dev that's the incomplete type. > > James > > > [-- Attachment #2: aacraid_msi2.patch --] [-- Type: application/octet-stream, Size: 10013 bytes --] diff -ru a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c --- a/drivers/scsi/aacraid/aachba.c 2008-02-08 08:16:24.730003296 -0500 +++ b/drivers/scsi/aacraid/aachba.c 2008-02-08 08:16:59.457633526 -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; module_param(nondasd, int, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices. 0=off, 1=on"); +MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices." + " 0=off, 1=on"); module_param_named(cache, aac_cache, int, S_IRUGO|S_IWUSR); -MODULE_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"); +MODULE_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"); module_param(dacmode, int, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC. 0=off, 1=on"); +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_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the" + " adapter for foreign arrays.\n" + "This 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_PARM_DESC(startup_timeout, "The duration of time in seconds to wait for" + " adapter to have it's kernel up and\n" + "running. This is typically adjusted for large systems that do not" + " have a BIOS."); module_param(aif_timeout, int, S_IRUGO|S_IWUSR); -MODULE_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."); +MODULE_PARM_DESC(aif_timeout, "The duration of time in seconds to wait for" + " applications to pick up AIFs before\n" + "deregistering them. This is typically adjusted for heavily burdened" + " systems."); int numacb = -1; module_param(numacb, int, S_IRUGO|S_IWUSR); -MODULE_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."); +MODULE_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."); int acbsize = -1; module_param(acbsize, int, S_IRUGO|S_IWUSR); -MODULE_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."); +MODULE_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."); int update_interval = 30 * 60; module_param(update_interval, int, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(update_interval, "Interval in seconds between time sync updates issued to adapter."); +MODULE_PARM_DESC(update_interval, "Interval in seconds between time sync" + " updates issued to adapter."); int check_interval = 24 * 60 * 60; module_param(check_interval, int, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(check_interval, "Interval in seconds between adapter health checks."); +MODULE_PARM_DESC(check_interval, "Interval in seconds between adapter health" + " checks."); int aac_check_reset = 1; module_param_named(check_reset, aac_check_reset, int, S_IRUGO|S_IWUSR); -MODULE_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."); +MODULE_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."); int expose_physicals = -1; 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"); +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 -ru a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h --- a/drivers/scsi/aacraid/aacraid.h 2008-02-08 08:16:24.730003296 -0500 +++ b/drivers/scsi/aacraid/aacraid.h 2008-02-08 08:16:59.458633401 -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 -ru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c --- a/drivers/scsi/aacraid/linit.c 2008-02-08 08:16:24.732003044 -0500 +++ b/drivers/scsi/aacraid/linit.c 2008-02-08 08:16:59.459633275 -0500 @@ -275,9 +275,9 @@ /** * aac_get_driver_ident - * @devtype: index into lookup table + * @devtype: index into lookup table * - * Returns a pointer to the entry in the driver lookup table. + * Returns a pointer to the entry in the driver lookup table. */ struct aac_driver_ident* aac_get_driver_ident(int devtype) @@ -1004,32 +1004,32 @@ static struct scsi_host_template aac_driver_template = { .module = THIS_MODULE, - .name = "AAC", + .name = "AAC", .proc_name = AAC_DRIVERNAME, - .info = aac_info, - .ioctl = aac_ioctl, + .info = aac_info, + .ioctl = aac_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = aac_compat_ioctl, #endif - .queuecommand = aac_queuecommand, - .bios_param = aac_biosparm, + .queuecommand = aac_queuecommand, + .bios_param = aac_biosparm, .shost_attrs = aac_attrs, .slave_configure = aac_slave_configure, .change_queue_depth = aac_change_queue_depth, .sdev_attrs = aac_dev_attrs, .eh_abort_handler = aac_eh_abort, .eh_host_reset_handler = aac_eh_reset, - .can_queue = AAC_NUM_IO_FIB, - .this_id = MAXIMUM_NUM_CONTAINERS, - .sg_tablesize = 16, - .max_sectors = 128, + .can_queue = AAC_NUM_IO_FIB, + .this_id = MAXIMUM_NUM_CONTAINERS, + .sg_tablesize = 16, + .max_sectors = 128, #if (AAC_NUM_IO_FIB > 256) .cmd_per_lun = 256, #else - .cmd_per_lun = AAC_NUM_IO_FIB, + .cmd_per_lun = AAC_NUM_IO_FIB, #endif .use_clustering = ENABLE_CLUSTERING, - .emulated = 1, + .emulated = 1, }; static void __aac_shutdown(struct aac_dev * aac) @@ -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, @@ -1254,7 +1256,7 @@ .id_table = aac_pci_tbl, .probe = aac_probe_one, .remove = __devexit_p(aac_remove_one), - .shutdown = aac_shutdown, + .shutdown = aac_shutdown, }; static int __init aac_init(void) @@ -1271,7 +1273,7 @@ aac_cfg_major = register_chrdev( 0, "aac", &aac_cfg_fops); if (aac_cfg_major < 0) { printk(KERN_WARNING - "aacraid: unable to register \"aac\" device.\n"); + "aacraid: unable to register \"aac\" device.\n"); } return 0; diff -ru a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c --- a/drivers/scsi/aacraid/rx.c 2008-02-08 08:16:24.733002918 -0500 +++ b/drivers/scsi/aacraid/rx.c 2008-02-08 08:16:59.460633149 -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 -ru a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c --- a/drivers/scsi/aacraid/sa.c 2008-02-08 08:16:24.733002918 -0500 +++ b/drivers/scsi/aacraid/sa.c 2008-02-08 08:18:00.371968172 -0500 @@ -31,6 +31,7 @@ #include <linux/kernel.h> #include <linux/init.h> #include <linux/types.h> +#include <linux/pci.h> #include <linux/spinlock.h> #include <linux/slab.h> #include <linux/blkdev.h> @@ -385,7 +386,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 +404,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: ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/1] aacraid: ignore adapter reset check polarity 2008-02-08 13:48 ` [PATCH 1/1] aacraid: add optional MSI support (take 2) Salyzyn, Mark @ 2008-02-08 16:36 ` Salyzyn, Mark 2008-02-08 17:01 ` [PATCH 1/1] aacraid: informational sysfs value corrections Salyzyn, Mark 1 sibling, 0 replies; 8+ messages in thread From: Salyzyn, Mark @ 2008-02-08 16:36 UTC (permalink / raw) To: 'linux-scsi@vger.kernel.org' [-- Attachment #1: Type: text/plain, Size: 537 bytes --] The Adapter's Ignore Reset flag and insmod parameter boolean polarity is incorrect in the driver. This attached patch is against current scsi-misc-2.6. ObligatoryDisclaimer: Please accept my condolences regarding Outlook's handling of patch attachments. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> drivers/scsi/aacraid/aachba.c | 14 ++++++++------ drivers/scsi/aacraid/commsup.c | 2 +- drivers/scsi/aacraid/linit.c | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) Sincerely - Mark Salyzyn [-- Attachment #2: aacraid_ignore_reset.patch --] [-- Type: application/octet-stream, Size: 2887 bytes --] diff -ru a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c --- a/drivers/scsi/aacraid/aachba.c 2008-02-08 11:22:43.495295723 -0500 +++ b/drivers/scsi/aacraid/aachba.c 2008-02-08 11:29:27.920669929 -0500 @@ -1315,7 +1315,7 @@ (int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid), dev->supplement_adapter_info.VpdInfo.Tsid); } - if (!aac_check_reset || ((aac_check_reset != 1) && + if (!aac_check_reset || ((aac_check_reset == 1) && (dev->supplement_adapter_info.SupportedOptions2 & AAC_OPTION_IGNORE_RESET))) { printk(KERN_INFO "%s%d: Reset Adapter Ignored\n", @@ -1353,13 +1353,14 @@ if (nondasd != -1) dev->nondasd_support = (nondasd!=0); - if(dev->nondasd_support != 0) { + if (dev->nondasd_support && !dev->in_reset) printk(KERN_INFO "%s%d: Non-DASD support enabled.\n",dev->name, dev->id); - } dev->dac_support = 0; if( (sizeof(dma_addr_t) > 4) && (dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)){ - printk(KERN_INFO "%s%d: 64bit support enabled.\n", dev->name, dev->id); + if (!dev->in_reset) + printk(KERN_INFO "%s%d: 64bit support enabled.\n", + dev->name, dev->id); dev->dac_support = 1; } @@ -1369,8 +1370,9 @@ if(dev->dac_support != 0) { if (!pci_set_dma_mask(dev->pdev, DMA_64BIT_MASK) && !pci_set_consistent_dma_mask(dev->pdev, DMA_64BIT_MASK)) { - printk(KERN_INFO"%s%d: 64 Bit DAC enabled\n", - dev->name, dev->id); + if (!dev->in_reset) + printk(KERN_INFO"%s%d: 64 Bit DAC enabled\n", + dev->name, dev->id); } else if (!pci_set_dma_mask(dev->pdev, DMA_32BIT_MASK) && !pci_set_consistent_dma_mask(dev->pdev, DMA_32BIT_MASK)) { printk(KERN_INFO"%s%d: DMA mask set failed, 64 Bit DAC disabled\n", diff -ru a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c --- a/drivers/scsi/aacraid/commsup.c 2008-02-08 11:22:43.496295598 -0500 +++ b/drivers/scsi/aacraid/commsup.c 2008-02-08 11:26:58.389394436 -0500 @@ -1458,7 +1458,7 @@ printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED); - if (!aac_check_reset || ((aac_check_reset != 1) && + if (!aac_check_reset || ((aac_check_reset == 1) && (aac->supplement_adapter_info.SupportedOptions2 & AAC_OPTION_IGNORE_RESET))) goto out; diff -ru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c --- a/drivers/scsi/aacraid/linit.c 2008-02-08 11:22:43.497295473 -0500 +++ b/drivers/scsi/aacraid/linit.c 2008-02-08 11:26:58.390394311 -0500 @@ -641,7 +641,7 @@ AAC_OPTION_MU_RESET) && aac_check_reset && ((aac_check_reset != 1) || - (aac->supplement_adapter_info.SupportedOptions2 & + !(aac->supplement_adapter_info.SupportedOptions2 & AAC_OPTION_IGNORE_RESET))) aac_reset_adapter(aac, 2); /* Bypass wait for command quiesce */ return SUCCESS; /* Cause an immediate retry of the command with a ten second delay after successful tur */ ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/1] aacraid: informational sysfs value corrections 2008-02-08 13:48 ` [PATCH 1/1] aacraid: add optional MSI support (take 2) Salyzyn, Mark 2008-02-08 16:36 ` [PATCH 1/1] aacraid: ignore adapter reset check polarity Salyzyn, Mark @ 2008-02-08 17:01 ` Salyzyn, Mark 1 sibling, 0 replies; 8+ messages in thread From: Salyzyn, Mark @ 2008-02-08 17:01 UTC (permalink / raw) To: 'linux-scsi@vger.kernel.org' [-- Attachment #1: Type: text/plain, Size: 2272 bytes --] Some sysfs problems reported. The serial number on late model controllers was truncated. Non-DASD devices (tapes and CDROMs) were showing up as JBOD in the level report on the physical channel. This attached patch is against current scsi-misc-2.6. ObligatoryDisclaimer: Please accept my condolences regarding Outlook's handling of patch attachments (inline gets damaged, please use attachment). Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> drivers/scsi/aacraid/linit.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff -ru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c --- a/drivers/scsi/aacraid/linit.c 2008-02-08 11:22:43.497295473 -0500 +++ b/drivers/scsi/aacraid/linit.c 2008-02-08 11:51:52.376880890 -0500 @@ -494,13 +494,14 @@ static ssize_t aac_show_raid_level(struct device *dev, struct device_attribute *attr, char *buf) { - struct scsi_device * sdev = to_scsi_device(dev); + struct scsi_device *sdev = to_scsi_device(dev); + struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); if (sdev_channel(sdev) != CONTAINER_CHANNEL) return snprintf(buf, PAGE_SIZE, sdev->no_uld_attach - ? "Hidden\n" : "JBOD"); + ? "Hidden\n" : + ((aac->jbod && (sdev->type == TYPE_DISK)) ? "JBOD\n" : "")); return snprintf(buf, PAGE_SIZE, "%s\n", - get_container_type(((struct aac_dev *)(sdev->host->hostdata)) - ->fsa_dev[sdev_id(sdev)].type)); + get_container_type(aac->fsa_dev[sdev_id(sdev)].type)); } static struct device_attribute aac_raid_level_attr = { @@ -860,8 +861,8 @@ le32_to_cpu(dev->adapter_info.serial[0])); if (len && !memcmp(&dev->supplement_adapter_info.MfgPcbaSerialNo[ - sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo)+2-len], - buf, len)) + sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo)-len], + buf, len-1)) len = snprintf(buf, PAGE_SIZE, "%.*s\n", (int)sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo), dev->supplement_adapter_info.MfgPcbaSerialNo); Sincerely - Mark Salyzyn [-- Attachment #2: aacraid_serial_level_sysfs.patch --] [-- Type: application/octet-stream, Size: 1453 bytes --] diff -ru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c --- a/drivers/scsi/aacraid/linit.c 2008-02-08 11:22:43.497295473 -0500 +++ b/drivers/scsi/aacraid/linit.c 2008-02-08 11:51:52.376880890 -0500 @@ -494,13 +494,14 @@ static ssize_t aac_show_raid_level(struct device *dev, struct device_attribute *attr, char *buf) { - struct scsi_device * sdev = to_scsi_device(dev); + struct scsi_device *sdev = to_scsi_device(dev); + struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata); if (sdev_channel(sdev) != CONTAINER_CHANNEL) return snprintf(buf, PAGE_SIZE, sdev->no_uld_attach - ? "Hidden\n" : "JBOD"); + ? "Hidden\n" : + ((aac->jbod && (sdev->type == TYPE_DISK)) ? "JBOD\n" : "")); return snprintf(buf, PAGE_SIZE, "%s\n", - get_container_type(((struct aac_dev *)(sdev->host->hostdata)) - ->fsa_dev[sdev_id(sdev)].type)); + get_container_type(aac->fsa_dev[sdev_id(sdev)].type)); } static struct device_attribute aac_raid_level_attr = { @@ -860,8 +861,8 @@ le32_to_cpu(dev->adapter_info.serial[0])); if (len && !memcmp(&dev->supplement_adapter_info.MfgPcbaSerialNo[ - sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo)+2-len], - buf, len)) + sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo)-len], + buf, len-1)) len = snprintf(buf, PAGE_SIZE, "%.*s\n", (int)sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo), dev->supplement_adapter_info.MfgPcbaSerialNo); ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-02-08 17:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <532ABFBDAAC3A34EB12EBA6CEC2838F4397D643D@ADPE2K703.adaptec.com>
[not found] ` <20080205234912B.tomof@acm.org>
[not found] ` <532ABFBDAAC3A34EB12EBA6CEC2838F4397D6932@ADPE2K703.adaptec.com>
[not found] ` <20080206101148L.fujita.tomonori@lab.ntt.co.jp>
2008-02-06 17:00 ` [PATCH 1/1] aacraid: pci_set_dma_max_seg_size opened up for late model controllers Salyzyn, Mark
2008-02-06 17:54 ` James Bottomley
2008-02-06 18:08 ` [PATCH 1/1] aacraid: pci_set_dma_max_seg_size opened up for late model controllers (take 2) Salyzyn, Mark
2008-02-06 21:20 ` [PATCH 1/1] aacraid: add optional MSI support Salyzyn, Mark
2008-02-08 0:30 ` James Bottomley
2008-02-08 13:48 ` [PATCH 1/1] aacraid: add optional MSI support (take 2) Salyzyn, Mark
2008-02-08 16:36 ` [PATCH 1/1] aacraid: ignore adapter reset check polarity Salyzyn, Mark
2008-02-08 17:01 ` [PATCH 1/1] aacraid: informational sysfs value corrections Salyzyn, Mark
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox