Skip to content

Commit ccc6a47

Browse files
shimodaygregkh
authored andcommitted
usb: renesas_usbhs: fix usbhsf_fifo_clear() for RX direction
commit 0a2ce62 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 <[email protected]> Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a7131ed commit ccc6a47

File tree

1 file changed

+11
-2
lines changed
  • drivers/usb/renesas_usbhs

1 file changed

+11
-2
lines changed

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)