Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 8bdf8a4

Browse files
Heikki Krogerusgregkh
authored andcommitted
usb: typec: ucsi: Ack also failed Get Error commands
It is possible that also the GET_ERROR command fails. If that happens, the command completion still needs to be acknowledged. Otherwise the interface will be stuck until it's reset. Reported-by: Ammy Yi <ammy.yi@intel.com> Fixes: bdc62f2 ("usb: typec: ucsi: Simplified registration and I/O API") Cc: stable@vger.kernel.org Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20240531104653.1303519-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f85d39d commit 8bdf8a4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/usb/typec/ucsi/ucsi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,13 @@ static int ucsi_exec_command(struct ucsi *ucsi, u64 cmd)
153153
}
154154

155155
if (cci & UCSI_CCI_ERROR) {
156-
if (cmd == UCSI_GET_ERROR_STATUS)
156+
if (cmd == UCSI_GET_ERROR_STATUS) {
157+
ret = ucsi_acknowledge(ucsi, false);
158+
if (ret)
159+
return ret;
160+
157161
return -EIO;
162+
}
158163
return ucsi_read_error(ucsi);
159164
}
160165

0 commit comments

Comments
 (0)