]> git.itanic.dy.fi Git - linux-stable/commitdiff
net: dpaa2: Add some debug prints on deferred probe
authorSean Anderson <sean.anderson@seco.com>
Thu, 27 Oct 2022 19:00:05 +0000 (15:00 -0400)
committerJakub Kicinski <kuba@kernel.org>
Tue, 1 Nov 2022 00:35:24 +0000 (17:35 -0700)
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: Sean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20221027190005.400839-1-sean.anderson@seco.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c

index 281d7e3905c167b85b5d014dd9667d0ae759c07f..892a1403c469f0cbddebfe03c99b5cf011c08dfc 100644 (file)
@@ -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,11 +4632,16 @@ 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",
-                                  ERR_PTR(err));
-               if (err)
+               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));
                        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;
        }
 
index 49ff85633783a362d7d1db9962b5a4c5ad7e17cd..2bbab28f763d8168d7ccbcb8147012c2bff62fdd 100644 (file)
@@ -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) {