1
0
Fork 0
remarkable-linux/drivers/usb
Peter Chen f61f2b7294 MLK-20346 usb: chipidea: change power_lost workqueue as freezable
Like commit d144dfea8a ("usb: chipidea: otg: change workqueue
ci_otg as freezable"), the power_lost work item may try to remove
hcd if controller is powered off during the system suspend, and
the similar deadlock happens, see below dumps.

Meanwhile, with this change, we need to disable USB interrupt
during the work item runs (after driver resume has finished),
otherwise, USB transfer will be timeout (5s) due to USB interrupt
is disabled and IAA watchdog is still not ready at that time.

Workqueue: events ci_power_lost_work
Call trace:
[<ffff000008085c44>] __switch_to+0x8c/0xd0
[<ffff000008d7bbf4>] __schedule+0x19c/0x5d8
[<ffff000008d7c068>] schedule+0x38/0xa0
[<ffff000008d7f3b4>] schedule_timeout+0x19c/0x338
[<ffff000008d7cc10>] wait_for_common+0xa0/0x148
[<ffff000008d7cccc>] wait_for_completion+0x14/0x20
[<ffff0000080e6040>] flush_work+0xd8/0x1f0
[<ffff0000080e61f4>] flush_delayed_work+0x3c/0x48
[<ffff0000081ae1c8>] wb_shutdown+0x90/0xd0
[<ffff0000081ae688>] bdi_unregister+0x58/0x1c0
[<ffff000008413a60>] del_gendisk+0x218/0x228
[<ffff00000871683c>] sd_remove+0x64/0xc0
[<ffff0000086b6eec>] device_release_driver_internal+0x154/0x1f0
[<ffff0000086b6f9c>] device_release_driver+0x14/0x20
[<ffff0000086b5d40>] bus_remove_device+0xc8/0x108
[<ffff0000086b2a08>] device_del+0x1f8/0x300
[<ffff0000087049ec>] __scsi_remove_device+0xec/0x128
[<ffff000008702c70>] scsi_forget_host+0x70/0x78
[<ffff0000086f7ee8>] scsi_remove_host+0xa0/0x140
[<ffff0000088e0588>] usb_stor_disconnect+0x50/0xc0
[<ffff00000887eab8>] usb_unbind_interface+0x78/0x280
[<ffff0000086b6eec>] device_release_driver_internal+0x154/0x1f0
[<ffff0000086b6f9c>] device_release_driver+0x14/0x20
[<ffff0000086b5d40>] bus_remove_device+0xc8/0x108
[<ffff0000086b2a08>] device_del+0x1f8/0x300
[<ffff00000887c364>] usb_disable_device+0xa4/0x210
[<ffff000008872cfc>] usb_disconnect+0x7c/0x240
[<ffff000008872e40>] usb_disconnect+0x1c0/0x240
[<ffff000008878e10>] usb_remove_hcd+0xc0/0x1d8
[<ffff0000088e7bac>] host_stop+0x34/0x90
[<ffff0000088e4088>] ci_handle_id_switch+0x70/0x1d0
[<ffff0000088e3038>] ci_power_lost_work+0x90/0xa8
[<ffff0000080e7100>] process_one_work+0x1e0/0x340
[<ffff0000080e72b0>] worker_thread+0x50/0x458
[<ffff0000080ed32c>] kthread+0xfc/0x128
[<ffff000008084eb8>] ret_from_fork+0x10/0x18

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
(cherry picked from commit d217dacbe793641497b38f48d063a6332242e8a9)
2018-11-20 15:13:06 +08:00
..
atm License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
c67x00 c67x00-hcd: constify hc_driver structures 2017-07-30 07:26:52 -07:00
cdns3 MLK-19601-1 xhci: Fix leaking USB3 shared_hcd at xhci removal 2018-10-29 11:10:38 +08:00
chipidea MLK-20346 usb: chipidea: change power_lost workqueue as freezable 2018-11-20 15:13:06 +08:00
class usb: cdc_acm: Do not leak URB buffers 2018-10-13 09:27:26 +02:00
common MLK-9897-2 usb: otg-fsm: check B-device state before sending polling request 2018-10-29 11:10:38 +08:00
core MLK-17380-3 usb: move EH SINGLE_STEP_SET_FEATURE implement to core 2018-10-29 11:10:38 +08:00
dwc2 dwc2: gadget: Fix ISOC IN DDMA PID bitfield value calculation 2018-08-24 13:09:01 +02:00
dwc3 MLK-18922-2 usb: dwc3: add OTG capabilities handling 2018-10-29 11:10:38 +08:00
early USB: early: Use new USB product ID and strings for DbC device 2017-11-21 09:49:21 +01:00
gadget MLK-17828 mfg: utp device support multi instance 2018-10-29 11:10:38 +08:00
host MLK-19601-2 xhci: handle port status events for removed USB3 hcd 2018-10-29 11:10:38 +08:00
image License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
isp1760 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
misc MLK-9638-4 usb: ehset: test: start timer for B host switch role back 2018-10-29 11:10:38 +08:00
mon usb: usbmon: Read text within supplied buffer size 2018-03-19 08:42:46 +01:00
mtu3 usb: mtu3: fix error return code in ssusb_gadget_init() 2017-12-10 13:40:41 +01:00
musb usb: musb: dsps: do not disable CPPI41 irq in driver teardown 2018-10-03 17:00:55 -07:00
phy MLK-20158-3 usb: phy: mxs: add wakeup enable for imx7ulp 2018-11-02 16:42:09 +08:00
renesas_usbhs usb: renesas_usbhs: missed the "running" flag in usb_dmac with rx path 2018-02-28 10:19:43 +01:00
serial USB: serial: simple: add Motorola Tetra MTP6550 id 2018-10-13 09:27:26 +02:00
storage usb: uas: add support for more quirk flags 2018-09-26 08:38:07 +02:00
typec MLK-16013-9 usb: typec: add interface to get port type and role 2018-10-29 11:10:38 +08:00
usbip usbip: vhci_sysfs: fix potential Spectre v1 2018-06-16 09:45:15 +02:00
wusbcore usb: wusbcore: security: cast sizeof to int for comparison 2018-10-03 17:00:49 -07:00
Kconfig MLK-16065-7 usb: cdns3: add Cadence USB3 controller driver 2018-10-29 11:10:38 +08:00
Makefile MLK-16065-7 usb: cdns3: add Cadence USB3 controller driver 2018-10-29 11:10:38 +08:00
README
usb-skeleton.c USB: usb-skeleton: refactor endpoint retrieval 2017-03-23 13:54:08 +01:00

README

To understand all the Linux-USB framework, you'll use these resources:

    * This source code.  This is necessarily an evolving work, and
      includes kerneldoc that should help you get a current overview.
      ("make pdfdocs", and then look at "usb.pdf" for host side and
      "gadget.pdf" for peripheral side.)  Also, Documentation/usb has
      more information.

    * The USB 2.0 specification (from www.usb.org), with supplements
      such as those for USB OTG and the various device classes.
      The USB specification has a good overview chapter, and USB
      peripherals conform to the widely known "Chapter 9".

    * Chip specifications for USB controllers.  Examples include
      host controllers (on PCs, servers, and more); peripheral
      controllers (in devices with Linux firmware, like printers or
      cell phones); and hard-wired peripherals like Ethernet adapters.

    * Specifications for other protocols implemented by USB peripheral
      functions.  Some are vendor-specific; others are vendor-neutral
      but just standardized outside of the www.usb.org team.

Here is a list of what each subdirectory here is, and what is contained in
them.

core/		- This is for the core USB host code, including the
		  usbfs files and the hub class driver ("hub_wq").

host/		- This is for USB host controller drivers.  This
		  includes UHCI, OHCI, EHCI, and others that might
		  be used with more specialized "embedded" systems.

gadget/		- This is for USB peripheral controller drivers and
		  the various gadget drivers which talk to them.


Individual USB driver directories.  A new driver should be added to the
first subdirectory in the list below that it fits into.

image/		- This is for still image drivers, like scanners or
		  digital cameras.
../input/	- This is for any driver that uses the input subsystem,
		  like keyboard, mice, touchscreens, tablets, etc.
../media/	- This is for multimedia drivers, like video cameras,
		  radios, and any other drivers that talk to the v4l
		  subsystem.
../net/		- This is for network drivers.
serial/		- This is for USB to serial drivers.
storage/	- This is for USB mass-storage drivers.
class/		- This is for all USB device drivers that do not fit
		  into any of the above categories, and work for a range
		  of USB Class specified devices. 
misc/		- This is for all USB device drivers that do not fit
		  into any of the above categories.