netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v1] mlxbf_gige: emit messages during open and probe failures
@ 2025-06-13 17:42 David Thompson
  2025-06-16 13:57 ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: David Thompson @ 2025-06-13 17:42 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, asmaa,
	u.kleine-koenig, horms
  Cc: netdev, linux-kernel, David Thompson

The open() and probe() functions of the mlxbf_gige driver
check for errors during initialization, but do not provide
details regarding the errors. The mlxbf_gige driver should
provide error details in the kernel log, noting what step
of initialization failed.

Signed-off-by: David Thompson <davthompson@nvidia.com>
---
 .../mellanox/mlxbf_gige/mlxbf_gige_main.c     | 20 ++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
index fb2e5b844c15..ba0ed4170b82 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -142,8 +142,10 @@ static int mlxbf_gige_open(struct net_device *netdev)
 
 	mlxbf_gige_cache_stats(priv);
 	err = mlxbf_gige_clean_port(priv);
-	if (err)
+	if (err) {
+		dev_err(priv->dev, "open: clean_port failed, err=0x%x\n", err);
 		return err;
+	}
 
 	/* Clear driver's valid_polarity to match hardware,
 	 * since the above call to clean_port() resets the
@@ -154,19 +156,25 @@ static int mlxbf_gige_open(struct net_device *netdev)
 	phy_start(phydev);
 
 	err = mlxbf_gige_tx_init(priv);
-	if (err)
+	if (err) {
+		dev_err(priv->dev, "open: tx_init failed, err=0x%x\n", err);
 		goto phy_deinit;
+	}
 	err = mlxbf_gige_rx_init(priv);
-	if (err)
+	if (err) {
+		dev_err(priv->dev, "open: rx_init failed, err=0x%x\n", err);
 		goto tx_deinit;
+	}
 
 	netif_napi_add(netdev, &priv->napi, mlxbf_gige_poll);
 	napi_enable(&priv->napi);
 	netif_start_queue(netdev);
 
 	err = mlxbf_gige_request_irqs(priv);
-	if (err)
+	if (err) {
+		dev_err(priv->dev, "open: request_irqs failed, err=0x%x\n", err);
 		goto napi_deinit;
+	}
 
 	mlxbf_gige_enable_mac_rx_filter(priv, MLXBF_GIGE_BCAST_MAC_FILTER_IDX);
 	mlxbf_gige_enable_mac_rx_filter(priv, MLXBF_GIGE_LOCAL_MAC_FILTER_IDX);
@@ -418,8 +426,10 @@ static int mlxbf_gige_probe(struct platform_device *pdev)
 
 	/* Attach MDIO device */
 	err = mlxbf_gige_mdio_probe(pdev, priv);
-	if (err)
+	if (err) {
+		dev_err(priv->dev, "probe: mdio_probe failed, err=0x%x\n", err);
 		return err;
+	}
 
 	priv->base = base;
 	priv->llu_base = llu_base;
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v1] mlxbf_gige: emit messages during open and probe failures
  2025-06-13 17:42 [PATCH net-next v1] mlxbf_gige: emit messages during open and probe failures David Thompson
@ 2025-06-16 13:57 ` Simon Horman
  2025-06-16 14:06   ` Alexander Lobakin
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2025-06-16 13:57 UTC (permalink / raw)
  To: David Thompson
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, asmaa,
	u.kleine-koenig, netdev, linux-kernel

On Fri, Jun 13, 2025 at 05:42:28PM +0000, David Thompson wrote:
> The open() and probe() functions of the mlxbf_gige driver
> check for errors during initialization, but do not provide
> details regarding the errors. The mlxbf_gige driver should
> provide error details in the kernel log, noting what step
> of initialization failed.
> 
> Signed-off-by: David Thompson <davthompson@nvidia.com>

Hi David,

I do have some reservations about the value of printing
out raw err values. But I also see that the logging added
by this patch is consistent with existing code in this driver.
So in that context I agree this is appropriate.

Reviewed-by: Simon Horman <horms@kernel.org>

