OSDN Git Service

usb: renesas_usbhs: clear the BRDYSTS in usbhsg_ep_enable()
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Mon, 8 Aug 2016 12:50:52 +0000 (21:50 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Sep 2016 06:32:39 +0000 (08:32 +0200)
commitb8032e6952f0d228b058c8fdb6e3392e19a61c27
treea84ee994a46ee2120fcf045b375935f91d2eab54
parent4a6eff809af0a1662917338c47bf9291f77d62cc
usb: renesas_usbhs: clear the BRDYSTS in usbhsg_ep_enable()

commit 9ab967e6db7412b675ecbff80d5371d53c82cb2e upstream.

This patch fixes an issue that unexpected BRDY interruption happens
when the usb_ep_{enable,disable}() are called with different direction.
In this case, the driver will cause the following message:

 renesas_usbhs e6590000.usb: irq_ready run_error 1 : -16

This issue causes the followings:
 1) A pipe is enabled as transmission
 2) The pipe sent a data
 3) The pipe is disabled and re-enabled as reception.
 4) The pipe got a queue

Since the driver doesn't clear the BRDYSTS flags after 2) above, the issue
happens. If we add such clearing the flags into the driver, the code will
become complicate. So, this patch clears the BRDYSTS flag of reception in
usbhsg_ep_enable() to avoid complicate.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/renesas_usbhs/mod_gadget.c