[PATCH 1/4] PCI: of: Add of_pci_clkreq_present()

Bjorn Helgaas helgaas at kernel.org
Wed Oct 22 09:22:29 PDT 2025


On Wed, Oct 22, 2025 at 03:59:13PM +0530, Manivannan Sadhasivam wrote:
> On Wed, Oct 22, 2025 at 06:13:59PM +0800, Shawn Lin wrote:
> > 在 2025/10/22 星期三 18:02, Manivannan Sadhasivam 写道:
> > > On Tue, Oct 21, 2025 at 03:48:24PM +0800, Shawn Lin wrote:
> > > > of_pci_clkreq_present() is used by host drivers to decide whether the clkreq#
> > > > is properly connected and could enable L1.1/L1.2 support.
> > > > 
> > > > Signed-off-by: Shawn Lin <shawn.lin at rock-chips.com>
> > > > ---
> > > >   drivers/pci/of.c  | 18 ++++++++++++++++++
> > > >   drivers/pci/pci.h |  6 ++++++
> > > >   2 files changed, 24 insertions(+)
> > > > 
> > > > diff --git a/drivers/pci/of.c b/drivers/pci/of.c
> > > > index 3579265f1198..52c6d365083b 100644
> > > > --- a/drivers/pci/of.c
> > > > +++ b/drivers/pci/of.c
> > > > @@ -1010,3 +1010,21 @@ int of_pci_get_equalization_presets(struct device *dev,
> > > >   	return 0;
> > > >   }
> > > >   EXPORT_SYMBOL_GPL(of_pci_get_equalization_presets);
> > > > +
> > > > +/**
> > > > + * of_pci_clkreq_present() - Check if the "supports-clkreq" is present
> > > 
> > > I don't see a benefit of this API, tbh. The API name creates an
> > > impression that the API will check for the presence of CLKREQ#
> > > signal in DT, but it checks for the presence of the
> > > 'supports-clkreq' property. Even though the presence of the
> > > property implies that the CLKREQ# routing is available, I'd
> > > prefer to check for the property explicitly instead of hiding it
> > > inside this API.
> > 
> > It makes sense.
> > 
> > Will the name of_pci_supports_clkreq_present() look good? Or we
> > just drop it and let host drivers to explicitly check
> > supports-clkreq inside their code?
> 
> I'd prefer to drop the API.

An API might help with consistency across DT bindings.  We don't want
drivers to pick their own names for 'supports-clkreq'.

But the pci-bus-common schema already includes 'supports-clkreq', and
that's probably enough:
https://github.com/devicetree-org/dt-schema/blob/979fea8f3c18/dtschema/schemas/pci/pci-bus-common.yaml#L155



More information about the Linux-rockchip mailing list