dm9601: work around tx fifo sync issue on dm962x
authorPeter Korsgaard <peter@korsgaard.com>
Mon, 16 Dec 2013 10:35:35 +0000 (11:35 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 15 Feb 2014 19:20:15 +0000 (19:20 +0000)
commitdb2d65517d27bda1164ab41aba72e13a2e56b468
tree5bb4bbbb2c4134bd76c67318dce51571e7444b5b
parentbb840e15efa58c6a827fc79703a9ee1165d543fd
dm9601: work around tx fifo sync issue on dm962x

commit 4263c86dca5198da6bd3ad826d0b2304fbe25776 upstream.

Certain dm962x revisions contain an bug, where if a USB bulk transfer retry
(E.G. if bulk crc mismatch) happens right after a transfer with odd or
maxpacket length, the internal tx hardware fifo gets out of sync causing
the interface to stop working.

Work around it by adding up to 3 bytes of padding to ensure this situation
cannot trigger.

This workaround also means we never pass multiple-of-maxpacket size skb's
to usbnet, so the length adjustment to handle usbnet's padding of those can
be removed.

Reported-by: Joseph Chang <joseph_chang@davicom.com.tw>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/usb/dm9601.c