linux/drivers/usb/chipidea
Peter Chen cbe85c88ce usb: chipidea: udc: don't do hardware access if gadget has stopped
After _gadget_stop_activity is executed, we can consider the hardware
operation for gadget has finished, and the udc can be stopped and enter
low power mode. So, any later hardware operations (from usb_ep_ops APIs
or usb_gadget_ops APIs) should be considered invalid, any deinitializatons
has been covered at _gadget_stop_activity.

I meet this problem when I plug out usb cable from PC using mass_storage
gadget, my callstack like: vbus interrupt->.vbus_session->
composite_disconnect ->pm_runtime_put_sync(&_gadget->dev),
the composite_disconnect will call fsg_disable, but fsg_disable calls
usb_ep_disable using async way, there are register accesses for
usb_ep_disable. So sometimes, I get system hang due to visit register
without clock, sometimes not.

The Linux Kernel USB maintainer Alan Stern suggests this kinds of solution.
See: http://marc.info/?l=linux-usb&m=138541769810983&w=2.

Cc: <stable@vger.kernel.org> #v4.9+
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Link: https://lore.kernel.org/r/20190820020503.27080-2-peter.chen@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-21 09:45:49 -07:00
..
bits.h USB: chipidea: Remove redundant license text 2017-11-07 15:45:01 +01:00
ci_hdrc_imx.c usb: chipidea: imx: fix EPROBE_DEFER support during driver probe 2019-08-15 14:50:21 +02:00
ci_hdrc_imx.h usb: chipidea: imx: set power polarity 2019-02-27 15:51:02 +01:00
ci_hdrc_msm.c usb: chipidea: msm: Use devm_platform_ioremap_resource() 2019-06-14 17:40:28 +08:00
ci_hdrc_pci.c USB: chipidea: Remove redundant license text 2017-11-07 15:45:01 +01:00
ci_hdrc_tegra.c usb: chipidea: tegra: Fix missed ci_hdrc_remove_device() 2019-02-26 11:57:38 +01:00
ci_hdrc_usb2.c USB: chipidea: Remove redundant license text 2017-11-07 15:45:01 +01:00
ci_hdrc_zevio.c USB: chipidea: Remove redundant license text 2017-11-07 15:45:01 +01:00
ci.h usb: chipidea: Always build ULPI code 2018-07-05 14:22:47 +08:00
core.c usb: chipidea: Use dev_err() instead of pr_err() 2019-06-14 17:40:12 +08:00
debug.c USB: chipidea: no need to check return value of debugfs_create functions 2018-05-31 12:54:22 +02:00
host.c usb: chipidea: host: override ehci->hub_control 2018-12-11 09:12:30 +08:00
host.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
Makefile usb: chipidea: Always build ULPI code 2018-07-05 14:22:47 +08:00
otg_fsm.c USB: move many drivers to use DEVICE_ATTR_WO 2018-01-24 08:49:52 +01:00
otg_fsm.h USB: chipidea: Remove redundant license text 2017-11-07 15:45:01 +01:00
otg.c usb: chipidea: Fix otg event handler 2018-09-20 17:04:22 +08:00
otg.h usb: chipidea: Prevent unbalanced IRQ disable 2018-09-20 17:04:21 +08:00
udc.c usb: chipidea: udc: don't do hardware access if gadget has stopped 2019-08-21 09:45:49 -07:00
udc.h USB: chipidea: Remove redundant license text 2017-11-07 15:45:01 +01:00
ulpi.c usb: chipidea: Always build ULPI code 2018-07-05 14:22:47 +08:00
usbmisc_imx.c usb: chipidea: imx: Use devm_platform_ioremap_resource() 2019-06-14 17:40:20 +08:00