]> git.baikalelectronics.ru Git - kernel.git/commit
usb: renesas_usbhs: fix the timing of dcp_control_transfer_done
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tue, 4 Nov 2014 01:05:44 +0000 (10:05 +0900)
committerFelipe Balbi <balbi@ti.com>
Wed, 5 Nov 2014 19:22:12 +0000 (13:22 -0600)
commitd84f4183a1b733b099a0a61a3aa508e8b3720b0d
treeaac9aae7650622ff989fcb088cdc9d52f1a08f14
parent7e93f4c22fed8041889b570d80aba17b19ad1401
usb: renesas_usbhs: fix the timing of dcp_control_transfer_done

According to the datasheet, this driver should clear the INTSTS0.CTRT
bit before this controller detects the next stage transition. Otherwise,
the driver may not be able to clear the bit after the controller went to
the next stage transition. After that, the driver will not be able to
clear the INTSTS0.VALID, and a usb control transfer will not finish
finally.

If we use the testusb tool, it is easy to reproduce this issue:

 # testusb -a -t 10

Since the previous code handled a data stage and a status stage in
the usbhsf_pio_try_push(), it may not clear the INTSTS0.CTRT at the
right timing.
So, this patch change the timing of usbhs_dcp_control_transfer_done()
to the usbhsg_irq_ctrl_stage().

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/renesas_usbhs/fifo.c
drivers/usb/renesas_usbhs/mod_gadget.c