Re: [PATCH v7 1/2] PCI: of: Remove max-link-speed generation validation
From: Manivannan Sadhasivam
Date: Mon Mar 09 2026 - 07:48:03 EST
On Sun, Mar 08, 2026 at 10:26:28PM +0800, Hans Zhang wrote:
> The of_pci_get_max_link_speed() function currently validates the
> "max-link-speed" DT property to be in the range 1..4 (Gen1..Gen4).
> This imposes a maintenance burden because each new PCIe generation
> would require updating this validation.
>
> Remove the range check so the function returns the raw property value
> (or a negative error code if the property is missing or malformed).
> Callers must now validate the returned speed against the range they
> support. A subsequent patch adds such validation to the DWC driver,
> which is the primary user of this function.
>
> This change allows future PCIe generations to be supported without
> modifying drivers/pci/of.c.
>
> Signed-off-by: Hans Zhang <18255117159@xxxxxxx>
> Acked-by: Manivannan Sadhasivam <mani@xxxxxxxxxx>
I take my Ack back. If we decide to go with validating DTS properties (which is
fine though for non-resources such as clocks), then we should make sure that it
happens in a single patch.
Right now, you remove the check in one patch and add it back in another. That
leaves a window...
- Mani
--
மணிவண்ணன் சதாசிவம்