>>>>> On Tue, 27 May 2003 11:17:40 +0200, Ralf Baechle <email@example.com>
ralf> Use the value returned by pci_alloc_consistent in *dma_handle
ralf> instead of trying to do any conversions with of
ralf> pci_alloc_consistent's return value.
How about virt_to_page()?
Currently, many sound drivers (including ALSA) pass a
pci_alloc_consistent's return value to virt_to_page. While
virt_to_page is defined as below, we can not pass KSEG1 address
(returned by pci_alloc_consistent) to virt_to_page.
#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
#define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT))
Following definition can handle this case properly,
#define virt_to_page(kaddr) (mem_map + (PHYSADDR(kaddr) >> PAGE_SHIFT))
But as ralf said, PHYSADDR() may be is a bit slower then __pa().
Is it worth to change? Or should we fix the driver using virt_to_page