Skip to content

Commit

Permalink
usb: typec: ucsi: Always cancel the command if PPM reports BUSY condi…
Browse files Browse the repository at this point in the history
…tion

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>
  • Loading branch information
Heikki Krogerus authored and Greg Kroah-Hartman committed Oct 5, 2021
1 parent b53908f commit 094902b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/typec/ucsi/ucsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 094902b

Please sign in to comment.