]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.92/usb-renesas_usbhs-fix-usbhsf_fifo_clear-for-rx-direction.patch
drop drm patch
[thirdparty/kernel/stable-queue.git] / releases / 4.4.92 / usb-renesas_usbhs-fix-usbhsf_fifo_clear-for-rx-direction.patch
CommitLineData
7571c426
GKH
1From 0a2ce62b61f2c76d0213edf4e37aaf54a8ddf295 Mon Sep 17 00:00:00 2001
2From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
3Date: Wed, 27 Sep 2017 18:47:13 +0900
4Subject: usb: renesas_usbhs: fix usbhsf_fifo_clear() for RX direction
5
6From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
7
8commit 0a2ce62b61f2c76d0213edf4e37aaf54a8ddf295 upstream.
9
10This patch fixes an issue that the usbhsf_fifo_clear() is possible
11to cause 10 msec delay if the pipe is RX direction and empty because
12the FRDY bit will never be set to 1 in such case.
13
14Fixes: e8d548d54968 ("usb: renesas_usbhs: fifo became independent from pipe.")
15Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
16Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
17Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18
19---
20 drivers/usb/renesas_usbhs/fifo.c | 13 +++++++++++--
21 1 file changed, 11 insertions(+), 2 deletions(-)
22
23--- a/drivers/usb/renesas_usbhs/fifo.c
24+++ b/drivers/usb/renesas_usbhs/fifo.c
25@@ -287,8 +287,17 @@ static void usbhsf_fifo_clear(struct usb
26 struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
27 int ret = 0;
28
29- if (!usbhs_pipe_is_dcp(pipe))
30- ret = usbhsf_fifo_barrier(priv, fifo);
31+ if (!usbhs_pipe_is_dcp(pipe)) {
32+ /*
33+ * This driver checks the pipe condition first to avoid -EBUSY
34+ * from usbhsf_fifo_barrier() with about 10 msec delay in
35+ * the interrupt handler if the pipe is RX direction and empty.
36+ */
37+ if (usbhs_pipe_is_dir_in(pipe))
38+ ret = usbhs_pipe_is_accessible(pipe);
39+ if (!ret)
40+ ret = usbhsf_fifo_barrier(priv, fifo);
41+ }
42
43 /*
44 * if non-DCP pipe, this driver should set BCLR when