diff mbox series

[net-next] sfc: don't use netif_info et al before net_device is registered

Message ID b6773ec4-82ac-51f8-0531-f1d6b30dc9a6@gmail.com (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series [net-next] sfc: don't use netif_info et al before net_device is registered | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 37 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Heiner Kallweit May 13, 2021, 9:29 p.m. UTC
Using netif_info() before the net_device is registered results in ugly
messages like the following:
sfc 0000:01:00.1 (unnamed net_device) (uninitialized): Solarflare NIC detected
Therefore use pci_info() et al until net_device is registered.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/sfc/efx.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

Comments

Martin Habets May 18, 2021, 1:58 p.m. UTC | #1
On Thu, May 13, 2021 at 11:29:12PM +0200, Heiner Kallweit wrote:
> Using netif_info() before the net_device is registered results in ugly
> messages like the following:
> sfc 0000:01:00.1 (unnamed net_device) (uninitialized): Solarflare NIC detected
> Therefore use pci_info() et al until net_device is registered.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Hard to believe I've seen those messages for years and not noticed.
Thanks!

Acked-by: Martin Habets <habetsm.xilinx@gmail.com>

> ---
>  drivers/net/ethernet/sfc/efx.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
> index c746ca723..4fd9903ff 100644
> --- a/drivers/net/ethernet/sfc/efx.c
> +++ b/drivers/net/ethernet/sfc/efx.c
> @@ -722,8 +722,7 @@ static int efx_register_netdev(struct efx_nic *efx)
>  	efx->state = STATE_READY;
>  	smp_mb(); /* ensure we change state before checking reset_pending */
>  	if (efx->reset_pending) {
> -		netif_err(efx, probe, efx->net_dev,
> -			  "aborting probe due to scheduled reset\n");
> +		pci_err(efx->pci_dev, "aborting probe due to scheduled reset\n");
>  		rc = -EIO;
>  		goto fail_locked;
>  	}
> @@ -990,8 +989,7 @@ static int efx_pci_probe_main(struct efx_nic *efx)
>  	rc = efx->type->init(efx);
>  	up_write(&efx->filter_sem);
>  	if (rc) {
> -		netif_err(efx, probe, efx->net_dev,
> -			  "failed to initialise NIC\n");
> +		pci_err(efx->pci_dev, "failed to initialise NIC\n");
>  		goto fail3;
>  	}
>  
> @@ -1038,8 +1036,8 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
>  	if (efx->type->sriov_init) {
>  		rc = efx->type->sriov_init(efx);
>  		if (rc)
> -			netif_err(efx, probe, efx->net_dev,
> -				  "SR-IOV can't be enabled rc %d\n", rc);
> +			pci_err(efx->pci_dev, "SR-IOV can't be enabled rc %d\n",
> +				rc);
>  	}
>  
>  	/* Determine netdevice features */
> @@ -1106,8 +1104,7 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
>  	if (rc)
>  		goto fail1;
>  
> -	netif_info(efx, probe, efx->net_dev,
> -		   "Solarflare NIC detected\n");
> +	pci_info(pci_dev, "Solarflare NIC detected\n");
>  
>  	if (!efx->type->is_vf)
>  		efx_probe_vpd_strings(efx);
> -- 
> 2.31.1
diff mbox series

Patch

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index c746ca723..4fd9903ff 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -722,8 +722,7 @@  static int efx_register_netdev(struct efx_nic *efx)
 	efx->state = STATE_READY;
 	smp_mb(); /* ensure we change state before checking reset_pending */
 	if (efx->reset_pending) {
-		netif_err(efx, probe, efx->net_dev,
-			  "aborting probe due to scheduled reset\n");
+		pci_err(efx->pci_dev, "aborting probe due to scheduled reset\n");
 		rc = -EIO;
 		goto fail_locked;
 	}
@@ -990,8 +989,7 @@  static int efx_pci_probe_main(struct efx_nic *efx)
 	rc = efx->type->init(efx);
 	up_write(&efx->filter_sem);
 	if (rc) {
-		netif_err(efx, probe, efx->net_dev,
-			  "failed to initialise NIC\n");
+		pci_err(efx->pci_dev, "failed to initialise NIC\n");
 		goto fail3;
 	}
 
@@ -1038,8 +1036,8 @@  static int efx_pci_probe_post_io(struct efx_nic *efx)
 	if (efx->type->sriov_init) {
 		rc = efx->type->sriov_init(efx);
 		if (rc)
-			netif_err(efx, probe, efx->net_dev,
-				  "SR-IOV can't be enabled rc %d\n", rc);
+			pci_err(efx->pci_dev, "SR-IOV can't be enabled rc %d\n",
+				rc);
 	}
 
 	/* Determine netdevice features */
@@ -1106,8 +1104,7 @@  static int efx_pci_probe(struct pci_dev *pci_dev,
 	if (rc)
 		goto fail1;
 
-	netif_info(efx, probe, efx->net_dev,
-		   "Solarflare NIC detected\n");
+	pci_info(pci_dev, "Solarflare NIC detected\n");
 
 	if (!efx->type->is_vf)
 		efx_probe_vpd_strings(efx);