Re: [PATCH v5 2/8] usb: pd: Update VDO definitions

Kyle Tso
2021-02-04T02:26:03Z

On Thu, Feb 4, 2021 at 12:55 AM Benson Leung <bleung@chromium.org> wrote:
>
> Hey Kyle,
>
> On Tue, Feb 2, 2021 at 8:23 AM Kyle Tso <kyletso@google.com> wrote:
> >
> > "PD Spec Revision 3.0 Version 2.0 + ECNs 2020-12-10" introduces several
> > changes regarding the ID Header VDO and the Product Type VDOs.
> >
> > Signed-off-by: Kyle Tso <kyletso@google.com>
>
> We have to actually be very careful in this change, because the switch
> from PD 2.0 -> PD 3.0 does not mean that a PD 3.0 DFP will never
> encounter a PD 2.0 partner or cable again.
>
> It actually has to be the case that we may have to maintain two sets
> of these object field definitions (and any other PD object decoding we
> do in the kernel) and switch the decoding on pd_revision (which I
> recently added here:
> https://lore.kernel.org/linux-usb/20210129061406.2680146-3-bleung@chromium.org).
>
> Just to put a point on it: PD 2.0's Passive Cable VDO has B4, which is
> "Vbus through cable." PD 3.0, on the other hand, reserves this bit, so
> the field is gone. We can't just delete that bit in the kernel's data
> structures. We have to be able to refer to it if we encounter a PD 2.0
> cable.
>
> I think this change needs to be reworked so that we strictly maintain
> a PD 2.0 object field definitions, and a separate PD 3.0 one too. They
> will operate on the same objects, but whoever's doing the decoding has
> to check the revision (2.0 vs 3.0) first to check applicability of one
> set or the other.
>
> Thanks,
> Benson
>
>
> --
> Benson Leung
> Staff Software Engineer
> Chrome OS Kernel
> Google Inc.
> bleung@google.com
> Chromium OS Project
> bleung@chromium.org

You are correct!
Fix is here: https://patchwork.kernel.org/project/linux-usb/patch/20210204005036.1555294-1-kyletso@google.com/

thanks,
Kyle