From: Jacob Keller <jacob.e.keller@intel.com>
To: David Thompson <davthompson@nvidia.com>,
<bryan.whitehead@microchip.com>, <UNGLinuxDriver@microchip.com>,
<andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v2 2/2] net: lan743x: avoid netdev-based logging before netdev registration
Date: Wed, 27 May 2026 13:32:25 -0700 [thread overview]
Message-ID: <a0bc4a6b-612a-426f-aced-205c6db6602c@intel.com> (raw)
In-Reply-To: <8909217245395f6418cdc2699147511c443085e4.1779903597.git.davthompson@nvidia.com>
On 5/27/2026 11:18 AM, David Thompson wrote:
> This patch updates the lan743x driver to prevent the use of netdev-based
> logging APIs (such as netdev_dbg) before the network device has been
> successfully registered. Using netdev-based logging prior to registration
> results in log messages referencing "(unnamed net_device) (uninitialized)",
> which can be confusing and less informative.
>
> The driver must use netif_msg_ APIs and device-based logging (e.g. dev_dbg)
> until netdev registration is complete. This ensures log entries are
> associated with the correct device context and improves log clarity. After
> registration, netdev-based logging APIs can be used safely.
>
> Signed-off-by: David Thompson <davthompson@nvidia.com>
> ---
> v2:
> - Changed target repo from "net" to "net-next"
> - Removed "Fixes" tag
> ---
> drivers/net/ethernet/microchip/lan743x_main.c | 72 ++++++++++++-------
> 1 file changed, 45 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
> index 793633cced19..bca2f3d1ad41 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c
> @@ -119,9 +119,10 @@ static int lan743x_pci_init(struct lan743x_adapter *adapter,
> if (ret)
> goto return_error;
>
> - netif_info(adapter, probe, adapter->netdev,
> - "PCI: Vendor ID = 0x%04X, Device ID = 0x%04X\n",
> - pdev->vendor, pdev->device);
> + if (netif_msg_probe(adapter))
> + pci_info(pdev,
> + "PCI: Vendor ID = 0x%04X, Device ID = 0x%04X\n",
> + pdev->vendor, pdev->device);
Do you really need to check netif_msg here? I guess it keeps the log
from being cluttered based on the message levels enabled. I would
probably just do dev_dbg() for all of these and let users use dynamic
debugging to enable/disable precisely which messages they want instead
of the message_enable bits.
Also, sometimes you use pci_info and other times you use dev_info. Why
not be consistent?
next prev parent reply other threads:[~2026-05-27 20:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 18:18 [PATCH net-next v2 0/2] net: lan743x: cleanup netdev-based logging David Thompson
2026-05-27 18:18 ` [PATCH net-next v2 1/2] net: lan743x: add "message level" module parameter David Thompson
2026-05-27 20:35 ` Jacob Keller
2026-05-28 14:32 ` David Thompson
2026-05-27 18:18 ` [PATCH net-next v2 2/2] net: lan743x: avoid netdev-based logging before netdev registration David Thompson
2026-05-27 20:32 ` Jacob Keller [this message]
2026-05-28 15:48 ` David Thompson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a0bc4a6b-612a-426f-aced-205c6db6602c@intel.com \
--to=jacob.e.keller@intel.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=bryan.whitehead@microchip.com \
--cc=davem@davemloft.net \
--cc=davthompson@nvidia.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®