[Top] [All Lists]

Re: pci_alloc_consistent usage

Subject: Re: pci_alloc_consistent usage
From: Atsushi Nemoto <>
Date: Wed, 28 May 2003 10:30:46 +0900 (JST)
In-reply-to: <> <>
Organization: TOSHIBA Personal Computer System Corporation
Original-recipient: rfc822;
References: <> <> <>
>>>>> On Tue, 27 May 2003 13:22:37 +0200, Ralf Baechle <> 
>>>>> said:
ralf> While it's officially documented I still don't like it.  A
ralf> double conversion such as page_address(virt_to_page(ptr)) would
ralf> accidently turn a pointer of an uncached mapping into one to a
ralf> cached area for the same object - that will almost certainly not
ralf> work as expected on a non-coherent machine.

Yes, it's dangerous, I agree.

ralf> Whatever - virt_to_page should then be considered a a legacy API
ralf> which we have to try to support as well as possible in the hope
ralf> it's going to fade away ...

I hope so.  For now we can do something like:

     buf = pci_alloc_consistent(dev, size, &dmabuf);
#if defined(__mips__) && defined(CONFIG_NONCOHERENT_IO)
     page = virt_to_page(CAC_ADDR(buf));
     page = virt_to_page(buf);

Ugly but I do not want to add extra overhead to virt_to_page itself...

Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>