Skip to content

Commit ccc6a47

Browse files
shimodaygregkh
authored andcommitted
usb: renesas_usbhs: fix usbhsf_fifo_clear() for RX direction
commit 0a2ce62b61f2c76d0213edf4e37aaf54a8ddf295 upstream. This patch fixes an issue that the usbhsf_fifo_clear() is possible to cause 10 msec delay if the pipe is RX direction and empty because the FRDY bit will never be set to 1 in such case. Fixes: e8d548d ("usb: renesas_usbhs: fifo became independent from pipe.") Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a7131ed commit ccc6a47

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

  • drivers/usb/renesas_usbhs

drivers/usb/renesas_usbhs/fifo.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,17 @@ static void usbhsf_fifo_clear(struct usbhs_pipe *pipe,
287287
struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
288288
int ret = 0;
289289

290-
if (!usbhs_pipe_is_dcp(pipe))
291-
ret = usbhsf_fifo_barrier(priv, fifo);
290+
if (!usbhs_pipe_is_dcp(pipe)) {
291+
/*
292+
* This driver checks the pipe condition first to avoid -EBUSY
293+
* from usbhsf_fifo_barrier() with about 10 msec delay in
294+
* the interrupt handler if the pipe is RX direction and empty.
295+
*/
296+
if (usbhs_pipe_is_dir_in(pipe))
297+
ret = usbhs_pipe_is_accessible(pipe);
298+
if (!ret)
299+
ret = usbhsf_fifo_barrier(priv, fifo);
300+
}
292301

293302
/*
294303
* if non-DCP pipe, this driver should set BCLR when

0 commit comments

Comments
 (0)