aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller
PATCH 1/1 aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller
Subject: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller
Contribution:
Anil Ravindranath <[email protected]>
Issue:
Data Bursts that cross from 32- to 64-Bit address space have incorrect address for 29320LPE. This leads to potential data corruption.
Fix:
Restrict DMA to 32bit so that it does not cross 4GB boundary.
Change Log:
Restrict DMA to 32bit for 29320LPE so that it does not cross 4GB boundary
Patch: apply to scsi-misc-2.6.git development tree
Signed off By: Anil Ravindranath <[email protected]>
diff -urN a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
--- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 2007-06-30
05:24:08.000000000 -0700
+++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 2007-06-30
05:25:40.000000000 -0700
@@ -161,7 +161,10 @@
}
pci_set_master(pdev);- if (sizeof(dma_addr_t) > 4) {
+ /*
+ * Restrict DMA to 32bit for 29320LPE
+ */
+ if ((sizeof(dma_addr_t) > 4) && (entry->full_id !=
ID_AHA_29320LPE)) {
const u64 required_mask = dma_get_required_mask(dev);
if (required_mask > DMA_39BIT_MASK &&diffstat output:
aic79xx_osm_pci.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletion(-)
With regards,
Anil
Hi,
We have not heard any comments or inputs on this patch.
With regards,
Anil
Quoted 54 lines · Anil K. Ravindranath
Subject: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller
Contribution:
Anil Ravindranath <[email protected]>
Issue:
Data Bursts that cross from 32- to 64-Bit address space have incorrect address for 29320LPE. This leads to potential data corruption.
Fix:
Restrict DMA to 32bit so that it does not cross 4GB boundary.
Change Log:
Restrict DMA to 32bit for 29320LPE so that it does not cross 4GB boundary
Patch: apply to scsi-misc-2.6.git development tree
Signed off By: Anil Ravindranath <[email protected]>
diff -urN
a/drivers/scsi/aic7xxx/aic79xx_osm_pci.cb/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
---a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c2007-06-30
05:24:08.000000000 -0700
+++b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c2007-06-30
05:25:40.000000000 -0700(quoted diff) +4
-1@@ -161,7 +161,10 @@ } pci_set_master(pdev); - if (sizeof(dma_addr_t) > 4) { + /* + * Restrict DMA to 32bit for 29320LPE + */ + if ((sizeof(dma_addr_t) > 4) && (entry->full_id != ID_AHA_29320LPE)) { const u64 required_mask = dma_get_required_mask(dev);if (required_mask > DMA_39BIT_MASK &&diffstat output:
aic79xx_osm_pci.c| 5 ++++-1 files changed, 4 insertions(+), 1 deletion(-)With regards,
Anil
Quoted 19 lines · Anil K. Ravindranath
Hi,
We have not heard any comments or inputs on this patch.
With regards,
AnilQuoted 11 lines · Anil K. Ravindranath
Subject: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller
Contribution:
Anil Ravindranath <[email protected]>
Issue:
Data Bursts that cross from 32- to 64-Bit address space have incorrect address for 29320LPE. This leads to potential data corruption.
Where do you think you see this happening? The block layer has a dma_boundary parameter (basically a mask which it refuses to allow dma to cross). By default this is set to 4GB (because a lot of PCI cards have difficulty going from non-DAC to DAC). The aic79xx driver does nothing to alter this, so you shouldn't be seeing any DMA segments crossing the 4GB boundary.
James
A message that is not in the archive (sent off-list or not yet received): [email protected]
please don't drop linux-scsi ... just because no-one else has asked the question doesn't mean they're not interested in the answer. Having the answer in the list means that search tools can find it.
Quoted 4 lines · Anil K. Ravindranath
Oh I see. I looked into the
scsi_host_alloc(), now I see this.Thanks. By setting adma_boundaryto 4G, does it mean the kernel(in block) is ensuring that a DMA segment will not cross this 4G boundary. I mean a DMA segment will not be split at 4G boundary.
Yes, that's exactly what it means. Primarily, as I said, because PCI bridges can't necessarily span non-DAC to DAC in a single DMA transfer.
James
Quoted 36 lines
With regards,
AnilQuoted 31 lines · James Bottomley
Quoted 19 lines · Anil K. Ravindranath
Hi,
We have not heard any comments or inputs on this patch.
With regards,
AnilQuoted 11 lines · Anil K. Ravindranath
Subject: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller
Contribution:
Anil Ravindranath <[email protected]>
Issue:
Data Bursts that cross from 32- to 64-Bit address space have incorrect address for 29320LPE. This leads to potential data corruption.
Where do you think you see this happening? The block layer has a
dma_boundaryparameter (basically a mask which it refuses to allow dma to cross). By default this is set to 4GB (because a lot of PCI cards have difficulty going from non-DAC to DAC). The aic79xx driver does nothing to alter this, so you shouldn't be seeing any DMA segments crossing the 4GB boundary.James