[Unstable/OEM-5.14] [PATCH 2/7] usb: typec: ucsi: Don't stop alt mode registration on busy condition

Kai-Heng Feng kai.heng.feng at canonical.com
Tue Nov 16 01:39:00 UTC 2021


From: Heikki Krogerus <heikki.krogerus at linux.intel.com>

BugLink: https://bugs.launchpad.net/bugs/1950974

If the PPM says it's busy, we can now simply try again.

Signed-off-by: Heikki Krogerus <heikki.krogerus at linux.intel.com>
Link: https://lore.kernel.org/r/20210920142419.54493-3-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
(cherry picked from commit 47eb8de3bbde346b880bb65ef0abe907d7fd6438)
Signed-off-by: Kai-Heng Feng <kai.heng.feng at canonical.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index ffb5be51daf85..a35efd8174bd4 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -437,6 +437,8 @@ static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient)
 		command |= UCSI_GET_ALTMODE_CONNECTOR_NUMBER(con->num);
 		command |= UCSI_GET_ALTMODE_OFFSET(i);
 		len = ucsi_send_command(con->ucsi, command, alt, sizeof(alt));
+		if (len == -EBUSY)
+			continue;
 		if (len <= 0)
 			return len;
 
-- 
2.32.0




More information about the kernel-team mailing list