netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dimitri Fedrau <dima.fedrau@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "Heiner Kallweit" <hkallweit1@gmail.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"Gregor Herburger" <gregor.herburger@ew.tq-group.com>,
	"Stefan Eichenberger" <eichest@gmail.com>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] net: phy: marvell-88q2xxx: Prevent reading temperature with asserted reset
Date: Thu, 20 Feb 2025 06:40:07 +0100	[thread overview]
Message-ID: <20250220054007.GB3914@debian> (raw)
In-Reply-To: <48c4cd14-be56-438e-9561-c85b0245178c@lunn.ch>

Hi Andrew,

Am Wed, Feb 19, 2025 at 02:21:23PM +0100 schrieb Andrew Lunn:
> On Tue, Feb 18, 2025 at 07:33:10PM +0100, Dimitri Fedrau wrote:
> > If the PHYs reset is asserted it returns 0xffff for any read operation.
> > Prevent reading the temperature in this case and return with an I/O error.
> > Write operations are ignored by the device.
> 
> I think the commit message could be improved. Explain why the PHY
> reset would be asserted. You are saying it is because the interface is
> admin down. That is a concept the user is more likely to understand.
> 
Will improve the commit message.

> > Fixes: a197004cf3c2 ("net: phy: marvell-88q2xxx: Fix temperature measurement with reset-gpios")
> 
> Is this really a fix? My personal reason for this change was
> architecture, it seemed odd to probe the hwmon device in one spot and
> then enable it later. But is it really broken? Stable rules say:
> 
>   It must either fix a real bug that bothers people or just add a device ID
> 
That's fine for me. I don't think it is something that is really
bothering people. Will remove the fixes tag and switch to net-next.
Thanks for pointing out.

> > Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
> > ---
> >  drivers/net/phy/marvell-88q2xxx.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/net/phy/marvell-88q2xxx.c b/drivers/net/phy/marvell-88q2xxx.c
> > index 30d71bfc365597d77c34c48f05390db9d63c4af4..c1ae27057ee34feacb31c2e3c40b2b1769596408 100644
> > --- a/drivers/net/phy/marvell-88q2xxx.c
> > +++ b/drivers/net/phy/marvell-88q2xxx.c
> > @@ -647,6 +647,12 @@ static int mv88q2xxx_hwmon_read(struct device *dev,
> >  	struct phy_device *phydev = dev_get_drvdata(dev);
> >  	int ret;
> >  
> > +	/* If the PHYs reset is asserted it returns 0xffff for any read
> > +	 * operation. Return with an I/O error in this case.
> > +	 */
> > +	if (phydev->mdio.reset_state == 1)
> > +		return -EIO;
> 
> Maybe ENETDOWN is better?
>
That is way better than EIO, so users could actually know why the sensor
doesn't return the temperature. Thanks again.

Best regards,
Dimitri Fedrau

      reply	other threads:[~2025-02-20  5:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-18 18:33 [PATCH 0/2] net: phy: marvell-88q2xxx: Enable temperature measurement in probe again Dimitri Fedrau
2025-02-18 18:33 ` [PATCH 1/2] " Dimitri Fedrau
2025-02-19  6:16   ` Stefan Eichenberger
2025-02-19 10:46     ` Dimitri Fedrau
2025-02-19 17:25       ` Stefan Eichenberger
2025-02-20  5:32         ` Dimitri Fedrau
2025-02-18 18:33 ` [PATCH 2/2] net: phy: marvell-88q2xxx: Prevent reading temperature with asserted reset Dimitri Fedrau
2025-02-19  6:29   ` Stefan Eichenberger
2025-02-19 10:54     ` Dimitri Fedrau
2025-02-19 17:28       ` Stefan Eichenberger
2025-02-19 13:21   ` Andrew Lunn
2025-02-20  5:40     ` Dimitri Fedrau [this message]

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=20250220054007.GB3914@debian \
    --to=dima.fedrau@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eichest@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=gregor.herburger@ew.tq-group.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --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;
as well as URLs for NNTP newsgroup(s).