]> git.baikalelectronics.ru Git - kernel.git/commit
usb: typec: ucsi: ccg: Remove run_isr flag
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Fri, 4 Oct 2019 10:02:18 +0000 (13:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2019 11:51:26 +0000 (13:51 +0200)
commit5c2ed4f1639b2db866254560ba28270486db539c
tree065bee9dc33410fb90d52c8734eef270f966d303
parentd599e510cbfe4dc26dd7a0e9efca3d50e5f2157d
usb: typec: ucsi: ccg: Remove run_isr flag

The "run_isr" flag is used for preventing the driver from
calling the interrupt service routine in its runtime resume
callback when the driver is expecting completion to a
command, but what that basically does is that it hides the
real problem. The real problem is that the controller is
allowed to suspend in the middle of command execution.

As a more appropriate fix for the problem, using autosuspend
delay time that matches UCSI_TIMEOUT_MS (5s). That prevents
the controller from suspending while still in the middle of
executing a command.

This fixes a potential deadlock. Both ccg_read() and
ccg_write() are called with the mutex already taken at least
from ccg_send_command(). In ccg_read() and ccg_write, the
mutex is only acquired so that run_isr flag can be set.

Fixes: 738521a687df ("usb: typec: ucsi: ccg: add runtime pm workaround")
Cc: stable@vger.kernel.org
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20191004100219.71152-2-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi_ccg.c