Skip to content

Commit

Permalink
ARM: 5966/1: at91_udc HW glitch
Browse files Browse the repository at this point in the history
Add some delay to avoid reading CSR TXCOUNT too early after
updating it.

For more info about this HW glitch see:
http://lists.arm.linux.org.uk/lurker/message/20090325.150843.f515c02f.en.html
http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100129/10ba0f8b/attachment.el
http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100203/09cdb3b4/attachment.el
http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100203/08b5b249/attachment.el

First applied: "Fix soft lockup in at91 udc driver"
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=5965

Signed-off-by: Anti Sullin <anti.sullin@artecdesign.ee>
Signed-off-by: Harro Haan <hrhaan@gmail.com>
Acked-by: Remy Bohmer <linux@bohmer.net>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Harro Haan authored and Russell King committed May 5, 2010
1 parent e8faff7 commit 7622537
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/usb/gadget/at91_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,13 @@ static int read_fifo (struct at91_ep *ep, struct at91_request *req)
if (is_done)
done(ep, req, 0);
else if (ep->is_pingpong) {
/*
* One dummy read to delay the code because of a HW glitch:
* CSR returns bad RXCOUNT when read too soon after updating
* RX_DATA_BK flags.
*/
csr = __raw_readl(creg);

bufferspace -= count;
buf += count;
goto rescan;
Expand Down

0 comments on commit 7622537

Please sign in to comment.