public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] PCI: rcar: Do not abort on too many inbound dma-ranges
@ 2019-07-09  1:15 marek.vasut
  2019-07-09  1:15 ` [PATCH 2/2] PCI: rcar: Recalculate inbound range alignment for each controller entry marek.vasut
  2019-07-09  6:58 ` [PATCH 1/2] PCI: rcar: Do not abort on too many inbound dma-ranges Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From: marek.vasut @ 2019-07-09  1:15 UTC (permalink / raw)
  To: linux-pci
  Cc: Marek Vasut, Geert Uytterhoeven, Lorenzo Pieralisi, Wolfram Sang,
	linux-renesas-soc

From: Marek Vasut <marek.vasut+renesas@gmail.com>

In case the "dma-ranges" DT property contains either too many ranges
or the range start address is unaligned in such a way that populating
the range into the controller requires multiple entries, a situation
may occur where all ranges cannot be loaded into the controller.

Currently, the driver refuses to probe in such a situation. Relax this
behavior, load as many ranges as possible and warn if some ranges do
not fit anymore.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-renesas-soc@vger.kernel.org
To: linux-pci@vger.kernel.org
---
 drivers/pci/controller/pcie-rcar.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pcie-rcar.c b/drivers/pci/controller/pcie-rcar.c
index f6a669a9af41..938adff4148f 100644
--- a/drivers/pci/controller/pcie-rcar.c
+++ b/drivers/pci/controller/pcie-rcar.c
@@ -1069,8 +1069,9 @@ static int rcar_pcie_inbound_ranges(struct rcar_pcie *pcie,
 		idx += 2;
 
 		if (idx > MAX_NR_INBOUND_MAPS) {
-			dev_err(pcie->dev, "Failed to map inbound regions!\n");
-			return -EINVAL;
+			dev_warn(pcie->dev,
+				 "Too many inbound regions, not all are mapped.\n");
+			break;
 		}
 	}
 	*index = idx;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-10  7:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-09  1:15 [PATCH 1/2] PCI: rcar: Do not abort on too many inbound dma-ranges marek.vasut
2019-07-09  1:15 ` [PATCH 2/2] PCI: rcar: Recalculate inbound range alignment for each controller entry marek.vasut
2019-07-10  7:13   ` Simon Horman
2019-07-09  6:58 ` [PATCH 1/2] PCI: rcar: Do not abort on too many inbound dma-ranges Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox