From: Hans de Goede <hdegoede@redhat.com>
To: Kyle Tso <kyletso@google.com>,
Badhri Jagan Sridharan <badhri@google.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Guenter Roeck <linux@roeck-us.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
USB <linux-usb@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Will McVicker <willmcvicker@google.com>
Subject: Re: [PATCH v5 1/3] usb: typec: tcpm: AMS and Collision Avoidance
Date: Wed, 13 Jan 2021 21:55:49 +0100 [thread overview]
Message-ID: <ad606425-8c2c-d95b-5d72-602d55ac6aa2@redhat.com> (raw)
In-Reply-To: <CAGZ6i=2cQywq82QrJg=t-KVMqSdjME-dkd-8aH3au_RTju2zTA@mail.gmail.com>
Hi,
On 1/13/21 3:46 PM, Kyle Tso wrote:
> On Wed, Jan 13, 2021 at 2:11 PM Badhri Jagan Sridharan
> <badhri@google.com> wrote:
>>
>> Hi Kyle,
>>
>> Do you want to handle the FAST_ROLE_SWAP case as well ?
>>
> I forgot this part....
> Thanks for catching this.
> I will fix it.
That sounds like a v6 is upcoming which not only will have
code-style changes but also some functional changes ?
In that case I will wait a bit before running the tests
which I want to run with this patch-set and run those
tests with v6 so that I don't have to redo them later.
Regards,
Hans
>
>
>> You would have to fix up in two places:
>>
>> #1
>> - if (port->state == SNK_READY)
>> - tcpm_set_state(port, FR_SWAP_SEND, 0);
>> - else
>> + if (port->state == SNK_READY) {
>> + int ret;
>> +
>> + port->upcoming_state = FR_SWAP_SEND;
>> + ret = tcpm_ams_start(port, FAST_ROLE_SWAP);
>> + if (ret == -EAGAIN)
>> + port->upcoming_state = INVALID_STATE;
>> + } else {
>> tcpm_log(port, "Discarding FRS_SIGNAL!
>> Not in sink ready");
>> + }
>>
>> #2
>> --- a/drivers/usb/typec/tcpm/tcpm.c
>> +++ b/drivers/usb/typec/tcpm/tcpm.c
>> @@ -4449,9 +4449,14 @@ static void tcpm_enable_frs_work(struct
>> kthread_work *work)
>> if (port->state != SNK_READY || port->vdm_state !=
>> VDM_STATE_DONE || port->send_discover)
>> goto resched;
>>
>> - tcpm_set_state(port, GET_SINK_CAP, 0);
>> - port->sink_cap_done = true;
>> -
>> + port->upcoming_state = GET_SINK_CAP;
>> + ret = tcpm_ams_start(port, GET_SINK_CAPABILITIES);
>> + if (ret == -EAGAIN) {
>> + port->upcoming_state = INVALID_STATE;
>> + } else {
>> + port->sink_cap_done = true;
>> + goto unlock;
>> + }
>>
>> Thanks,
>> Badhri
>>
>>
>
next prev parent reply other threads:[~2021-01-13 21:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 16:39 [PATCH v5 0/3] AMS, Collision Avoidance, and Protocol Error Kyle Tso
2021-01-05 16:39 ` [PATCH v5 1/3] usb: typec: tcpm: AMS and Collision Avoidance Kyle Tso
2021-01-12 13:29 ` Heikki Krogerus
2021-01-13 6:10 ` Badhri Jagan Sridharan
2021-01-13 14:46 ` Kyle Tso
2021-01-13 20:55 ` Hans de Goede [this message]
2021-01-13 14:44 ` Kyle Tso
2021-01-05 16:39 ` [PATCH v5 2/3] usb: typec: tcpm: Protocol Error handling Kyle Tso
2021-01-12 13:56 ` Heikki Krogerus
2021-01-13 14:50 ` Kyle Tso
2021-01-05 16:39 ` [PATCH v5 3/3] usb: typec: tcpm: Respond Wait if VDM state machine is running Kyle Tso
2021-01-12 11:53 ` [PATCH v5 0/3] AMS, Collision Avoidance, and Protocol Error Greg KH
2021-01-12 11:57 ` Hans de Goede
2021-01-12 12:06 ` Greg KH
2021-01-12 11:59 ` Heikki Krogerus
2021-01-12 14:09 ` Guenter Roeck
2021-01-13 11:41 ` Heikki Krogerus
2021-01-12 14:04 ` 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=ad606425-8c2c-d95b-5d72-602d55ac6aa2@redhat.com \
--to=hdegoede@redhat.com \
--cc=badhri@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kyletso@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=willmcvicker@google.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;
as well as URLs for NNTP newsgroup(s).