aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian A. Ehrhardt <[email protected]>2024-03-20 08:39:24 +0100
committerGreg Kroah-Hartman <[email protected]>2024-03-26 15:00:44 +0100
commit6b5c85ddeea77d18c4b69e3bda60e9374a20c304 (patch)
treee5e5caa02b0e525244d2ad79eb49619c7da54d11
parent808a8b9e0b87bbc72bcc1f7ddfe5d04746e7ce56 (diff)
usb: typec: ucsi: Ack unsupported commands
If a command completes the OPM must send an ack. This applies to unsupported commands, too. Send the required ACK for unsupported commands. Signed-off-by: Christian A. Ehrhardt <[email protected]> Cc: stable <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8550-QRD Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/usb/typec/ucsi/ucsi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index dceeed207569..63f340dbd867 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -151,8 +151,12 @@ static int ucsi_exec_command(struct ucsi *ucsi, u64 cmd)
if (!(cci & UCSI_CCI_COMMAND_COMPLETE))
return -EIO;
- if (cci & UCSI_CCI_NOT_SUPPORTED)
+ if (cci & UCSI_CCI_NOT_SUPPORTED) {
+ if (ucsi_acknowledge_command(ucsi) < 0)
+ dev_err(ucsi->dev,
+ "ACK of unsupported command failed\n");
return -EOPNOTSUPP;
+ }
if (cci & UCSI_CCI_ERROR) {
if (cmd == UCSI_GET_ERROR_STATUS)