]>
Commit | Line | Data |
---|---|---|
885585e5 GKH |
1 | From 9ab967e6db7412b675ecbff80d5371d53c82cb2e Mon Sep 17 00:00:00 2001 |
2 | From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | |
3 | Date: Mon, 8 Aug 2016 21:50:52 +0900 | |
4 | Subject: usb: renesas_usbhs: clear the BRDYSTS in usbhsg_ep_enable() | |
5 | ||
6 | From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | |
7 | ||
8 | commit 9ab967e6db7412b675ecbff80d5371d53c82cb2e upstream. | |
9 | ||
10 | This patch fixes an issue that unexpected BRDY interruption happens | |
11 | when the usb_ep_{enable,disable}() are called with different direction. | |
12 | In this case, the driver will cause the following message: | |
13 | ||
14 | renesas_usbhs e6590000.usb: irq_ready run_error 1 : -16 | |
15 | ||
16 | This 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 | ||
22 | Since the driver doesn't clear the BRDYSTS flags after 2) above, the issue | |
23 | happens. If we add such clearing the flags into the driver, the code will | |
24 | become complicate. So, this patch clears the BRDYSTS flag of reception in | |
25 | usbhsg_ep_enable() to avoid complicate. | |
26 | ||
27 | Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | |
28 | Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> | |
29 | Signed-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 | } |