linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* powerpc: DMA coherent allocations broken for CONFIG_NOT_COHERENT_CACHE
@ 2009-05-21 16:50 Albert Herranz
  2009-05-24  6:47 ` Grant Likely
  0 siblings, 1 reply; 17+ messages in thread
From: Albert Herranz @ 2009-05-21 16:50 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Ilya Yanok


Hello list,=0A=0ACommit 33f00dcedb0e22cdb156a23632814fc580fcfcf8 seems to h=
ave broken DMA coherent allocations for CONFIG_NOT_COHERENT_CACHE platforms=
.=0A=0AThe problems seem to be that the new __dma_alloc_coherent() and __dm=
a_free_coherent() implementations:=0A=0A- don't respect anymore the passed =
gfp flags (__dma_alloc_coherent() unconditionally uses GFP_KERNEL within th=
e function irrespective of the caller flags)=0A- can't be used in interrupt=
 context as they use get_vm_area_caller()/vfree() which end up triggering B=
UG_ON(in_interrupt())=0A=0AOne victim happens to be the USB core subsystem =
which sometimes frees dma coherent memory in interrupt context for drivers =
flagged HCD_LOCAL_MEM.=0A=0AThis has been experienced while writing a new E=
HCI driver for the Nintendo Wii platform.=0A=0Ausb 1-1: new high speed USB =
device using ehci-mipc and address 2=0A------------[ cut here ]------------=
=0Akernel BUG at mm/vmalloc.c:1328!=0AOops: Exception in kernel mode, sig: =
5 [#1]=0APREEMPT wii=0AModules linked in:=0ANIP: c008ea20 LR: c0015890 CTR:=
 c00111d4=0AREGS: d2c65b10 TRAP: 0700   Not tainted  (2.6.30-rc2-isobel-wii=
-00092-gcba94db-dirty)=0AMSR: 00021032 <ME,CE,IR,DR>  CR: 42482028  XER: 00=
000000=0ATASK =3D d2c600f0[28] 'kmmcd' THREAD: d2c64000=0AGPR00: 00010000 d=
2c65bc0 d2c600f0 d4030000 d4030000 d4030000 12da1000 00000001 =0AGPR08: 000=
00000 d2c64000 00000020 00000000 22482022 94fdfb98 6e1979bc c6bbdbdd =0AGPR=
16: 00000020 00200200 00100100 d4020060 00000001 d401c0ec 00000001 d401c0ec=
 =0AGPR24: d2d9a6c0 00000000 00000000 d2f69de0 d2d9a600 d2f69e30 d2f69e2c d=
2da08e0 =0ANIP [c008ea20] vfree+0xc/0x18=0ALR [c0015890] __dma_free_coheren=
t+0x14/0x24=0ACall Trace:=0A[d2c65bc0] [c0017af8] __mipc_recv_req+0x160/0x1=
78 (unreliable)=0A[d2c65bd0] [c00111ec] dma_direct_free_coherent+0x18/0x28=
=0A[d2c65be0] [c01cfca4] hcd_free_coherent+0x7c/0x12c=0A[d2c65c10] [c01d00b=
8] unmap_urb_for_dma+0x150/0x1cc=0A[d2c65c20] [c01d0174] usb_hcd_giveback_u=
rb+0x40/0xe4=0A[d2c65c30] [c01df474] ehci_urb_done+0xf0/0x114=0A[d2c65c50] =
[c01e3870] qh_completions+0x41c/0x4dc=0A[d2c65ca0] [c01e44e0] scan_async+0x=
9c/0x1a0=0A[d2c65cc0] [c01e49ec] ehci_work+0x58/0xc4=0A[d2c65cd0] [c01e5424=
] ehci_irq+0x22c/0x230=0A[d2c65d00] [c01cfa88] usb_hcd_irq+0x50/0xa8=0A[d2c=
65d20] [c00597d8] handle_IRQ_event+0xdc/0x250=0A[d2c65d60] [c005ba20] handl=
e_level_irq+0x9c/0x138=0A[d2c65d80] [c001cbc8] hollywood_pic_irq_cascade+0x=
7c/0xf8=0A[d2c65da0] [c00064b4] do_IRQ+0x9c/0xc4=0A[d2c65dc0] [c0011fb8] re=
t_from_except+0x0/0x14=0A=0AAny comments on how to address this issue (othe=
r than reverting the above mentioned commit, which fixes it) are welcome.=
=0A=0AThanks,=0AAlbert=0A=0A=0A=0A      

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: powerpc: DMA coherent allocations broken for CONFIG_NOT_COHERENT_CACHE
@ 2009-05-26 17:13 Albert Herranz
  0 siblings, 0 replies; 17+ messages in thread
From: Albert Herranz @ 2009-05-26 17:13 UTC (permalink / raw)
  To: linuxppc-dev list, Benjamin Herrenschmidt; +Cc: Kumar Gala, Ilya Yanok


--- El lun, 25/5/09, Benjamin Herrenschmidt <benh@kernel.crashing.org> escr=
ibi=F3:=0A=0A> (Please, Kumar, have a good look,=0A> especially my change t=
o FIXMAP_TOP,=0A> was there any reason it wasn't a constant in the first=0A=
> place ?)=0A> =0A> This is going to .30 if nobody hollers. I've done some=
=0A> testing here=0A> and it seems to be fine, but more eyes at this stage =
are=0A> much welcome.=0A=0ATested-by: Albert Herranz <albert_herranz@yahoo.=
es>=0A=0ABoots fine and works on the Nintendo Wii.=0A=0AThanks,=0AAlbert=0A=
=0A=0A=0A=0A      

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

end of thread, other threads:[~2009-05-28  5:09 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-21 16:50 powerpc: DMA coherent allocations broken for CONFIG_NOT_COHERENT_CACHE Albert Herranz
2009-05-24  6:47 ` Grant Likely
2009-05-24 10:21   ` Benjamin Herrenschmidt
2009-05-25  0:21     ` Benjamin Herrenschmidt
2009-05-25  1:43       ` Arnd Bergmann
2009-05-25  4:19         ` Benjamin Herrenschmidt
2009-05-25  4:33         ` Benjamin Herrenschmidt
2009-05-25  5:50           ` Grant Likely
2009-05-25  6:49             ` Benjamin Herrenschmidt
2009-05-28  3:34           ` Sean MacLennan
2009-05-28  3:42             ` Grant Likely
2009-05-28  5:00               ` Sean MacLennan
2009-05-28  5:09                 ` Grant Likely
2009-05-28  3:52             ` Benjamin Herrenschmidt
2009-05-28  4:11               ` Sean MacLennan
2009-05-28  4:19                 ` Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2009-05-26 17:13 Albert Herranz

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).