]> git.baikalelectronics.ru Git - kernel.git/commit
USB: isp1760: use a write barrier to ensure proper ndelay timing
authorMichael Hennerich <michael.hennerich@analog.com>
Thu, 5 Aug 2010 21:53:57 +0000 (17:53 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Aug 2010 03:50:15 +0000 (20:50 -0700)
commitc8c2c97e810bca021cd45c5ad7c8eccb9b95d4da
tree6fd92615398fae2af9ada5206f52dafde7d4e16a
parent989a590a2bba3c28a63b8eb114d74be69f73861c
USB: isp1760: use a write barrier to ensure proper ndelay timing

The ISP1760 has some timing requirements where it has to delay a short
period after a write to a register has started.  However, this delay is
from the time the write hits the USB chip (the ISP1760), not from the
time where the processor started processing the write.  So on a quick
enough processor, it is sometimes possible for the write to not hit the
device before we start delaying, and we then violate the part's timing
requirements, so things stop working.

To avoid all this, insert a write barrier after the register write and
before the timing delay/register read so we can guarantee we only start
counting time after the write has hit the device.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/isp1760-hcd.c