]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: typec: ucsi: acpi: Increase command completion timeout value
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Wed, 16 Sep 2020 09:00:33 +0000 (12:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Sep 2020 10:59:59 +0000 (12:59 +0200)
commitee0ea57b4f48b61dc367c84727e8b493080bd256
tree35343e32d8d6e69bb4d93b86a1663db507ed740a
parente61ab5c7d3af9dfe32b182f1e257c3a8084c8578
usb: typec: ucsi: acpi: Increase command completion timeout value

commit 130a96d698d7bee9f339832d1e47ab26aad8dbf1 upstream.

UCSI specification quite clearly states that if a command
can't be completed in 10ms, the firmware must notify
about BUSY condition. Unfortunately almost none of the
platforms (the firmware on them) generate the BUSY
notification even if a command can't be completed in time.

The driver already considered that, and used a timeout
value of 5 seconds, but processing especially the alternate
mode discovery commands takes often considerable amount of
time from the firmware, much more than the 5 seconds. That
happens especially after bootup when devices are already
connected to the USB Type-C connector. For now on those
platforms the alternate mode discovery has simply failed
because of the timeout.

To improve the situation, increasing the timeout value for
the command completion to 1 minute. That should give enough
time for even the slowest firmware to process the commands.

Fixes: f56de278e8ec ("usb: typec: ucsi: acpi: Move to the new API")
Cc: stable@vger.kernel.org
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20200916090034.25119-2-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi_acpi.c