Subject: Re: [PATCH 3/20][BNX2]: Add 40-bit DMA workaround for 5708.

From: Jeff Garzik <[email-masked]>
Date: Wed, 02 May 2007 14:24:53 -0400

Michael Chan wrote:
> On Wed, 2007-05-02 at 11:29 -0400, Jeff Garzik wrote:
>> Michael Chan wrote:
>>> A non-IOMMU system using 64-bit dma_addr_t will always set
>>> CONFIG_HIGHMEM, right?
>> No.
>>
> May be I misunderstood the code in illegal_highdma() in net/core/dev.c
> where it is checking to see if it needs to linearize the SKB when the
> device does not support 64-bit DMA.  I'm using similar assumptions for
> the 40-bit address check in the patch.

That function is just checking for highmem pages, no more, no less.

Your question quoted far above presumes that no 64-bit systems exist 
lacking IOMMUs, which is not the case.  64-bit platforms with a 64-bit 
dma_addr_t will /not/ set CONFIG_HIGHMEM, regardless of IOMMU presence.

Probably you want to base your actions on some combination of

* CONFIG_64BIT
* sizeof(dma_addr_t)
* pci_set_dma_mask() for >32 bit platforms

Regards,

	Jeff