# Re: \[PATCH\] Sam440ep support

- From: Benjamin Herrenschmidt \<benh@kernel.crashing.org\>
- Date: 2008-05-06 11:34:53 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2008/05/9439782
- Thread: https://ratatoskr.run/linuxppc-dev/2008/05/9439728/t.md

```text

On Tue, 2008-05-06 at 13:31 +0200, Takashi Iwai wrote:
> > I don't think we can easily update the DMA API at this stage. What
> we
> > could do is provide a way to retrieve the struct page array from the
> > result of dma_alloc_coherent...
> 
> In most cases, it can be obtained via pfn_to_page(), I suppose.  But,
> it's definitely arch-specific thingy, and a generic solution would be
> really appreciated.

You can't get a pfn out of the result of dma_alloc_coherent on
non-coherent powerpc at least. It's a virtual mapping created from the
underlying pages set to be non-cacheable. virt_to_* will do no good.

> Alternatively, we can change the ALSA PCM core code that accesses the
> virtual linear buffer and handles SG-buffers as they are.  Maybe it'll
> give a bit more useful clean-up in the whole memory-management codes
> in ALSA in the end.

I need to get my head around what the exact usage in Alsa is, and it's a
bit too late for me to thing right now :-)

Ben.
```
