All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: RFC: dma_mmap_coherent() for powerpc/ppc architecture and ALSA?
@ 2006-06-10  8:22 ` Gerhard Pircher
  0 siblings, 0 replies; 21+ messages in thread
From: Gerhard Pircher @ 2006-06-10  8:22 UTC (permalink / raw)
  To: Lee Revell, benh; +Cc: linuxppc-dev, alsa-devel, linux-kernel

> -------- Original-Nachricht --------
> Datum: Fri, 09 Jun 2006 20:46:32 -0400
> Von: Lee Revell <rlrevell@joe-job.com>
> An: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Betreff: Re: RFC: dma_mmap_coherent() for powerpc/ppc architecture and 
> ALSA?
> 
> On Sat, 2006-06-10 at 10:34 +1000, Benjamin Herrenschmidt wrote:
> > > This leads me to the question, if there are any plans to include the 
> > > dma_mmap_coherent() function (for powerpc/ppc and/or any other
> > > platform) in one of the next kernel versions and if an adapation of
> > > the ALSA drivers is planned. Or is there a simple way (hack) to fix
> > > this problem?
> > 
> > You are welcome to do a patch implementing this :)
> 
> Please cc: alsa-devel when you do so.

:)

Well, implementing the dma_mmap_coherent() function isn't the problem, because it is already implemented for the ARM architecture. But as far as I understand this would require a rewrite of all the ALSA drivers (or at least a rewrite of the ALSA's DMA helper functions).

Original mail included for alsa-devel mailing list:

> I'm trying to adapt Linux for the AmigaOne, which is a G3/G4 PPC desktop 
> system with a non cache coherent northbridge (MAI ArticiaS), a VIA82C686B 
> southbridge and the U-boot firmware. Due to the cache coherency problem I 
> compiled in the CONFIG_NOT_COHERENT_CACHE option
> (arch/ppc/kernel/dma-mapping.c) in the AmigaOne Linux kernel.

> While that fixes the DMA data corruption problem, it causes a kernel oops 
> or a complete system lookup after starting sound playback. With kernel
> versions =<2.6.14 the oops messages refered to a BUG() entry in
> mm/rmap.c. Therefore I tried out a newer kernel (2.6.16.15), where the
> oops refers to the ALSA function snd_pcm_mmap_data_nopage() implemented
> in pcm_native.c.

> Well, after searching a while in some old linux kernel threads, I found
> this thread here:
> http://www.thisishull.net/showthread.php?t=22080&page=3&pp=10

> Based on the information in this thread, I came to the conclusion that
> ALSA simply won't work on non cache coherent architectures (except ARM),
> because the generic DMA API was never expanded to support the
> functionality required by ALSA (namely mapping dma pages into user space > with dma_mmap_coherent()).

> This leads me to the question, if there are any plans to include the
> dma_mmap_coherent() function (for powerpc/ppc and/or any other platform)
> in one of the next kernel versions and if an adapation of the ALSA
> drivers is planned. Or is there a simple way (hack) to fix this problem?

Gerhard

-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: RFC: dma_mmap_coherent() for powerpc/ppc architecture and ALSA?
@ 2006-06-28 20:27 Gerhard Pircher
  2006-06-29  9:27 ` Takashi Iwai
  0 siblings, 1 reply; 21+ messages in thread
From: Gerhard Pircher @ 2006-06-28 20:27 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: linuxppc-dev, rlrevell, alsa-devel, linux-kernel, benh

Hi,

It took a little bit longer to integrate the patch, as I didn't figure out  first how to implement the __dma_mmap_coherent() function for PPC systems with CONFIG_NOT_COHERENT_CACHE defined. :)

Unfortunately my system still crashes within snd_pcm_mmap_data_nopage() 
(sound/core/pcm_native.c), as you can see below. I guess it tries to remap 
a DMA buffer allocated by the not cache coherent DMA memory allocation 
function in arch/ppc/kernel/dma-mapping.c.

