Re: __get_free_pages()

James Mastros (root@jennifer-unix.dyn.ml.org)
Thu, 28 May 1998 16:24:24 -0400 (EDT)


On Thu, 28 May 1998, Stephen Williams wrote:
> The limitations for bus mastering DMA devices needs a way to be expressed.
> Certain cards can only generate addresses within specified ranges. This
> has little to do with host architectures. It may have something to do with
> where bus addresses 0-N are mapped in kernel space, but that is all.
>
> Things are more confusing when the system board DMA controllers are used.
> It is at this point where I am lost. Perhaps if I use a DMA controller
> I should be asking *it* for memory and not linux?

Ahh... I was only thinking of the system DMA controllers. Seems I left out
the difficult half of the situation.

Perhaps we should have three arguments to __get_free_pages (or have another
call, so we don't have to change everything (again)) -- order, flags, limit.
That way, we can support either situation with ease (DMA /w the card's
controller, or with the host's). (We should continue to support the
__GFP_DMA flag, and the limit -- if both are specified, use the lower of the
two limits.)

> I would like to be able to ask Linux for a 24bit bus address, for example.
> I don't care where it is mapped in kernel space, as long as the output from
> virt_to_bus gives me something with the high bits cleared.

Hmm... are bus addresses the only relavant ones here? If we care about the
limit in terms of the phys address anywhere, we are going to need two
versions of the call (one to take a phys limit, one for the bus -- we can't
convert, because we are talking a LIMIT, not an ADDRESS -- we can't assume
that they are mapped nicely for us) (I'm fairly certian that if you need to
specify a limit in terms of virt, then you are doing somthing the slow
stupid way <G>).

> Various boards have different DMA limits. PCI devices may be limited to
> 1meg, or 4Gig in a 64bit system. The GFP_DMA bit is getting overloaded,
Unfornatly I hadn't relized that when I posted the previous message -- my
own fault for getting into a hardware-conversation.

> and it seems to me that just adding more GFP_DMA bits is an exploding
> problem.
Absolutly. Somday, we're going to find a device that needs to do DMA into
the first 4090 KB of RAM <G>.

-=- James Mastros

-- 
True mastery is knowing enough to bullshit the rest.
	-=- Me
http://www.rtweb.net/theorb coming soon (or when I get around to it).

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu