From: Heikki Krogerus Date: Mon, 20 Sep 2021 14:24:13 +0000 (+0300) Subject: usb: typec: ucsi: Always cancel the command if PPM reports BUSY condition X-Git-Tag: v6.1-rc5~2730^2~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=094902bc6a3c831262c12d0c2095af6a5eb62eef;p=platform%2Fkernel%2Flinux-starfive.git 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 Link: https://lore.kernel.org/r/20210920142419.54493-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 5ef5bd0..ffb5be51 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;