]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
ehci-hcd: fix external buffer cache handling
authorIlya Yanok <ilya.yanok@cogentembedded.com>
Sun, 15 Jul 2012 04:43:49 +0000 (04:43 +0000)
committerMarek Vasut <marex@denx.de>
Wed, 18 Jul 2012 12:43:42 +0000 (14:43 +0200)
commit189a6956ebbd7820afe5fa45a64ca495e6cefd9c
tree7d6cc2a7467715342b7fca057edad5f150432c9e
parent71c5de4f4af5e0995f89dffa79f48f26bd095f50
ehci-hcd: fix external buffer cache handling

Buffer coming from upper layers should be cacheline aligned/padded
to perform safe cache operations. For now we don't do bounce
buffering so getting unaligned buffer is an upper layer error.
We can't check if the buffer is properly padded with current
interface so just assume it is (consider changing with in the
future). The following changes are done:

1. Remove useless length alignment check. We get actual transfer
length not the size of the underlying buffer so it's perfectly
valid for it to be unaligned.
2. Move flush_dcache_range() out of while loop or it will
flush too much.
3. Don't try to fix buffer address before calling invalidate:
if it's unaligned it's an error anyway so let cache subsystem
cry about that.
4. Fix end buffer address to be cacheline aligned assuming upper
layer reserved enough space. This is potentially dangerous
operation so upper layers should be careful about that.

Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
drivers/usb/host/ehci-hcd.c