From: Rob Herring robh@kernel.org
stable inclusion from stable-5.10.68 commit b1f3be0c302a75ce2c712b9b5da930888426d686 bugzilla: 182671 https://gitee.com/openeuler/kernel/issues/I4EWUH
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=...
--------------------------------
[ Upstream commit d277f6e88c88729b1d57d40bbfb00d0bfc961972 ]
Commit 669cbc708122 ("PCI: Move DT resource setup into devm_pci_alloc_host_bridge()") made devm_pci_alloc_host_bridge() fail on any DT resource parsing errors, but Broadcom iProc uses devm_pci_alloc_host_bridge() on BCMA bus devices that don't have DT resources. In particular, there is no 'ranges' property. Fix iProc by making 'ranges' optional.
If 'ranges' is required by a platform, there's going to be more errors latter on if it is missing.
Link: https://lore.kernel.org/r/20210803215656.3803204-1-robh@kernel.org Fixes: 669cbc708122 ("PCI: Move DT resource setup into devm_pci_alloc_host_bridge()") Reported-by: Rafał Miłecki zajec5@gmail.com Tested-by: Rafał Miłecki rafal@milecki.pl Signed-off-by: Rob Herring robh@kernel.org Signed-off-by: Lorenzo Pieralisi lorenzo.pieralisi@arm.com Acked-by: Bjorn Helgaas bhelgaas@google.com Cc: Srinath Mannam srinath.mannam@broadcom.com Cc: Roman Bacik roman.bacik@broadcom.com Cc: Bharat Gooty bharat.gooty@broadcom.com Cc: Abhishek Shah abhishek.shah@broadcom.com Cc: Jitendra Bhivare jitendra.bhivare@broadcom.com Cc: Ray Jui ray.jui@broadcom.com Cc: Florian Fainelli f.fainelli@gmail.com Cc: BCM Kernel Feedback bcm-kernel-feedback-list@broadcom.com Cc: Scott Branden sbranden@broadcom.com Cc: Bjorn Helgaas bhelgaas@google.com Cc: Lorenzo Pieralisi lorenzo.pieralisi@arm.com Signed-off-by: Sasha Levin sashal@kernel.org Signed-off-by: Chen Jun chenjun102@huawei.com Acked-by: Weilong Chen chenweilong@huawei.com
Signed-off-by: Chen Jun chenjun102@huawei.com --- drivers/pci/of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/of.c b/drivers/pci/of.c index ac24cd5439a9..3f6ef2f45e57 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -295,7 +295,7 @@ static int devm_of_pci_get_host_bridge_resources(struct device *dev, /* Check for ranges property */ err = of_pci_range_parser_init(&parser, dev_node); if (err) - goto failed; + return 0;
dev_dbg(dev, "Parsing ranges property...\n"); for_each_of_pci_range(&parser, &range) {