Re: [PATCH v2 2/2] platform/chrome: cros_ec_typec: Avoid setting usb role during disconnect

From: Heikki Krogerus
Date: Thu Aug 06 2020 - 13:25:55 EST


On Wed, Aug 05, 2020 at 12:37:14PM -0700, Prashant Malani wrote:
> Hi Azhar,
>
>
> On Wed, Aug 5, 2020 at 12:22 PM Shaikh, Azhar <azhar.shaikh@xxxxxxxxx> wrote:
> >
> > Hi Prashant,
> >
> > > Is this documented anywhere? Kindly provide the links to that if so. I wasn't
> > > aware of any ordering requirements (but I may be missing something).
> >
> > The configuration of the connector should always happen in the order defined in the
> > USB Type-C specification. Check ch. 2.3 (USB Type-C Spec R2.0). So that will basically give you:
> >
> > 1. orientation
> > 2. role(s)
> > 3. the rest.
>
> Thanks for the link. Are you referring to Section 2.3 (Configuration
> Process) ? I couldn't find anything there which
> implied any required ordering (I'm reading Release 2.0, Aug 2019, so I
> don't know if something has been added since).
> Could you kindly point me to the appropriate subsection?

Please check the section 4.5.1.2 (Connecting Sources and Sinks). Check
the typical flow. You can also check the Connection State Machine
Requirements. The order should be clear from those as well.

1. Source/sink detection
2. Orientation
3. Data role
4. VCONN
5. VBUS (USB Type-C currents)
6. The connector is now configured. We can start the PD communication
that should lead into configuration of the mux if we enter a mode.

The data role, the thing that we are talking about here, really should
be set before the mux is configured.

> Additionally, I think any ordering requirements there are already
> handled by the TCPM in the Chrome OS EC.

The TCPM does not execute the steps that configure the port on this
platform. The OS is the part that actually executes the steps.

That is one reason (but not the only one) why it is important that
both parts follow the order that is proposed in the spec. Otherwise we
may endup negotiating things with the partner in one order but then
actually executing those steps in some other.


thanks,

--
heikki