]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.13.6/usb-renesas_usbhs-fix-the-bclr-setting-condition-for-non-dcp-pipe.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.13.6 / usb-renesas_usbhs-fix-the-bclr-setting-condition-for-non-dcp-pipe.patch
CommitLineData
fc5fda92
GKH
1From 6124607acc88fffeaadf3aacfeb3cc1304c87387 Mon Sep 17 00:00:00 2001
2From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
3Date: Wed, 27 Sep 2017 18:47:12 +0900
4Subject: usb: renesas_usbhs: fix the BCLR setting condition for non-DCP pipe
5
6From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
7
8commit 6124607acc88fffeaadf3aacfeb3cc1304c87387 upstream.
9
10This patch fixes an issue that the driver sets the BCLR bit of
11{C,Dn}FIFOCTR register to 1 even when it's non-DCP pipe and
12the FRDY bit of {C,Dn}FIFOCTR register is set to 1.
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 | 10 ++++++++--
21 1 file changed, 8 insertions(+), 2 deletions(-)
22
23--- a/drivers/usb/renesas_usbhs/fifo.c
24+++ b/drivers/usb/renesas_usbhs/fifo.c
25@@ -282,11 +282,17 @@ static void usbhsf_fifo_clear(struct usb
26 struct usbhs_fifo *fifo)
27 {
28 struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
29+ int ret = 0;
30
31 if (!usbhs_pipe_is_dcp(pipe))
32- usbhsf_fifo_barrier(priv, fifo);
33+ ret = usbhsf_fifo_barrier(priv, fifo);
34
35- usbhs_write(priv, fifo->ctr, BCLR);
36+ /*
37+ * if non-DCP pipe, this driver should set BCLR when
38+ * usbhsf_fifo_barrier() returns 0.
39+ */
40+ if (!ret)
41+ usbhs_write(priv, fifo->ctr, BCLR);
42 }
43
44 static int usbhsf_fifo_rcv_len(struct usbhs_priv *priv,