]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.7.3/usb-renesas_usbhs-clear-the-brdysts-in-usbhsg_ep_enable.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.7.3 / usb-renesas_usbhs-clear-the-brdysts-in-usbhsg_ep_enable.patch
CommitLineData
885585e5
GKH
1From 9ab967e6db7412b675ecbff80d5371d53c82cb2e Mon Sep 17 00:00:00 2001
2From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
3Date: Mon, 8 Aug 2016 21:50:52 +0900
4Subject: usb: renesas_usbhs: clear the BRDYSTS in usbhsg_ep_enable()
5
6From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
7
8commit 9ab967e6db7412b675ecbff80d5371d53c82cb2e upstream.
9
10This patch fixes an issue that unexpected BRDY interruption happens
11when the usb_ep_{enable,disable}() are called with different direction.
12In this case, the driver will cause the following message:
13
14 renesas_usbhs e6590000.usb: irq_ready run_error 1 : -16
15
16This issue causes the followings:
17 1) A pipe is enabled as transmission
18 2) The pipe sent a data
19 3) The pipe is disabled and re-enabled as reception.
20 4) The pipe got a queue
21
22Since the driver doesn't clear the BRDYSTS flags after 2) above, the issue
23happens. If we add such clearing the flags into the driver, the code will
24become complicate. So, this patch clears the BRDYSTS flag of reception in
25usbhsg_ep_enable() to avoid complicate.
26
27Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
28Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
29Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
30
31---
32 drivers/usb/renesas_usbhs/mod_gadget.c | 7 +++++--
33 1 file changed, 5 insertions(+), 2 deletions(-)
34
35--- a/drivers/usb/renesas_usbhs/mod_gadget.c
36+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
37@@ -617,10 +617,13 @@ static int usbhsg_ep_enable(struct usb_e
38 * use dmaengine if possible.
39 * It will use pio handler if impossible.
40 */
41- if (usb_endpoint_dir_in(desc))
42+ if (usb_endpoint_dir_in(desc)) {
43 pipe->handler = &usbhs_fifo_dma_push_handler;
44- else
45+ } else {
46 pipe->handler = &usbhs_fifo_dma_pop_handler;
47+ usbhs_xxxsts_clear(priv, BRDYSTS,
48+ usbhs_pipe_number(pipe));
49+ }
50
51 ret = 0;
52 }