...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v1] mlxbf_gige: emit messages during open and probe failures
  2025-06-16 13:57 ` Simon Horman
@ 2025-06-16 14:06   ` Alexander Lobakin
  2025-06-16 19:17     ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Lobakin @ 2025-06-16 14:06 UTC (permalink / raw)
  To: Simon Horman, David Thompson
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, asmaa,
	u.kleine-koenig, netdev, linux-kernel

From: Simon Horman <horms@kernel.org>
Date: Mon, 16 Jun 2025 14:57:10 +0100

> On Fri, Jun 13, 2025 at 05:42:28PM +0000, David Thompson wrote:
>> The open() and probe() functions of the mlxbf_gige driver
>> check for errors during initialization, but do not provide
>> details regarding the errors. The mlxbf_gige driver should
>> provide error details in the kernel log, noting what step
>> of initialization failed.
>>
>> Signed-off-by: David Thompson <davthompson@nvidia.com>
> 
> Hi David,
> 
> I do have some reservations about the value of printing
> out raw err values. But I also see that the logging added
> by this patch is consistent with existing code in this driver.
> So in that context I agree this is appropriate.
> 
> Reviewed-by: Simon Horman <horms@kernel.org>

I still think it's better to encourage people to use %pe for printing
error codes. The already existing messages could be improved later,
but then at least no new places would sneak in.

Thanks,
Olek

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v1] mlxbf_gige: emit messages during open and probe failures
  2025-06-16 14:06   ` Alexander Lobakin
@ 2025-06-16 19:17     ` Simon Horman
  2025-07-01  0:44       ` David Thompson
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2025-06-16 19:17 UTC (permalink / raw)
  To: Alexander Lobakin
  Cc: David Thompson, andrew+netdev, davem, edumazet, kuba, pabeni,
	asmaa, u.kleine-koenig, netdev, linux-kernel

On Mon, Jun 16, 2025 at 04:06:49PM +0200, Alexander Lobakin wrote:
> From: Simon Horman <horms@kernel.org>
> Date: Mon, 16 Jun 2025 14:57:10 +0100
> 
> > On Fri, Jun 13, 2025 at 05:42:28PM +0000, David Thompson wrote:
> >> The open() and probe() functions of the mlxbf_gige driver
> >> check for errors during initialization, but do not provide
> >> details regarding the errors. The mlxbf_gige driver should
> >> provide error details in the kernel log, noting what step
> >> of initialization failed.
> >>
> >> Signed-off-by: David Thompson <davthompson@nvidia.com>
> > 
> > Hi David,
> > 
> > I do have some reservations about the value of printing
> > out raw err values. But I also see that the logging added
> > by this patch is consistent with existing code in this driver.
> > So in that context I agree this is appropriate.
> > 
> > Reviewed-by: Simon Horman <horms@kernel.org>
> 
> I still think it's better to encourage people to use %pe for printing
> error codes. The already existing messages could be improved later,
> but then at least no new places would sneak in.

Thanks, I agree that is reasonable.
And as a bonus the patch-set could update existing messages.

David, could you consider making this so?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH net-next v1] mlxbf_gige: emit messages during open and probe failures
  2025-06-16 19:17     ` Simon Horman
