Subject: Re: Does kmalloc on MPC82xx work correctly with GFP_DMA?

From: Conor McLoughlin <[email-masked]>
Date: Tue, 19 Oct 2004 09:36:04 +0100

Thanks for your response Dan, but there is still something that I
am not seeing correctly here.

> No, the kmalloc() space is not covered by BATs (but, that isn't
> relevant for this discussion).

On my board, I can use  my BDI2000 to look at the BAT registers.
DBAT2U is 0xC00003FE and DBAT0L is 0x00000002.

To me this looks like all of my SDRAM starting at effective address
0xC0000000 is handled by DBAT2 with cache enabled.
If I look at where it is allocating the memory with kmalloc, it is
in this area. I do get a different area of memory assigned depending
on whether or not I use GPF_DMA, but it is still in this effective area
covered by DBAT2.  What am I missing here?

 > Yes, it is DMA safe.  That's why this driver works :-)

Just because it works doesn't mean that there might not be a bug
lurking there.
I agree that it is unlikely, but I don't understand how an area of
memory at effective address 0xCxxxxxxx is not covered by the BATs.

--Conor