Thread (10 messages) flat view 10 messages, 4 authors, 2018-09-27

Re: [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available

From: Roy Pledge <hidden>
Date: 2018-08-24 14:52:09
Also in: linux-arm-kernel, lkml

On 8/23/2018 5:36 PM, Alexandre Belloni wrote:=0A=
If the qman driver (qman_ccsr) doesn't probe or fail to probe before=0A=
qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an=
=0A=
unmapped page.=0A=
=0A=
This leads to a crash when probing  qman_portal as the init_pcfg function=
=0A=
quoted hunk ↗ jump to hunk
calls qman_liodn_fixup that tries to read qman registers.=0A=
=0A=
Assume that qman didn't probe when the pool mask is 0.=0A=
=0A=
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>=0A=
---=0A=
 drivers/soc/fsl/qbman/qman_portal.c | 2 ++=0A=
 1 file changed, 2 insertions(+)=0A=
=0A=
diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/=
qman_portal.c=0A=
quoted hunk ↗ jump to hunk
index a120002b630e..4fc80d2c8feb 100644=0A=
--- a/drivers/soc/fsl/qbman/qman_portal.c=0A=
+++ b/drivers/soc/fsl/qbman/qman_portal.c=0A=
@@ -277,6 +277,8 @@ static int qman_portal_probe(struct platform_device *=
pdev)=0A=
 	}=0A=
 =0A=
 	pcfg->pools =3D qm_get_pools_sdqcr();=0A=
+	if (pcfg->pools =3D=3D 0)=0A=
+		return -EPROBE_DEFER;=0A=
 =0A=
 	spin_lock(&qman_lock);=0A=
 	cpu =3D cpumask_next_zero(-1, &portal_cpus);=0A=
=0A=
Reviewed-by: Roy Pledge <redacted>=0A=
=0A=
=0A=
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help