diff mbox series

[v11,10/11] PCI: dwc: Print warning message when cpu_addr_fixup() exists

Message ID 20250313-pci_fixup_addr-v11-10-01d2313502ab@nxp.com (mailing list archive)
State New
Headers show
Series PCI: Use device bus range info to cleanup RC Host/EP pci_fixup_addr() | expand

Commit Message

Frank Li March 13, 2025, 3:38 p.m. UTC
If the parent 'ranges' property in DT correctly describes the address
translation, the cpu_addr_fixup() callback is not needed. Print a warning
message to inform users to correct their DTB files and prepare to remove
cpu_addr_fixup().

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
change from v10 to v11
- change to dev_warn()
- Bjorn: this is opitional patches to encourage user fix their dtb file.

change from v9 to v10
- new patch
---
 drivers/pci/controller/dwc/pcie-designware.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index 8b546131b97f6..d4dc8bf06d4c1 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -1125,6 +1125,8 @@  int dw_pcie_init_parent_bus_offset(struct dw_pcie *pci, const char *reg_name,
 
 	fixup = pci->ops->cpu_addr_fixup;
 	if (fixup) {
+		dev_warn(pci->dev, "cpu_addr_fixup() usage detected. Please fix your DTB!\n");
+
 		fixup_addr = fixup(pci, cpu_phy_addr);
 		if (reg_addr == fixup_addr) {
 			dev_warn(dev, "%#010llx %s reg[%d] == %#010llx; %ps is redundant\n",