840-0001-PCI-of-Don-t-fail-devm_pci_alloc_host_bridge-on-miss.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From: Rob Herring <[email protected]>
  2. Date: Tue, 3 Aug 2021 15:56:55 -0600
  3. Subject: [PATCH] PCI: of: Don't fail devm_pci_alloc_host_bridge() on missing
  4. 'ranges'
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Commit 669cbc708122 ("PCI: Move DT resource setup into
  9. devm_pci_alloc_host_bridge()") made devm_pci_alloc_host_bridge() fail on
  10. any DT resource parsing errors, but Broadcom iProc uses
  11. devm_pci_alloc_host_bridge() on BCMA bus devices that don't have DT
  12. resources. In particular, there is no 'ranges' property. Fix iProc by
  13. making 'ranges' optional.
  14. If 'ranges' is required by a platform, there's going to be more errors
  15. latter on if it is missing.
  16. Fixes: 669cbc708122 ("PCI: Move DT resource setup into devm_pci_alloc_host_bridge()")
  17. Reported-by: Rafał Miłecki <[email protected]>
  18. Cc: Srinath Mannam <[email protected]>
  19. Cc: Roman Bacik <[email protected]>
  20. Cc: Bharat Gooty <[email protected]>
  21. Cc: Abhishek Shah <[email protected]>
  22. Cc: Jitendra Bhivare <[email protected]>
  23. Cc: Ray Jui <[email protected]>
  24. Cc: Florian Fainelli <[email protected]>
  25. Cc: BCM Kernel Feedback <[email protected]>
  26. Cc: Scott Branden <[email protected]>
  27. Cc: Bjorn Helgaas <[email protected]>
  28. Cc: Lorenzo Pieralisi <[email protected]>
  29. Signed-off-by: Rob Herring <[email protected]>
  30. Acked-by: Bjorn Helgaas <[email protected]>
  31. ---
  32. drivers/pci/of.c | 2 +-
  33. 1 file changed, 1 insertion(+), 1 deletion(-)
  34. --- a/drivers/pci/of.c
  35. +++ b/drivers/pci/of.c
  36. @@ -295,7 +295,7 @@ static int devm_of_pci_get_host_bridge_r
  37. /* Check for ranges property */
  38. err = of_pci_range_parser_init(&parser, dev_node);
  39. if (err)
  40. - goto failed;
  41. + return 0;
  42. dev_dbg(dev, "Parsing ranges property...\n");
  43. for_each_of_pci_range(&parser, &range) {