From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 0/3] ALSA fixes for non-coherent ppc32
Date: Thu, 10 Jul 2008 06:06:28 +1000 [thread overview]
Message-ID: <1215633988.8970.376.camel@pasglop> (raw)
In-Reply-To: <s5hlk0byneg.wl%tiwai@suse.de>
> The changes in ppc are only the patch below. The others are in
> sound/*. I wrote it as an inline function simply it's so short and I
> didn't want extra exports.
Thanks. I -may- do something nicer, we'll see, but in any case, I'll
try to have something in .27
Cheers,
Ben.
>
> thanks,
>
> Takashi
>
> ---
> commit 2c8662fde57af4cf928d17e089dc3dd2096f4b30
> Author: Takashi Iwai <tiwai@suse.de>
> Date: Tue Jun 17 16:39:04 2008 +0200
>
> ppc: Add dma_mmap_coherent() for PPC32
>
> A very lazy version of dma_mmap_coherent() implementation for ppc32.
>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
>
> diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h
> index bbefb69..a6a9675 100644
> --- a/include/asm-powerpc/dma-mapping.h
> +++ b/include/asm-powerpc/dma-mapping.h
> @@ -306,6 +306,24 @@ static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
> /* We don't do anything here. */
> }
>
> +/*
> + * A helper to mmap the pages allocated via dma_alloc_coherent()
> + */
> +static inline int dma_mmap_coherent(struct device *dev,
> + struct vm_area_struct *vma,
> + void *cpu_addr, dma_addr_t handle,
> + size_t size)
> +{
> + struct page *pg;
> +#ifdef CONFIG_NOT_COHERENT_CACHE
> + /* I'm too lazy and can't stop using bus_to_virt() here... */
> + cpu_addr = bus_to_virt(handle);
> +#endif
> + pg = virt_to_page(cpu_addr);
> + return remap_pfn_range(vma, vma->vm_start,
> + page_to_pfn(pg) + vma->vm_pgoff,
> + size, vma->vm_page_prot);
> +}
> #endif /* CONFIG_PPC64 */
>
> static inline void dma_sync_single_for_cpu(struct device *dev,
next prev parent reply other threads:[~2008-07-09 20:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-18 10:38 [PATCH 0/3] ALSA fixes for non-coherent ppc32 Takashi Iwai
2008-06-18 10:40 ` [PATCH 1/3] ppc: Add dma_mmap_coherent() for PPC32 Takashi Iwai
2008-06-18 10:41 ` [PATCH 2/3] ALSA: Fix mapping of DMA buffers Takashi Iwai
2008-06-18 10:42 ` [PATCH 3/3] ALSA: Fix SG-buffer DMA with non-coherent architectures Takashi Iwai
2008-07-09 8:31 ` [PATCH 0/3] ALSA fixes for non-coherent ppc32 Gerhard Pircher
2008-07-09 8:55 ` Benjamin Herrenschmidt
2008-07-09 17:31 ` Takashi Iwai
2008-07-09 20:06 ` Benjamin Herrenschmidt [this message]
2008-07-09 17:27 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1215633988.8970.376.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).