linux_dsm_epyc7002/drivers/usb
Hans de Goede 207338ec5a usb: typec: fusb302: Improve suspend/resume handling
Remove the code which avoids doing i2c-transfers while our parent
i2c-adapter may be suspended by busy-waiting for our resume handler
to be called.

Instead move the interrupt handling from a threaded interrupt handler
to a work-queue and install a non-threaded interrupt handler which
normally queues the new interrupt handling work directly.

When our suspend handler gets called we set a flag which makes the new
non-threaded interrupt handler skip queueing the work before our parent
i2c-adapter is ready, instead the new non-threaded handler will record an
interrupt has happened during suspend and then our resume handler will
queue the work (at which point our parent will be ready).

Note normally i2c drivers solve the problem of not being able to access
the i2c bus until the i2c-controller is resumed by simply disabling their
irq from the suspend handler and re-enabling it on resume.

That is not possible with the fusb302 since the irq is a wakeup source
(it must be a wakeup source so that we can do PD negotiation when a
charger gets plugged in while suspended).

Besides avoiding the ugly busy-wait, this also fixes the following errors
which were logged by the busy-wait code when woken from suspend by plugging
in a Type-C device:

fusb302: i2c: pm suspend, retry 1 / 10
fusb302: i2c: pm suspend, retry 2 / 10
etc.

This commit also changes the devm_request_irq to a regular request_irq
+ free_irq, so that the work can be properly stopped. While at it also
properly disable the wake setting on the irq and also properly stop the
delayed work for bcl handling.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19 15:06:12 +01:00
..
atm USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
c67x00 USB: add SPDX identifiers to all remaining Makefiles 2017-11-07 15:53:48 +01:00
chipidea usb: chipidea: Refactor USB PHY selection and keep a single PHY 2019-02-27 15:51:02 +01:00
class cdc-wdm: pass return value of recover_from_urb_loss 2019-02-19 14:41:38 +01:00
common usb: roles: Add a description for the class to Kconfig 2018-12-17 14:07:59 +01:00
core USB/PHY patches for 5.1-rc1 2019-03-06 16:48:27 -08:00
dwc2 usb: dwc2: use struct_size() in kzalloc() 2019-02-19 14:41:38 +01:00
dwc3 usb: dwc3: drd: Defer probe if extcon device is not found 2019-02-19 15:08:07 +01:00
early memblock: drop memblock_alloc_*_nopanic() variants 2019-03-12 10:04:02 -07:00
gadget SCSI misc on 20190306 2019-03-09 16:53:47 -08:00
host DMA mapping updates for 5.1 2019-03-10 11:54:48 -07:00
image USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
isp1760 USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
misc USB: changes for v5.1 merge window 2019-02-15 09:08:57 +01:00
mon USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
mtu3 USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
musb USB: musb: mark expected switch fall-through 2019-02-13 19:40:20 +01:00
phy USB: changes for v5.1 merge window 2019-02-15 09:08:57 +01:00
renesas_usbhs USB: renesas_usbhs: fix spelling mistake "doens't" -> "doesn't" 2019-02-19 14:41:38 +01:00
roles usb: roles: Find the muxes by also matching against the device node 2019-02-14 10:52:25 +01:00
serial USB-serial fixes for 5.1-rc1 2019-02-21 17:28:50 +01:00
storage SCSI misc on 20190306 2019-03-09 16:53:47 -08:00
typec usb: typec: fusb302: Improve suspend/resume handling 2019-03-19 15:06:12 +01:00
usbip usbip: Remove unnecessary null check 2019-03-19 15:00:34 +01:00
wusbcore wusb: Remove unnecessary static function ckhdid_printf 2019-03-01 20:53:41 +01:00
Kconfig USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
Makefile usb: roles: Add Intel xHCI USB role switch driver 2018-03-22 13:49:27 +01:00
usb-skeleton.c usb: usb-skeleton: use irqsave() in USB's complete callback 2018-06-28 19:36:06 +09:00