Skip to content

Commit 0a2ce62

Browse files
shimodayFelipe Balbi
authored andcommitted
usb: renesas_usbhs: fix usbhsf_fifo_clear() for RX direction
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.") Cc: <[email protected]> # v3.1+ Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 6124607 commit 0a2ce62

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
@@ -284,8 +284,17 @@ static void usbhsf_fifo_clear(struct usbhs_pipe *pipe,
284284
struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
285285
int ret = 0;
286286

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

290299
/*
291300
* if non-DCP pipe, this driver should set BCLR when

0 commit comments

Comments
 (0)