[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210518135807.yswqnksmobc3yei3@gmail.com>
Date: Tue, 18 May 2021 14:58:07 +0100
From: Martin Habets <habetsm.xilinx@...il.com>
To: Heiner Kallweit <hkallweit1@...il.com>
Cc: Edward Cree <ecree.xilinx@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] sfc: don't use netif_info et al before
net_device is registered
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@...il.com>
Hard to believe I've seen those messages for years and not noticed.
Thanks!
Acked-by: Martin Habets <habetsm.xilinx@...il.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
Powered by blists - more mailing lists