linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available
@ 2018-08-23 21:35 Alexandre Belloni
  2018-08-23 21:36 ` [PATCH 2/2] soc: fsl: qbman: qman: avoid allocating from non existing gen_pool Alexandre Belloni
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Alexandre Belloni @ 2018-08-23 21:35 UTC (permalink / raw)
  To: Li Yang
  Cc: Roy Pledge, linuxppc-dev, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

If the qman driver (qman_ccsr) doesn't probe or fail to probe before
qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an
unmapped page.

This leads to a crash when probing  qman_portal as the init_pcfg function
calls qman_liodn_fixup that tries to read qman registers.

Assume that qman didn't probe when the pool mask is 0.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/soc/fsl/qbman/qman_portal.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
index a120002b630e..4fc80d2c8feb 100644
--- a/drivers/soc/fsl/qbman/qman_portal.c
+++ b/drivers/soc/fsl/qbman/qman_portal.c
@@ -277,6 +277,8 @@ static int qman_portal_probe(struct platform_device *pdev)
 	}
 
 	pcfg->pools = qm_get_pools_sdqcr();
+	if (pcfg->pools == 0)
+		return -EPROBE_DEFER;
 
 	spin_lock(&qman_lock);
 	cpu = cpumask_next_zero(-1, &portal_cpus);
-- 
2.18.0


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

end of thread, other threads:[~2018-09-27 19:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-23 21:35 [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available Alexandre Belloni
2018-08-23 21:36 ` [PATCH 2/2] soc: fsl: qbman: qman: avoid allocating from non existing gen_pool Alexandre Belloni
2018-08-24 14:53   ` Roy Pledge
2018-08-24 14:52 ` [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available Roy Pledge
2018-08-28 22:49   ` Li Yang
2018-09-25 19:45 ` Olof Johansson
2018-09-25 22:11   ` Li Yang
2018-09-26  9:27   ` Alexandre Belloni
2018-09-26 18:15     ` Li Yang
2018-09-27 19:24       ` Li Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).