]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.10.215/usb-typec-ucsi-ack-unsupported-commands.patch
Linux 5.10.215
[thirdparty/kernel/stable-queue.git] / releases / 5.10.215 / usb-typec-ucsi-ack-unsupported-commands.patch
CommitLineData
30daf967
GKH
1From 6b5c85ddeea77d18c4b69e3bda60e9374a20c304 Mon Sep 17 00:00:00 2001
2From: "Christian A. Ehrhardt" <lk@c--e.de>
3Date: Wed, 20 Mar 2024 08:39:24 +0100
4Subject: usb: typec: ucsi: Ack unsupported commands
5
6From: Christian A. Ehrhardt <lk@c--e.de>
7
8commit 6b5c85ddeea77d18c4b69e3bda60e9374a20c304 upstream.
9
10If a command completes the OPM must send an ack. This applies
11to unsupported commands, too.
12
13Send the required ACK for unsupported commands.
14
15Signed-off-by: Christian A. Ehrhardt <lk@c--e.de>
16Cc: stable <stable@kernel.org>
17Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
18Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD
19Link: https://lore.kernel.org/r/20240320073927.1641788-4-lk@c--e.de
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21---
22 drivers/usb/typec/ucsi/ucsi.c | 6 +++++-
23 1 file changed, 5 insertions(+), 1 deletion(-)
24
25--- a/drivers/usb/typec/ucsi/ucsi.c
26+++ b/drivers/usb/typec/ucsi/ucsi.c
27@@ -138,8 +138,12 @@ static int ucsi_exec_command(struct ucsi
28 if (!(cci & UCSI_CCI_COMMAND_COMPLETE))
29 return -EIO;
30
31- if (cci & UCSI_CCI_NOT_SUPPORTED)
32+ if (cci & UCSI_CCI_NOT_SUPPORTED) {
33+ if (ucsi_acknowledge_command(ucsi) < 0)
34+ dev_err(ucsi->dev,
35+ "ACK of unsupported command failed\n");
36 return -EOPNOTSUPP;
37+ }
38
39 if (cci & UCSI_CCI_ERROR) {
40 if (cmd == UCSI_GET_ERROR_STATUS)