public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller
@ 2007-06-30 12:45 Anil K. Ravindranath
  2007-09-20 15:08 ` Anil K. Ravindranath
  0 siblings, 1 reply; 4+ messages in thread
From: Anil K. Ravindranath @ 2007-06-30 12:45 UTC (permalink / raw)
  To: Linux-scsi; +Cc: Anil K. Ravindranath

Subject: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE
Adaptec SCSI controller

Contribution:

Anil Ravindranath <anil_ravindranath@adaptec.com>

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 <anil_ravindranath@adaptec.com>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller
  2007-06-30 12:45 [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller Anil K. Ravindranath
@ 2007-09-20 15:08 ` Anil K. Ravindranath
  2007-09-21  0:41   ` James Bottomley
  0 siblings, 1 reply; 4+ messages in thread
From: Anil K. Ravindranath @ 2007-09-20 15:08 UTC (permalink / raw)
  To: Linux-scsi, James.Bottemley

Hi,

We have not heard any comments or inputs on this patch. 

With regards,
  Anil

On Sat, 2007-06-30 at 05:45 -0700, Anil K. Ravindranath wrote:
> Subject: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE
> Adaptec SCSI controller
> 
> Contribution:
> 
> Anil Ravindranath <anil_ravindranath@adaptec.com>
> 
> 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 <anil_ravindranath@adaptec.com>
> 
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller
  2007-09-20 15:08 ` Anil K. Ravindranath
@ 2007-09-21  0:41   ` James Bottomley
       [not found]     ` <1190305223.1588.7.camel@linux.site>
  0 siblings, 1 reply; 4+ messages in thread
From: James Bottomley @ 2007-09-21  0:41 UTC (permalink / raw)
  To: Anil K. Ravindranath; +Cc: Linux-scsi

On Thu, 2007-09-20 at 08:08 -0700, Anil K. Ravindranath wrote:
> Hi,
> 
> We have not heard any comments or inputs on this patch. 
> 
> With regards,
>   Anil
> 
> On Sat, 2007-06-30 at 05:45 -0700, Anil K. Ravindranath wrote:
> > Subject: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE
> > Adaptec SCSI controller
> > 
> > Contribution:
> > 
> > Anil Ravindranath <anil_ravindranath@adaptec.com>
> > 
> > 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller
       [not found]     ` <1190305223.1588.7.camel@linux.site>
@ 2007-09-21 15:37       ` James Bottomley
  0 siblings, 0 replies; 4+ messages in thread
From: James Bottomley @ 2007-09-21 15:37 UTC (permalink / raw)
  To: Anil K. Ravindranath; +Cc: linux-scsi

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.

On Thu, 2007-09-20 at 09:20 -0700, Anil K. Ravindranath wrote: 
> Oh I see. I looked into the scsi_host_alloc(), now I see this.Thanks. By
> setting a dma_boundary to 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


> With regards,
>   Anil
> 
> 
> On Thu, 2007-09-20 at 19:41 -0500, James Bottomley wrote:
> > On Thu, 2007-09-20 at 08:08 -0700, Anil K. Ravindranath wrote:
> > > Hi,
> > > 
> > > We have not heard any comments or inputs on this patch. 
> > > 
> > > With regards,
> > >   Anil
> > > 
> > > On Sat, 2007-06-30 at 05:45 -0700, Anil K. Ravindranath wrote:
> > > > Subject: [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE
> > > > Adaptec SCSI controller
> > > > 
> > > > Contribution:
> > > > 
> > > > Anil Ravindranath <anil_ravindranath@adaptec.com>
> > > > 
> > > > 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
> > 
> > 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-21 15:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-30 12:45 [PATCH] aic7xxx driver. Restrict DMA to 32bit for 29320LPE Adaptec SCSI controller Anil K. Ravindranath
2007-09-20 15:08 ` Anil K. Ravindranath
2007-09-21  0:41   ` James Bottomley
     [not found]     ` <1190305223.1588.7.camel@linux.site>
2007-09-21 15:37       ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox