Re: [PATCH] net: stmmac: don't use netdev_[dbg, info, ..] before net_device is registered

2017-01-16 Thread David Miller
From: Heiner Kallweit 
Date: Sun, 15 Jan 2017 19:19:00 +0100

> Don't use netdev_info and friends before the net_device is registered.
> This avoids ugly messages like
> "meson8b-dwmac c941.ethernet (unnamed net_device) (uninitialized):
> Enable RX Mitigation via HW Watchdog Timer"
> 
> Signed-off-by: Heiner Kallweit 

Indeed, this is a side-effect of the MDIO vs. register_netdev race fix
that went in the other week.

Applied, thanks.


Re: net: stmmac: don't use netdev_[dbg, info, ..] before net_device is registered

2017-01-15 Thread Heiner Kallweit
Am 15.01.2017 um 19:23 schrieb Joe Perches:
> On Sun, 2017-01-15 at 19:17 +0100, Heiner Kallweit wrote:
>> Don't use netdev_info and friends before the net_device is registered.
>> This avoids ugly messages like
>> "meson8b-dwmac c941.ethernet (unnamed net_device) (uninitialized):
>> Enable RX Mitigation via HW Watchdog Timer"
> 
> It'd be nice to mention the new message prefix.
> 
Sorry, I thought it's obvious because here the message trail looks
like this:

meson8b-dwmac c941.ethernet: DMA HW capability register supported
meson8b-dwmac c941.ethernet: Normal descriptors
meson8b-dwmac c941.ethernet: RX Checksum Offload Engine supported
meson8b-dwmac c941.ethernet: COE Type 2
meson8b-dwmac c941.ethernet: TX Checksum insertion supported
meson8b-dwmac c941.ethernet: Wake-Up On Lan supported
meson8b-dwmac c941.ethernet (unnamed net_device) (uninitialized): Enable RX 
Mitigation via HW Watchdog Timer

Better update the commit message and send a v2?



Re: net: stmmac: don't use netdev_[dbg, info, ..] before net_device is registered

2017-01-15 Thread Joe Perches
On Sun, 2017-01-15 at 19:17 +0100, Heiner Kallweit wrote:
> Don't use netdev_info and friends before the net_device is registered.
> This avoids ugly messages like
> "meson8b-dwmac c941.ethernet (unnamed net_device) (uninitialized):
> Enable RX Mitigation via HW Watchdog Timer"

It'd be nice to mention the new message prefix.


[PATCH] net: stmmac: don't use netdev_[dbg, info, ..] before net_device is registered

2017-01-15 Thread Heiner Kallweit
Don't use netdev_info and friends before the net_device is registered.
This avoids ugly messages like
"meson8b-dwmac c941.ethernet (unnamed net_device) (uninitialized):
Enable RX Mitigation via HW Watchdog Timer"

Signed-off-by: Heiner Kallweit 
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c 
b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index d481c5f7..38e1fb75 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3305,9 +3305,9 @@ int stmmac_dvr_probe(struct device *device,
(priv->plat->maxmtu >= ndev->min_mtu))
ndev->max_mtu = priv->plat->maxmtu;
else if (priv->plat->maxmtu < ndev->min_mtu)
-   netdev_warn(priv->dev,
-   "%s: warning: maxmtu having invalid value (%d)\n",
-   __func__, priv->plat->maxmtu);
+   dev_warn(priv->device,
+"%s: warning: maxmtu having invalid value (%d)\n",
+__func__, priv->plat->maxmtu);
 
if (flow_ctrl)
priv->flow_ctrl = FLOW_AUTO;/* RX/TX pause on */
@@ -3319,7 +3319,8 @@ int stmmac_dvr_probe(struct device *device,
 */
if ((priv->synopsys_id >= DWMAC_CORE_3_50) && (!priv->plat->riwt_off)) {
priv->use_riwt = 1;
-   netdev_info(priv->dev, "Enable RX Mitigation via HW Watchdog 
Timer\n");
+   dev_info(priv->device,
+"Enable RX Mitigation via HW Watchdog Timer\n");
}
 
netif_napi_add(ndev, >napi, stmmac_poll, 64);
@@ -3345,17 +3346,17 @@ int stmmac_dvr_probe(struct device *device,
/* MDIO bus Registration */
ret = stmmac_mdio_register(ndev);
if (ret < 0) {
-   netdev_err(priv->dev,
-  "%s: MDIO bus (id: %d) registration failed",
-  __func__, priv->plat->bus_id);
+   dev_err(priv->device,
+   "%s: MDIO bus (id: %d) registration failed",
+   __func__, priv->plat->bus_id);
goto error_mdio_register;
}
}
 
ret = register_netdev(ndev);
if (ret) {
-   netdev_err(priv->dev, "%s: ERROR %i registering the device\n",
-  __func__, ret);
+   dev_err(priv->device, "%s: ERROR %i registering the device\n",
+   __func__, ret);
goto error_netdev_register;
}
 
-- 
2.11.0



net: stmmac: don't use netdev_[dbg, info, ..] before net_device is registered

2017-01-15 Thread Heiner Kallweit
Don't use netdev_info and friends before the net_device is registered.
This avoids ugly messages like
"meson8b-dwmac c941.ethernet (unnamed net_device) (uninitialized):
Enable RX Mitigation via HW Watchdog Timer"

Signed-off-by: Heiner Kallweit 
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c 
b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index d481c5f7..38e1fb75 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3305,9 +3305,9 @@ int stmmac_dvr_probe(struct device *device,
(priv->plat->maxmtu >= ndev->min_mtu))
ndev->max_mtu = priv->plat->maxmtu;
else if (priv->plat->maxmtu < ndev->min_mtu)
-   netdev_warn(priv->dev,
-   "%s: warning: maxmtu having invalid value (%d)\n",
-   __func__, priv->plat->maxmtu);
+   dev_warn(priv->device,
+"%s: warning: maxmtu having invalid value (%d)\n",
+__func__, priv->plat->maxmtu);
 
if (flow_ctrl)
priv->flow_ctrl = FLOW_AUTO;/* RX/TX pause on */
@@ -3319,7 +3319,8 @@ int stmmac_dvr_probe(struct device *device,
 */
if ((priv->synopsys_id >= DWMAC_CORE_3_50) && (!priv->plat->riwt_off)) {
priv->use_riwt = 1;
-   netdev_info(priv->dev, "Enable RX Mitigation via HW Watchdog 
Timer\n");
+   dev_info(priv->device,
+"Enable RX Mitigation via HW Watchdog Timer\n");
}
 
netif_napi_add(ndev, >napi, stmmac_poll, 64);
@@ -3345,17 +3346,17 @@ int stmmac_dvr_probe(struct device *device,
/* MDIO bus Registration */
ret = stmmac_mdio_register(ndev);
if (ret < 0) {
-   netdev_err(priv->dev,
-  "%s: MDIO bus (id: %d) registration failed",
-  __func__, priv->plat->bus_id);
+   dev_err(priv->device,
+   "%s: MDIO bus (id: %d) registration failed",
+   __func__, priv->plat->bus_id);
goto error_mdio_register;
}
}
 
ret = register_netdev(ndev);
if (ret) {
-   netdev_err(priv->dev, "%s: ERROR %i registering the device\n",
-  __func__, ret);
+   dev_err(priv->device, "%s: ERROR %i registering the device\n",
+   __func__, ret);
goto error_netdev_register;
}
 
-- 
2.11.0