]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.15/usb-typec-ucsi-ack-unsupported-commands.patch
6.6-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.15 / usb-typec-ucsi-ack-unsupported-commands.patch
1 From 6b5c85ddeea77d18c4b69e3bda60e9374a20c304 Mon Sep 17 00:00:00 2001
2 From: "Christian A. Ehrhardt" <lk@c--e.de>
3 Date: Wed, 20 Mar 2024 08:39:24 +0100
4 Subject: usb: typec: ucsi: Ack unsupported commands
5
6 From: Christian A. Ehrhardt <lk@c--e.de>
7
8 commit 6b5c85ddeea77d18c4b69e3bda60e9374a20c304 upstream.
9
10 If a command completes the OPM must send an ack. This applies
11 to unsupported commands, too.
12
13 Send the required ACK for unsupported commands.
14
15 Signed-off-by: Christian A. Ehrhardt <lk@c--e.de>
16 Cc: stable <stable@kernel.org>
17 Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
18 Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD
19 Link: https://lore.kernel.org/r/20240320073927.1641788-4-lk@c--e.de
20 Signed-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)