summaryrefslogtreecommitdiff
path: root/drivers/usb/typec
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2021-09-20 17:24:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-05 12:42:37 +0200
commit094902bc6a3c831262c12d0c2095af6a5eb62eef (patch)
treeaefc5b71a80b3d7365d1202f15f060c2623fad1d /drivers/usb/typec
parentb53908f9a21424ae6982c93746f4ff5af4bfcb32 (diff)
usb: typec: ucsi: Always cancel the command if PPM reports BUSY condition
This makes it possible to execute next command immediately after the busy condition. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20210920142419.54493-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec')
-rw-r--r--drivers/usb/typec/ucsi/ucsi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 5ef5bd0e87cf..ffb5be51daf8 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -128,8 +128,10 @@ static int ucsi_exec_command(struct ucsi *ucsi, u64 cmd)
if (ret)
return ret;
- if (cci & UCSI_CCI_BUSY)
+ if (cci & UCSI_CCI_BUSY) {
+ ucsi->ops->async_write(ucsi, UCSI_CANCEL, NULL, 0);
return -EBUSY;
+ }
if (!(cci & UCSI_CCI_COMMAND_COMPLETE))
return -EIO;