diff options
Diffstat (limited to 'drivers/usb/renesas_usbhs/fifo.c')
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index 36e5b5c530bd..8bb9367ada45 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c | |||
@@ -285,11 +285,26 @@ static void usbhsf_fifo_clear(struct usbhs_pipe *pipe, | |||
285 | struct usbhs_fifo *fifo) | 285 | struct usbhs_fifo *fifo) |
286 | { | 286 | { |
287 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); | 287 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); |
288 | int ret = 0; | ||
288 | 289 | ||
289 | if (!usbhs_pipe_is_dcp(pipe)) | 290 | if (!usbhs_pipe_is_dcp(pipe)) { |
290 | usbhsf_fifo_barrier(priv, fifo); | 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 | } | ||
291 | 301 | ||
292 | usbhs_write(priv, fifo->ctr, BCLR); | 302 | /* |
303 | * if non-DCP pipe, this driver should set BCLR when | ||
304 | * usbhsf_fifo_barrier() returns 0. | ||
305 | */ | ||
306 | if (!ret) | ||
307 | usbhs_write(priv, fifo->ctr, BCLR); | ||
293 | } | 308 | } |
294 | 309 | ||
295 | static int usbhsf_fifo_rcv_len(struct usbhs_priv *priv, | 310 | static int usbhsf_fifo_rcv_len(struct usbhs_priv *priv, |
@@ -843,9 +858,9 @@ static void xfer_work(struct work_struct *work) | |||
843 | fifo->name, usbhs_pipe_number(pipe), pkt->length, pkt->zero); | 858 | fifo->name, usbhs_pipe_number(pipe), pkt->length, pkt->zero); |
844 | 859 | ||
845 | usbhs_pipe_running(pipe, 1); | 860 | usbhs_pipe_running(pipe, 1); |
846 | usbhsf_dma_start(pipe, fifo); | ||
847 | usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->trans); | 861 | usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->trans); |
848 | dma_async_issue_pending(chan); | 862 | dma_async_issue_pending(chan); |
863 | usbhsf_dma_start(pipe, fifo); | ||
849 | usbhs_pipe_enable(pipe); | 864 | usbhs_pipe_enable(pipe); |
850 | 865 | ||
851 | xfer_work_end: | 866 | xfer_work_end: |