mirror of https://gitee.com/openkylin/linux.git
dpaa_eth: defer probing after qbman
If the DPAA 1 Ethernet driver gets probed before the QBMan driver it will cause a boot crash. Add predictability in the probing order by deferring the Ethernet driver probe after QBMan and portals by using the recently introduced QBMan APIs. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9b56beed1e
commit
5537b32985
|
@ -2773,6 +2773,37 @@ static int dpaa_eth_probe(struct platform_device *pdev)
|
|||
int err = 0, i, channel;
|
||||
struct device *dev;
|
||||
|
||||
err = bman_is_probed();
|
||||
if (!err)
|
||||
return -EPROBE_DEFER;
|
||||
if (err < 0) {
|
||||
dev_err(&pdev->dev, "failing probe due to bman probe error\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
err = qman_is_probed();
|
||||
if (!err)
|
||||
return -EPROBE_DEFER;
|
||||
if (err < 0) {
|
||||
dev_err(&pdev->dev, "failing probe due to qman probe error\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
err = bman_portals_probed();
|
||||
if (!err)
|
||||
return -EPROBE_DEFER;
|
||||
if (err < 0) {
|
||||
dev_err(&pdev->dev,
|
||||
"failing probe due to bman portals probe error\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
err = qman_portals_probed();
|
||||
if (!err)
|
||||
return -EPROBE_DEFER;
|
||||
if (err < 0) {
|
||||
dev_err(&pdev->dev,
|
||||
"failing probe due to qman portals probe error\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* device used for DMA mapping */
|
||||
dev = pdev->dev.parent;
|
||||
err = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(40));
|
||||
|
|
Loading…
Reference in New Issue