Jun 28 21:59:30 localhost kernel: [  199.869609] Using dma_mmap_coherent for mmaping DMA buffer!
Jun 28 21:59:30 localhost kernel: [  199.925075] Oops: kernel access of bad area, sig: 11 [#1]
Jun 28 21:59:30 localhost kernel: [  199.925106] NIP: E226FF44 LR: E226FF94 CTR: E226FEA4
Jun 28 21:59:30 localhost kernel: [  199.925116] REGS: d2577d30 TRAP: 0600   Not tainted  (2.6.16.16-a1-2)
Jun 28 21:59:30 localhost kernel: [  199.925121] MSR: 00009032 <EE,ME,IR,DR>  CR: 44048444  XER: 00000000
Jun 28 21:59:30 localhost kernel: [  199.925134] DAR: 99A9999D, DSISR: 00000120
Jun 28 21:59:30 localhost kernel: [  199.925140] TASK = d242cd10[4338] 'totem' THREAD: d2576000
Jun 28 21:59:30 localhost kernel: [  199.925144] GPR00: 99A9999D D2577DE0 D242CD10 C0C826A0 00000000 D2577E08 D275F000 D36DC328
Jun 28 21:59:30 localhost kernel: [  199.925158] GPR08: 02000000 00004000 00000000 99A99999 84048444 10054698 00000000 10196A58
Jun 28 21:59:30 localhost kernel: [  199.925172] GPR16: 00000000 00000000 00000000 D36DC328 02000000 329FE000 00000000 00000000
Jun 28 21:59:30 localhost kernel: [  199.925184] GPR24: DE5A6B20 DFA63C80 329FE000 DFA63C80 D20AD804 D275F7F8 D2576000 D2577E08
Jun 28 21:59:30 localhost kernel: [  199.925199] NIP [E226FF44] snd_pcm_mmap_data_nopage+0xa0/0x12c [snd_pcm]
Jun 28 21:59:30 localhost kernel: [  199.925300] LR [E226FF94] snd_pcm_mmap_data_nopage+0xf0/0x12c [snd_pcm]
Jun 28 21:59:30 localhost kernel: [  199.925325] Call Trace:
Jun 28 21:59:30 localhost kernel: [  199.925330] [D2577DE0] [C0010050] update_mmu_cache+0xe4/0xf4 (unreliable)
Jun 28 21:59:30 localhost kernel: [  199.925361] [D2577E00] [C004F1D8] do_no_page+0xa4/0x6a4
Jun 28 21:59:30 localhost kernel: [  199.925387] [D2577E60] [C004FA24] __handle_mm_fault+0x12c/0x328
Jun 28 21:59:30 localhost kernel: [  199.925398] [D2577E90] [C000F740] do_page_fault+0x140/0x384
Jun 28 21:59:30 localhost kernel: [  199.925407] [D2577F40] [C0004AC0] handle_page_fault+0xc/0x80
Jun 28 21:59:30 localhost kernel: [  199.925423] Instruction dump:
Jun 28 21:59:30 localhost kernel: [  199.925427] 812a0218 3d60c038 800b938c 7d292214 3d294000 5529c9f4 7c604a14 80030000
Jun 28 21:59:30 localhost kernel: [  199.925441] 7c6b1b78 70094000 40820044 380b0004 <7d200028> 31290001 7d20012d 40a2fff4

Comments?

Thanks!

Gerhard

-------- Original-Nachricht --------
Datum: Wed, 14 Jun 2006 16:42:48 +0200
Von: Takashi Iwai <tiwai@suse.de>
An: Gerhard Pircher <gerhard_pircher@gmx.net>
Betreff: Re: [Alsa-devel] RFC: dma_mmap_coherent() for powerpc/ppc architecture and ALSA?

> At Mon, 12 Jun 2006 16:42:54 +0200,
> Gerhard Pircher wrote:
> > 
> > > > But as far as I understand this would require a rewrite of all the
> > > > ALSA drivers (or at least a rewrite of the ALSA's DMA helper
> > > > functions).
> > > 
> > > Yes.  The change of ALSA side has been also on my tree.  But it was
> > > still pending since I'm not satisfied with the design yet.
> > > If you're interested in it, let me know.  I'll post the patch.
> > 
> > Yes, please! Then I can test, if the dma_mmap_coherent() patch works on
> > my non cache coherent powerpc machine.
> 
> For using dma_mmap_coherent(), the patch below should suffice.
> (Also you need to enable HAVE_DMA_MMAP_COHERENT there not only for
>  ARM.)
> 
> > Do you think the DMA Layer/ALSA patches will go upstream in one of
> > the next ALSA/Linux kernel versions? 
> 
> Definitely no 2.6.18 material yet.
> 
> 
> Takashi

-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RFC: dma_mmap_coherent() for powerpc/ppc architecture and ALSA?
@ 2006-06-09 18:01 Gerhard Pircher
  2006-06-10  0:34 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 21+ messages in thread
From: Gerhard Pircher @ 2006-06-09 18:01 UTC (permalink / raw)
  To: linuxppc-dev, linux-kernel

Hi,

I'm trying to adapt Linux for the AmigaOne, which is a G3/G4 PPC desktop system with a non cache coherent northbridge (MAI ArticiaS), a VIA82C686B southbridge and the U-boot firmware. Due to the cache coherency problem I compiled in the CONFIG_NOT_COHERENT_CACHE option (arch/ppc/kernel/dma-mapping.c) in the AmigaOne Linux kernel.

While that fixes the DMA data corruption problem, it causes a kernel oops or a complete system lookup after starting sound playback. With kernel versions =<2.6.14 the oops messages refered to a BUG() entry in mm/rmap.c. Therefore I tried out a newer kernel (2.6.16.15), where the oops refers to the ALSA function snd_pcm_mmap_data_nopage() implemented in pcm_native.c.

Well, after searching a while in some old linux kernel threads, I found this thread here:
http://www.thisishull.net/showthread.php?t=22080&page=3&pp=10

Based on the information in this thread, I came to the conclusion that ALSA simply won't work on non cache coherent architectures (except ARM), because the generic DMA API was never expanded to support the functionality required by ALSA (namely mapping dma pages into user space with dma_mmap_coherent()).

This leads me to the question, if there are any plans to include the dma_mmap_coherent() function (for powerpc/ppc and/or any other platform) in one of the next kernel versions and if an adapation of the ALSA drivers is planned. Or is there a simple way (hack) to fix this problem?

Thanks!

Regards,

Gerhard

-- 
--
-- email : gerhard_pircher -AT- gmx -DOT- net
--

Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2006-06-30 18:21 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-10  8:22 RFC: dma_mmap_coherent() for powerpc/ppc architecture and ALSA? Gerhard Pircher
2006-06-10  8:22 ` Gerhard Pircher
2006-06-10  8:22 ` Gerhard Pircher
2006-06-12 10:51 ` Takashi Iwai
2006-06-12 10:51   ` Takashi Iwai
2006-06-12 10:51   ` Takashi Iwai
2006-06-12 14:42   ` Gerhard Pircher
2006-06-12 14:42     ` Gerhard Pircher
2006-06-12 14:42     ` Gerhard Pircher
2006-06-14 14:42     ` Takashi Iwai
2006-06-14 14:42       ` [Alsa-devel] " Takashi Iwai
2006-06-14 14:42       ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2006-06-28 20:27 Gerhard Pircher
2006-06-29  9:27 ` Takashi Iwai
2006-06-29 21:15   ` Gerhard Pircher
2006-06-30  9:12     ` Takashi Iwai
2006-06-30 18:21       ` Gerhard Pircher
2006-06-09 18:01 Gerhard Pircher
2006-06-10  0:34 ` Benjamin Herrenschmidt
2006-06-10  0:46   ` Lee Revell
2006-06-10  0:46     ` Lee Revell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.