From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Sergei Shtylyov <sergei.shtylyov@gmail.com>
Cc: Benjamin Berg <bberg@redhat.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/7] usb: typec: ucsi: Don't stop alt mode registration on busy condition
Date: Tue, 8 Jun 2021 16:18:32 +0300 [thread overview]
Message-ID: <YL9uKFiHm0fht67X@kuha.fi.intel.com> (raw)
In-Reply-To: <2f4bf248-cd27-623d-5984-fafa931404fa@gmail.com>
On Tue, Jun 08, 2021 at 12:31:45PM +0300, Sergei Shtylyov wrote:
> Hello!
>
> On 07.06.2021 16:14, Heikki Krogerus wrote:
>
> > If the PPM tells it's busy, we can now simply try again.
> >
> > Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > ---
> > drivers/usb/typec/ucsi/ucsi.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> > index 366c8a468bc18..a8e0e31dcddf5 100644
> > --- a/drivers/usb/typec/ucsi/ucsi.c
> > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > @@ -437,8 +437,11 @@ static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient)
> > command |= UCSI_GET_ALTMODE_CONNECTOR_NUMBER(con->num);
> > command |= UCSI_GET_ALTMODE_OFFSET(i);
> > len = ucsi_send_command(con->ucsi, command, alt, sizeof(alt));
>
> Could insert your check here, to reduce the indentation...
Sure thing.
> > - if (len <= 0)
> > + if (len <= 0) {
> > + if (len == -EBUSY)
> > + continue;
> > return len;
> > + }
> > /*
> > * This code is requesting one alt mode at a time, but some PPMs
thanks,
--
heikki
next prev parent reply other threads:[~2021-06-08 13:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
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
2021-06-07 13:14 ` [RFC PATCH 2/7] usb: typec: ucsi: Don't stop alt mode registration on busy condition Heikki Krogerus
2021-06-08 9:31 ` Sergei Shtylyov
2021-06-08 13:18 ` Heikki Krogerus [this message]
2021-06-07 13:14 ` [RFC PATCH 3/7] usb: typec: ucsi: Add poll worker for alternate modes Heikki Krogerus
2021-06-07 13:14 ` [RFC PATCH 4/7] usb: typec: ucsi: acpi: Reduce the command completion timeout Heikki Krogerus
2021-06-07 13:14 ` [RFC PATCH 5/7] usb: typec: ucsi: Process every connector change as unique connector state Heikki Krogerus
2021-06-07 13:14 ` [RFC PATCH 6/7] usb: typec: ucsi: Filter out spurious events Heikki Krogerus
2021-06-07 13:14 ` [RFC PATCH 7/7] usb: typec: ucsi: Read the PDOs in separate work Heikki Krogerus
2021-06-07 20:09 ` [RFC PATCH 0/7] usb: typec: ucsi: Polling the alt modes and PDOs Benjamin Berg
2021-06-08 6:42 ` Heikki Krogerus
2021-06-08 6:54 ` Heikki Krogerus
2021-06-08 19:32 ` Benjamin Berg
2021-06-09 11:25 ` Heikki Krogerus
2021-06-09 12:18 ` Heikki Krogerus
2021-06-09 12:56 ` Heikki Krogerus
2021-06-09 17:39 ` Benjamin Berg
2021-06-10 12:07 ` Heikki Krogerus
-- strict thread matches above, loose matches on Subject: below --
2021-08-26 14:31 [RFC PATCH 0/7] UCSI work Heikki Krogerus
2021-08-26 14:31 ` [RFC PATCH 2/7] usb: typec: ucsi: Don't stop alt mode registration on 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=YL9uKFiHm0fht67X@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=bberg@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sergei.shtylyov@gmail.com \
/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