aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_gadget.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2016-05-31 11:05:13 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-06-01 17:58:59 -0400
commit30647217909ea8ce4d8f4905b15fa1bb09d80859 (patch)
tree42010b2897b38215d5deae648ecc7d90b5f8674a /drivers/usb/musb/musb_gadget.c
parentf730f205cc5116b6edfedf568fdfbb4935248e8e (diff)
usb: musb: Remove conditional PM runtime calls for musb_gadget
The conditional use of PM runtime does not work properly for musb gadget. On cable disconnect we may not get any USB_EVENT_NONE leaving the PM runtime call unpaired. Let's fix the issue by making sure the PM runtime calls are paired within the functions. The glue layer will take care of the rest. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/musb/musb_gadget.c')
-rw-r--r--drivers/usb/musb/musb_gadget.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index fff5a8a283e3..7ecc893ff3ba 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1914,8 +1914,8 @@ static int musb_gadget_start(struct usb_gadget *g,
1914 if (musb->xceiv->last_event == USB_EVENT_ID) 1914 if (musb->xceiv->last_event == USB_EVENT_ID)
1915 musb_platform_set_vbus(musb, 1); 1915 musb_platform_set_vbus(musb, 1);
1916 1916
1917 if (musb->xceiv->last_event == USB_EVENT_NONE) 1917 pm_runtime_mark_last_busy(musb->controller);
1918 pm_runtime_put(musb->controller); 1918 pm_runtime_put_autosuspend(musb->controller);
1919 1919
1920 return 0; 1920 return 0;
1921 1921
@@ -1934,8 +1934,7 @@ static int musb_gadget_stop(struct usb_gadget *g)
1934 struct musb *musb = gadget_to_musb(g); 1934 struct musb *musb = gadget_to_musb(g);
1935 unsigned long flags; 1935 unsigned long flags;
1936 1936
1937 if (musb->xceiv->last_event == USB_EVENT_NONE) 1937 pm_runtime_get_sync(musb->controller);
1938 pm_runtime_get_sync(musb->controller);
1939 1938
1940 /* 1939 /*
1941 * REVISIT always use otg_set_peripheral() here too; 1940 * REVISIT always use otg_set_peripheral() here too;