summaryrefslogtreecommitdiff
path: root/drivers/usb/mtu3/Kconfig
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2019-03-11 11:48:17 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-19 15:06:12 +0100
commit207338ec5a278a307fa9b650667806fd5a4db5d4 (patch)
treed33ceeb85e212cd9312cd16530f8523731ef2f9c /drivers/usb/mtu3/Kconfig
parent7511c9a9d3c8f2b415e83599e879a359b4e71f08 (diff)
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>
Diffstat (limited to 'drivers/usb/mtu3/Kconfig')
0 files changed, 0 insertions, 0 deletions