From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Ulrich Huber <ulrich@huberulrich.de>
Cc: linux-usb@vger.kernel.org
Subject: [RFC PATCH 1/7] usb: typec: ucsi: Always cancel the command if PPM reports BUSY condition
Date: Thu, 26 Aug 2021 17:31:40 +0300 [thread overview]
Message-ID: <20210826143146.25799-2-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <20210826143146.25799-1-heikki.krogerus@linux.intel.com>
This makes it possible to execute next command immediately
after the busy condition.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
drivers/usb/typec/ucsi/ucsi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 5ef5bd0e87cf2..ffb5be51daf85 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;
--
2.32.0
next prev parent reply other threads:[~2021-08-26 14:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-26 14:31 [RFC PATCH 0/7] UCSI work Heikki Krogerus
2021-08-26 14:31 ` Heikki Krogerus [this message]
2021-08-26 14:31 ` [RFC PATCH 2/7] usb: typec: ucsi: Don't stop alt mode registration on busy condition Heikki Krogerus
2021-08-26 14:31 ` [RFC PATCH 3/7] usb: typec: ucsi: Add polling mechanism for partner tasks like alt mode checking Heikki Krogerus
2021-08-26 14:31 ` [RFC PATCH 4/7] usb: typec: ucsi: acpi: Reduce the command completion timeout Heikki Krogerus
2021-08-26 14:31 ` [RFC PATCH 5/7] usb: typec: ucsi: Check the partner alt modes always if there is PD contract Heikki Krogerus
2021-08-26 14:31 ` [RFC PATCH 6/7] usb: typec: ucsi: Read the PDOs in separate work Heikki Krogerus
2021-08-26 14:31 ` [RFC PATCH 7/7] usb: typec: ucsi: Better fix for missing unplug events issue Heikki Krogerus
-- strict thread matches above, loose matches on Subject: below --
2021-06-07 13:14 [RFC PATCH 0/7] usb: typec: ucsi: Polling the alt modes and PDOs Heikki Krogerus
2021-06-07 13:14 ` [RFC PATCH 1/7] usb: typec: ucsi: Always cancel the command if PPM reports BUSY condition Heikki Krogerus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210826143146.25799-2-heikki.krogerus@linux.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=linux-usb@vger.kernel.org \
--cc=ulrich@huberulrich.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).