Re: Areca driver recap + status

From: James Bottomley
Date: Tue Jun 27 2006 - 11:26:59 EST


On Tue, 2006-06-27 at 08:32 +1000, Robert Mueller wrote:
> > - PAE (cast of dma_addr_t to unsigned long) issues.
>
> Can you explain a bit what this is about and what the effect is? It's just
> that we've been using the driver (older version from the areca website) in a
> PAE kernel on machines with 8G of memory and haven't had a problem yet
> (running high IO load for several weeks) but this sounds like it
> might/should cause corruption or crashing in this situation?

It's these pieces:

+ pcmd->SCp.ptr = (char *)(unsigned long) dma_addr;


+ else if (pcmd->request_bufflen != 0)
+ pci_unmap_single(acb->pdev,
+ (dma_addr_t)(unsigned long)pcmd->SCp.ptr,
+ pcmd->request_bufflen, pcmd->sc_data_direction);

On a PAE platform, dma_addr_t is u64 and unsigned long is u32, so any
address > 4GB will be truncated by these operations.

I think all this does is cause a slow leak of dma mappings, and on any
kernel > 2.6.16 the leak should be even smaller, since we've severely
restricted the use_sg == 0 case. It probably is only significant on
x86_64 with the gart iommu enabled.

James


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/