]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
usb: renesas_usbhs: gadget: disable all eps when the driver stops
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Wed, 19 Jul 2017 07:16:55 +0000 (16:16 +0900)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Fri, 11 Aug 2017 10:37:39 +0000 (12:37 +0200)
commitd9b67ec3b9709e3627e96ceffa6e83d060bfaeb6
tree275405233389e08345b83e5a0a1168613f812298
parent3921351368c287d7937687c4412b33fb81aca8bb
usb: renesas_usbhs: gadget: disable all eps when the driver stops

BugLink: http://bugs.launchpad.net/bugs/1707233
commit b8b9c974afee685789fcbb191b52d1790be3608c upstream.

A gadget driver will not disable eps immediately when ->disconnect()
is called. But, since this driver assumes all eps stop after
the ->disconnect(), unexpected behavior happens (especially in system
suspend).
So, this patch disables all eps in usbhsg_try_stop(). After disabling
eps by renesas_usbhs driver, since some functions will be called by
both a gadget and renesas_usbhs driver, renesas_usbhs driver should
protect uep->pipe. To protect uep->pipe easily, this patch adds a new
lock in struct usbhsg_uep.

Fixes: 2f98382dc ("usb: renesas_usbhs: Add Renesas USBHS Gadget")
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>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/usb/renesas_usbhs/mod_gadget.c