Re: [PATCH 2/5] PCI: dwc: Add new APIs to remove standard and extended Capability

From: Qiang Yu

Date: Wed Dec 24 2025 - 01:20:51 EST


On Tue, Dec 23, 2025 at 08:24:26AM +0100, Niklas Cassel wrote:
> Hello Qiang Yu,
>
> I just saw that this patch was queued up.
>
> dw_pcie_remove_ext_capability() basically seems to be identical to:
> dw_pcie_ep_hide_ext_capability(), only that your new function does
> not require previous cap as an argument (so it seems better).
>
> It seems a bit silly to have two functions that do the same thing,
> perhaps you can send a patch that removes dw_pcie_ep_hide_ext_capability()
> and updates the only user of that function to use your new function?
>
> Sorry for not seeing this earlier.
>
Hi Niklas

Thank you for the comments. I'd be happy to send a follow-up patch to
resolve this.

- Qiang Yu
>
> Kind regards,
> Niklas
>
> On Sun, Nov 09, 2025 at 10:59:41PM -0800, Qiang Yu wrote:
> > On some platforms, certain PCIe Capabilities may be present in hardware
> > but are not fully implemented as defined in PCIe spec. These incomplete
> > capabilities should be hidden from the PCI framework to prevent unexpected
> > behavior.
> >
> > Introduce two APIs to remove a specific PCIe Capability and Extended
> > Capability by updating the previous capability's next offset field to skip
> > over the unwanted capability. These APIs allow RC drivers to easily hide
> > unsupported or partially implemented capabilities from software.
> >
> > Co-developed-by: Wenbin Yao <wenbin.yao@xxxxxxxxxxxxxxxx>
> > Signed-off-by: Wenbin Yao <wenbin.yao@xxxxxxxxxxxxxxxx>
> > Signed-off-by: Qiang Yu <qiang.yu@xxxxxxxxxxxxxxxx>
> > ---
> > drivers/pci/controller/dwc/pcie-designware.c | 53 ++++++++++++++++++++++++++++
> > drivers/pci/controller/dwc/pcie-designware.h | 2 ++
> > 2 files changed, 55 insertions(+)