Re: [PATCH v2] PCI/TPH: fold reserved completer encoding in get_rp_completer_type()
From: Zhiping Zhang
Date: Thu Jul 16 2026 - 14:44:46 EST
> > > - return FIELD_GET(PCI_EXP_DEVCAP2_TPH_COMP_MASK, reg);
> > > + return tph_completer_type_fold(FIELD_GET(PCI_EXP_DEVCAP2_TPH_COMP_MASK,
> > > + reg));
> >
> > Is this just defensive programming, or is there some hardware out
> > there that uses this reserved value? It's kind of an ugly wart to add
> > just for theoretical spec conformance testing.
>
> I’m not aware of any hardware that actually uses this reserved value. While
> being cautious is great, my view is that such RP is bad — arguably to the
> point where writing 0b10 straight to the device might be a right response
> (kidding).
>
Thanks for confirming -- I'll frame the changelog as defensive hardening.
> >
> > If we really need it, I'd rather read something like this:
> >
> > tph_comp = FIELD_GET(PCI_EXP_DEVCAP2_TPH_COMP_MASK, reg);
>
> This looks reasonable to me. It might help to add a one-line comment
> explaining why tph_comp is sanitized here?
>
Yes -- v3 switches to Bjorn's inline form with:
/*
* 0b10 is reserved; treat it as "not supported" so only the
* architected encodings reach the Requester Enable field.
*/
Thanks for the review,
Zhiping