usb: gadget: udc: renesas_usb3: fix pm_runtime functions calling
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Wed, 26 Apr 2017 11:50:07 +0000 (20:50 +0900)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 03:00:54 +0000 (03:00 +0000)
commited1f83a5bd2b1e4676fd8a5c2dafabc0c24d43f8
tree397b0caf070b0b7133ef762490ee99fda5fcbda0
parent2cfe1bcd9116477c3c8c9bf0bbb421e6ba0e5562
usb: gadget: udc: renesas_usb3: fix pm_runtime functions calling

commit cdc876877ebc3f0677b267756d4564e2a429e730 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/renesas_usb3.c