lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 13 Jan 2021 21:55:49 +0100
From:   Hans de Goede <hdegoede@...hat.com>
To:     Kyle Tso <kyletso@...gle.com>,
        Badhri Jagan Sridharan <badhri@...gle.com>
Cc:     Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Guenter Roeck <linux@...ck-us.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        USB <linux-usb@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Will McVicker <willmcvicker@...gle.com>
Subject: Re: [PATCH v5 1/3] usb: typec: tcpm: AMS and Collision Avoidance

Hi,

On 1/13/21 3:46 PM, Kyle Tso wrote:
> On Wed, Jan 13, 2021 at 2:11 PM Badhri Jagan Sridharan
> <badhri@...gle.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
>>
>>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