Re: [PATCH v7 1/2] PCI: of: Remove max-link-speed generation validation
From: Hans Zhang
Date: Mon Mar 09 2026 - 10:53:58 EST
On 2026/3/9 19:47, Manivannan Sadhasivam wrote:
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...
Hi Mani,
For the second patch in this series, I made the changes based on Bjorn's comments. Maybe I misunderstood something.
Bjorn's reply:
https://lore.kernel.org/linux-pci/20260306170856.GA107733@bhelgaas/
May I ask if I should place the second patch on top of the first one? Is it just a matter of swapping the order of the two patches? Do you have any good methods?
Best regards,
Hans
- Mani