aacraid driver fails with Dell PowerEdge Expandable RAID Controller 3/Di
Subsystems (2)
PATCH 20/23 aacraid driver fails with Dell PowerEdge Expandable RAID Controller 3/Di
From: "Salyzyn, Mark" <[email protected]>
As reported in http://bugzilla.kernel.org/show_bug.cgi?id=3D9133 it was discovered that the PERC line of controllers lacked a key 64 bit ScatterGather capable SCSI pass-through function. The adapters are still capable of 64 bit ScatterGather I/O commands, but these two can not be mixed. This problem was exacerbated by the introduction of the SCSI Generic access to the DASD physical devices.
The fix for users before this patch is applied is aacraid.dacmode=3D0 on the kernel command line to disable 64 bit I/O.
The enclosed patch introduces a new adapter quirk and tries to limp along by enabling pass-through in situations where memory is 32 bit addressable on 64 bit machines, or disable the pass-through functions altogether. I expect that the check for 32 bit addressable memory to be controversial in that it can be incorrect in non-Dell non-Intel systems that PERC would never be installed under, the alternative is to disable pass-through in all cases which could be reported as another regression.
Pass-through is used for SCSI Generic access to the physical devices, or for the management applications to properly function.
In systems where this patch has disabled pass-through because it is unsupportable in combination with I/O performance, the user can choose to enable pass-through by turning off dacmode (aacraid.dacmode=3D0) or limiting the discovered kernel memory (mem=3D4G) with an associated loss in runtime performance. If we chose instead to turn off 64 bit dacmode for the adapters with this quirk, then this would be reported as another regression.
---
drivers/scsi/aacraid/aachba.c | 15 ++++++++++- drivers/scsi/aacraid/aacraid.h | 6 ++++ drivers/scsi/aacraid/commsup.c | 6 ++-- drivers/scsi/aacraid/linit.c | 42 +++++++++++++++++-------------- 4 files changed, 47 insertions(+), 22 deletions(-)
drivers/scsi/aacraid/aachba.c renamed from drivers/scsi/aacraid/aachba.c~aacraid-driver-fails-with-dell-poweredge-expandable-raid-controller-3-di +14 -1
@@ -1190,6 +1190,15 @@ static int aac_scsi_32(struct fib * fib, (fib_callback) aac_srb_callback, (void *) cmd); } +static int aac_scsi_32_64 (struct fib * fib,struct scsi_cmnd * cmd) +{ +if ((sizeof (dma_addr_t) >4 ) && + (num_physpages > (0xFFFFFFFFULL >>PAGE_SHIFT )) && + (fib->dev->adapter_info.options &AAC_OPT_SGMAP_HOST64 )) +return FAILED ; +return aac_scsi_32 (fib, cmd); +} +int aac_get_adapter_info (struct aac_dev * dev) {struct fib * fibptr;
@@ -1267,6 +1276,8 @@ int aac_get_adapter_info(struct aac_dev*1 ,1 , NULL, NULL); +/* reasoned default */ + dev->maximum_num_physicals =16 ;if (rcode >=0 &&le32_to_cpu (bus_info->Status) ==ST_OK ) { dev->maximum_num_physicals =le32_to_cpu (bus_info->TargetsPerBus); dev->maximum_num_channels =le32_to_cpu (bus_info->BusCount);
@@ -1376,7 +1387,9 @@ int aac_get_adapter_info(struct aac_dev** interface. */ dev->a_ops.adapter_scsi = (dev->dac_support) - ? aac_scsi_64 + ? ((aac_get_driver_ident (dev->cardtype)->quirks &AAC_QUIRK_SCSI_32 ) + ? aac_scsi_32_64 + : aac_scsi_64) : aac_scsi_32;if (dev->raw_io_interface) { dev->a_ops.adapter_bounds = (dev->raw_io_64)
drivers/scsi/aacraid/aacraid.h renamed from drivers/scsi/aacraid/aacraid.h~aacraid-driver-fails-with-dell-poweredge-expandable-raid-controller-3-di +6 -0
@@ -521,6 +521,12 @@ struct aac_driver_ident#define AAC_QUIRK_17SG 0x0010/* +* Some adapter firmware does not support 64 bit scsi passthrough +* commands. +*/ +#define AAC_QUIRK_SCSI_32 0x0020 + +/* * The adapter interface specs all queues to be located in the same * physically contigous block. The host structure that defines the * commuication queues will assume they are each a separate physically
drivers/scsi/aacraid/commsup.c renamed from drivers/scsi/aacraid/commsup.c~aacraid-driver-fails-with-dell-poweredge-expandable-raid-controller-3-di +3 -3
@@ -1099,7 +1099,8 @@ static int _aac_reset_adapter(struct aacfree_irq (aac->pdev->irq, aac);kfree (aac->fsa_dev); aac->fsa_dev =NULL ; -if (aac_get_driver_ident (index)->quirks &AAC_QUIRK_31BIT ) { + quirks =aac_get_driver_ident (index)->quirks; +if (quirks &AAC_QUIRK_31BIT ) {if (((retval =pci_set_dma_mask (aac->pdev,DMA_31BIT_MASK ))) || ((retval =pci_set_consistent_dma_mask (aac->pdev,DMA_31BIT_MASK )))) goto out;
@@ -1110,7 +1111,7 @@ static int _aac_reset_adapter(struct aac }if ((retval = (*(aac_get_driver_ident (index)->init))(aac))) goto out; -if (aac_get_driver_ident (index)->quirks &AAC_QUIRK_31BIT ) +if (quirks &AAC_QUIRK_31BIT )if ((retval =pci_set_dma_mask (aac->pdev,DMA_32BIT_MASK ))) goto out;if (jafo) {
@@ -1121,7 +1122,6 @@ static int _aac_reset_adapter(struct aac } } (void )aac_get_adapter_info (aac); - quirks =aac_get_driver_ident (index)->quirks;if ((quirks &AAC_QUIRK_34SG ) && (host->sg_tablesize >34 )) { host->sg_tablesize =34 ; host->max_sectors = (host->sg_tablesize *8 ) +112 ;
drivers/scsi/aacraid/linit.c renamed from drivers/scsi/aacraid/linit.c~aacraid-driver-fails-with-dell-poweredge-expandable-raid-controller-3-di +24 -18
60 lines not on this page · raw message
_
In article <[email protected]> you write:
Quoted 9 lines
Path: news.xs4all.nl!newsspool.news.xs4all.nl!post.news.xs4all.nl!gateway The enclosed patch introduces a new adapter quirk and tries to limp along by enabling pass-through in situations where memory is 32 bit addressable on 64 bit machines, or disable the pass-through functions altogether. I expect that the check for 32 bit addressable memory to be controversial in that it can be incorrect in non-Dell non-Intel systems that PERC would never be installed under, the alternative is to disable pass-through in all cases which could be reported as another regression.
drivers/scsi/aacraid/aachba.c static int aac_scsi_32(struct fib * fib, · line 1200
Quoted 8 lines
drivers/scsi/aacraid/aachba.c renamed from drivers/scsi/aacraid/aachba.c~aacraid-driver-fails-with-dell-poweredge-expandable-raid-controller-3-di +8
-0+static int aac_scsi_32_64 (struct fib * fib,struct scsi_cmnd * cmd) +{ +if ((sizeof (dma_addr_t) >4 ) && + (num_physpages > (0xFFFFFFFFULL >>PAGE_SHIFT )) && + (fib->dev->adapter_info.options &AAC_OPT_SGMAP_HOST64 )) +return FAILED ; +return aac_scsi_32 (fib, cmd); +}
I saw the same thing in the 64-bit dpt_i2o driver, but I wonder, shouldn't this be something like:
#include <linux/bootmem.h>
if ((sizeof(dma_addr_t) > 4) &&
(max_pfn > (0xFFFFFFFFULL >> PAGE_SHIFT)) &&
(fib->dev->adapter_info.options & AAC_OPT_SGMAP_HOST64))e.g. use max_pfn instead of num_physpages ?
Mike.
Quoted 11 lines
From: Miquel van Smoorenburg [mailto:[email protected]]
drivers/scsi/aacraid/aachba.c static int aac_scsi_32(struct fib * fib, · line 1200
Quoted 8 lines
drivers/scsi/aacraid/aachba.c renamed from drivers/scsi/aacraid/aachba.c~aacraid-driver-fails-with-dell-poweredge-expandable-raid-controller-3-di +8
-0+static int aac_scsi_32_64 (struct fib * fib,struct scsi_cmnd * cmd) +{ +if ((sizeof (dma_addr_t) >4 ) && + (num_physpages > (0xFFFFFFFFULL >>PAGE_SHIFT )) && + (fib->dev->adapter_info.options &AAC_OPT_SGMAP_HOST64 )) +return FAILED ; +return aac_scsi_32 (fib, cmd); +}I saw the same thing in the 64-bit
dpt_i2odriver, but I
Yes, scratch and sniff, caught me :-}
Quoted 9 lines
wonder, shouldn't this be something like:
#include <
linux/bootmem.h>if ((sizeof(dma_addr_t) > 4) && (max_pfn > (0xFFFFFFFFULL >> PAGE_SHIFT)) && (fib->dev->adapter_info.options & AAC_OPT_SGMAP_HOST64))e.g. use
max_pfninstead ofnum_physpages?
Yes, it would be more correct for the moment, save for the fact that it is marked for deletion:
* This doesn't seem to be used by the Linux memory manager any
* more, but is used by ll_rw_block. If we can get rid of it,
we
* also get rid of some of the stuff above as well. . . . max_pfn = . . .
and unfortunately architecture issues abound with all memory limit variable :-(
in arch/arm/mm/init.c:
* Note: max_low_pfn and max_pfn reflect the number of _pages_
in
* the system, not the maximum PFN.
Reminder: If this automated solution represented in this patch, however flawed with any memory limit variable, is too hacky and not acceptable for inclusion, the workaround for the existing drivers and PERC users in 64 bit populated architectures continues to be to manually set aacraid.dacmode=0 in the failing configurations.
What variable tells us the maximum physical memory address, is correct in all architectures and is going to stick around?
Sincerely -- Mark Salyzyn