From: David M. <Dav...@st...> - 2001-10-19 12:05:00
|
Folks, I've been trying to get PCI sound working on our platform, and I've come across some interesting problems. I'm using a standard soundblaster AC97. (driver is in es1371.c). The problem is with applications that mmap() the sound device. The sound driver call pci_alloc_consistent(), which returns a P2 pointer. This is then passed into virt_to_page(), which gets it wrong, as it get the physical page by the __pa() macro which works subtracting from PAGE_OFFSET. To fix this I've changed __pa() and __va() to do PHYSADDR() and P1SEGADDR(). This fixes the problem nicely. However, what I'm not sure about is the cachability, when we call remap_page_range(), the pages will be marked as cacheable. I don't think this is what you want to do! I think we need something like pgprot_noncached(), or perhaps pgprot_pci(), if you are remapping memory that comes from the pci_alloc() routines. The other problem of course is that if you do intend to make them cacheable, the dreaded D-cache alias raises it's ugly head again. I haven't started looking at this yet, but unfortunately I've got a driver to port that expects this to work. I suspect the only solution is to adjust the VMA to match the alignment of the memory being remapped. Anybody got any other ideas? -- Dave McKay Software Engineer STMicroelectronics Email: dav...@st... |