blob: 592f71fcab66a4502806c12e9157926640990d78 [file] [log] [blame]
From 56d576361b399fa7936be32c5b4c4d0927c48351 Mon Sep 17 00:00:00 2001
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Wed, 26 Apr 2017 20:50:07 +0900
Subject: [PATCH 136/286] usb: gadget: udc: renesas_usb3: fix pm_runtime
functions calling
This patch fixes an issue that this driver is possible to access
the registers before pm_runtime_get_sync() if a gadget driver is
installed first. After that, oops happens on R-Car Gen3 environment.
To avoid it, this patch changes the pm_runtime call timing from
probe/remove to udc_start/udc_stop.
Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
(cherry picked from commit cdc876877ebc3f0677b267756d4564e2a429e730)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/usb/gadget/udc/renesas_usb3.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -1841,6 +1841,9 @@ static int renesas_usb3_stop(struct usb_
pm_runtime_put(usb3_to_dev(usb3));
pm_runtime_disable(usb3_to_dev(usb3));
+ pm_runtime_put(usb3_to_dev(usb3));
+ pm_runtime_disable(usb3_to_dev(usb3));
+
return 0;
}