Skip to contentSkip to conversation

Follow-up on "WARNING: at arch/arm/mm/consistent.c:368 dma_free_coherent"

DISCUSSION Greg Lee 1 participant 2 messages Sep 22, 2009

lore
Share & tools
lore

Greg Lee

author
#0 lore raw

I'm following up on an old thread
(http://lists.arm.linux.org.uk/lurker/message/20080907.211924.e2bee80b.en.html)
from September 2008 between Russell King and Mikael Pettersson regarding dmabounce.

Quoted 2 lines · Mikael Pettersson

I've now traced the actions in dmabounce.c, and I _think_ I understand what's going on.

...

Quoted 7 lines

Tracing dmabounce.c:map_single() showed that bouncing never triggered due to the dma_mask, because clearly no page ever resided above it. However, mach-ixp4xx/common-pci.c:dma_needs_bounce() returned true whenever the very last page at 64MB-4096 was accessed. dma_needs_bounce() tests dma_addr + size >= SZ_64M, but that's actually off-by-one. Changing it to dma_addr + size - 1 >= SZ_64M disabled the bounces, but also caused the system hang to reappear.

I then found a recently updated patch from Mikael that appears to address this problem here
(http://user.it.uu.se/~mikpe/linux/patches/2.6/patch-arm-ixp4xx-disable-dmabounce-2.6.31).

This updated patch does not appear to account for the 4K region at the end of the 64MB PCI window that I mentioned above. Does this region in fact need to be accounted for? Or has this now been handled differently?

Greg

author
#1 lore raw
Quoted 8 lines · Greg Lee

I then found a recently updated patch from Mikael that appears to address this problem here
(http://user.it.uu.se/~mikpe/linux/patches/2.6/patch-arm-ixp4xx-disable-dmabounce-2.6.31).

This updated patch does not appear to account for the 4K region at the end of the 64MB PCI window that I mentioned above. ?Does this region in fact need to be accounted for? ?Or has this now been handled differently?

Ahh! I just found this discussion here
(http://lists.arm.linux.org.uk/lurker/message/20081214.222544.ea9b3653.en.html)
where Krzysztof Halasa discovers that BAR4 can be mapped after the 64MB PCI window to prevent hangs. So, this 4K region issue is not a problem if Kryzsztof's BAR4 patch is in place which it is in 2.6.31 where we are testing.

Now I need to figure out why our USB devices are not working when we use Mikael's no dmabounce patch.

Greg