aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs/fifo.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/renesas_usbhs/fifo.c')
-rw-r--r--drivers/usb/renesas_usbhs/fifo.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index d1af831f43eb..68f26904c316 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -282,11 +282,26 @@ static void usbhsf_fifo_clear(struct usbhs_pipe *pipe,
282 struct usbhs_fifo *fifo) 282 struct usbhs_fifo *fifo)
283{ 283{
284 struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); 284 struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
285 int ret = 0;
285 286
286 if (!usbhs_pipe_is_dcp(pipe)) 287 if (!usbhs_pipe_is_dcp(pipe)) {
287 usbhsf_fifo_barrier(priv, fifo); 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 }
288 298
289 usbhs_write(priv, fifo->ctr, BCLR); 299 /*
300 * if non-DCP pipe, this driver should set BCLR when
301 * usbhsf_fifo_barrier() returns 0.
302 */
303 if (!ret)
304 usbhs_write(priv, fifo->ctr, BCLR);
290} 305}
291 306
292static int usbhsf_fifo_rcv_len(struct usbhs_priv *priv, 307static int usbhsf_fifo_rcv_len(struct usbhs_priv *priv,