@ 2025-07-01  0:44       ` David Thompson
  2025-07-01 12:51         ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: David Thompson @ 2025-07-01  0:44 UTC (permalink / raw)
  To: Simon Horman, Alexander Lobakin
  Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, Asmaa Mnebhi,
	u.kleine-koenig@baylibre.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

> -----Original Message-----
> From: Simon Horman <horms@kernel.org>
> Sent: Monday, June 16, 2025 3:18 PM
> To: Alexander Lobakin <aleksander.lobakin@intel.com>
> Cc: David Thompson <davthompson@nvidia.com>; andrew+netdev@lunn.ch;
> davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com; Asmaa Mnebhi <asmaa@nvidia.com>; u.kleine-
> koenig@baylibre.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH net-next v1] mlxbf_gige: emit messages during open and
> probe failures
> 
> On Mon, Jun 16, 2025 at 04:06:49PM +0200, Alexander Lobakin wrote:
> > From: Simon Horman <horms@kernel.org>
> > Date: Mon, 16 Jun 2025 14:57:10 +0100
> >
> > > On Fri, Jun 13, 2025 at 05:42:28PM +0000, David Thompson wrote:
> > >> The open() and probe() functions of the mlxbf_gige driver check for
> > >> errors during initialization, but do not provide details regarding
> > >> the errors. The mlxbf_gige driver should provide error details in
> > >> the kernel log, noting what step of initialization failed.
> > >>
> > >> Signed-off-by: David Thompson <davthompson@nvidia.com>
> > >
> > > Hi David,
> > >
> > > I do have some reservations about the value of printing out raw err
> > > values. But I also see that the logging added by this patch is
> > > consistent with existing code in this driver.
> > > So in that context I agree this is appropriate.
> > >
> > > Reviewed-by: Simon Horman <horms@kernel.org>
> >
> > I still think it's better to encourage people to use %pe for printing
> > error codes. The already existing messages could be improved later,
> > but then at least no new places would sneak in.
> 
> Thanks, I agree that is reasonable.
> And as a bonus the patch-set could update existing messages.
> 
> David, could you consider making this so?

Sorry for late response.

Yes, will look into updating this patch to use %pe

Thanks for the feedback.

Dave

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v1] mlxbf_gige: emit messages during open and probe failures
  2025-07-01  0:44       ` David Thompson
@ 2025-07-01 12:51         ` Simon Horman
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2025-07-01 12:51 UTC (permalink / raw)
  To: David Thompson
  Cc: Alexander Lobakin, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	Asmaa Mnebhi, u.kleine-koenig@baylibre.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org

On Tue, Jul 01, 2025 at 12:44:14AM +0000, David Thompson wrote:
> > -----Original Message-----
> > From: Simon Horman <horms@kernel.org>
> > Sent: Monday, June 16, 2025 3:18 PM
> > To: Alexander Lobakin <aleksander.lobakin@intel.com>
> > Cc: David Thompson <davthompson@nvidia.com>; andrew+netdev@lunn.ch;
> > davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> > pabeni@redhat.com; Asmaa Mnebhi <asmaa@nvidia.com>; u.kleine-
> > koenig@baylibre.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH net-next v1] mlxbf_gige: emit messages during open and
> > probe failures
> > 
> > On Mon, Jun 16, 2025 at 04:06:49PM +0200, Alexander Lobakin wrote:
> > > From: Simon Horman <horms@kernel.org>
> > > Date: Mon, 16 Jun 2025 14:57:10 +0100
> > >
> > > > On Fri, Jun 13, 2025 at 05:42:28PM +0000, David Thompson wrote:
> > > >> The open() and probe() functions of the mlxbf_gige driver check for
> > > >> errors during initialization, but do not provide details regarding
> > > >> the errors. The mlxbf_gige driver should provide error details in
> > > >> the kernel log, noting what step of initialization failed.
> > > >>
> > > >> Signed-off-by: David Thompson <davthompson@nvidia.com>
> > > >
> > > > Hi David,
> > > >
> > > > I do have some reservations about the value of printing out raw err
> > > > values. But I also see that the logging added by this patch is
> > > > consistent with existing code in this driver.
> > > > So in that context I agree this is appropriate.
> > > >
> > > > Reviewed-by: Simon Horman <horms@kernel.org>
> > >
> > > I still think it's better to encourage people to use %pe for printing
> > > error codes. The already existing messages could be improved later,
> > > but then at least no new places would sneak in.
> > 
> > Thanks, I agree that is reasonable.
> > And as a bonus the patch-set could update existing messages.
> > 
> > David, could you consider making this so?
> 
> Sorry for late response.
> 
> Yes, will look into updating this patch to use %pe
> 
> Thanks for the feedback.

Thanks, much appreciated.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-01 12:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-13 17:42 [PATCH net-next v1] mlxbf_gige: emit messages during open and probe failures David Thompson
2025-06-16 13:57 ` Simon Horman
2025-06-16 14:06   ` Alexander Lobakin
2025-06-16 19:17     ` Simon Horman
2025-07-01  0:44       ` David Thompson
2025-07-01 12:51         ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).