Commit 37fe9b98 authored by Sean Anderson's avatar Sean Anderson Committed by Jakub Kicinski

net: dpaa2: Add some debug prints on deferred probe

When this device is deferred, there is often no way to determine what
the cause was. Add some debug prints to make it easier to figure out
what is blocking the probe.
Signed-off-by: default avatarSean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20221027190005.400839-1-sean.anderson@seco.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 0cf9deb3
......@@ -3038,10 +3038,12 @@ static struct fsl_mc_device *dpaa2_eth_setup_dpcon(struct dpaa2_eth_priv *priv)
err = fsl_mc_object_allocate(to_fsl_mc_device(dev),
FSL_MC_POOL_DPCON, &dpcon);
if (err) {
if (err == -ENXIO)
if (err == -ENXIO) {
dev_dbg(dev, "Waiting for DPCON\n");
err = -EPROBE_DEFER;
else
} else {
dev_info(dev, "Not enough DPCONs, will go on as-is\n");
}
return ERR_PTR(err);
}
......@@ -3151,7 +3153,9 @@ static int dpaa2_eth_setup_dpio(struct dpaa2_eth_priv *priv)
channel = dpaa2_eth_alloc_channel(priv);
if (IS_ERR_OR_NULL(channel)) {
err = PTR_ERR_OR_ZERO(channel);
if (err != -EPROBE_DEFER)
if (err == -EPROBE_DEFER)
dev_dbg(dev, "waiting for affine channel\n");
else
dev_info(dev,
"No affine channel for cpu %d and above\n", i);
goto err_alloc_ch;
......@@ -4605,8 +4609,10 @@ static int dpaa2_eth_connect_mac(struct dpaa2_eth_priv *priv)
dpni_dev = to_fsl_mc_device(priv->net_dev->dev.parent);
dpmac_dev = fsl_mc_get_endpoint(dpni_dev, 0);
if (PTR_ERR(dpmac_dev) == -EPROBE_DEFER)
if (PTR_ERR(dpmac_dev) == -EPROBE_DEFER) {
netdev_dbg(priv->net_dev, "waiting for mac\n");
return PTR_ERR(dpmac_dev);
}
if (IS_ERR(dpmac_dev) || dpmac_dev->dev.type != &fsl_mc_bus_dpmac_type)
return 0;
......@@ -4626,12 +4632,17 @@ static int dpaa2_eth_connect_mac(struct dpaa2_eth_priv *priv)
if (dpaa2_eth_is_type_phy(priv)) {
err = dpaa2_mac_connect(mac);
if (err && err != -EPROBE_DEFER)
netdev_err(priv->net_dev, "Error connecting to the MAC endpoint: %pe",
if (err) {
if (err == -EPROBE_DEFER)
netdev_dbg(priv->net_dev,
"could not connect to MAC\n");
else
netdev_err(priv->net_dev,
"Error connecting to the MAC endpoint: %pe",
ERR_PTR(err));
if (err)
goto err_close_mac;
}
}
return 0;
......@@ -4802,10 +4813,12 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
err = fsl_mc_portal_allocate(dpni_dev, FSL_MC_IO_ATOMIC_CONTEXT_PORTAL,
&priv->mc_io);
if (err) {
if (err == -ENXIO)
if (err == -ENXIO) {
dev_dbg(dev, "waiting for MC portal\n");
err = -EPROBE_DEFER;
else
} else {
dev_err(dev, "MC portal allocation failed\n");
}
goto err_portal_alloc;
}
......
......@@ -105,6 +105,7 @@ static struct fwnode_handle *dpaa2_mac_get_node(struct device *dev,
* thus the fwnode field is not yet set. Defer probe if we are
* facing this situation.
*/
dev_dbg(dev, "dprc not finished probing\n");
return ERR_PTR(-EPROBE_DEFER);
}
......@@ -264,8 +265,10 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac,
mdiodev = fwnode_mdio_find_device(node);
fwnode_handle_put(node);
if (!mdiodev)
if (!mdiodev) {
netdev_dbg(mac->net_dev, "missing PCS device\n");
return -EPROBE_DEFER;
}
mac->pcs = lynx_pcs_create(mdiodev);
if (!mac->pcs) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment