mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: Dimitri Fedrau <dima.fedrau@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	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>,
	Gregor Herburger <gregor.herburger@ew.tq-group.com>,
	Stefan Eichenberger <eichest@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 3/3] net: phy: marvell-88q2xxx: enable temperature sensor in mv88q2xxx_config_init
Date: Fri, 14 Feb 2025 18:59:38 +0100	[thread overview]
Message-ID: <20250214175938.GE2392035@ragnatech.se> (raw)
In-Reply-To: <20250214-marvell-88q2xxx-cleanup-v1-3-71d67c20f308@gmail.com>

Hi Dimitir,

Thanks for your work.

On 2025-02-14 17:32:05 +0100, Dimitri Fedrau wrote:
> Temperature sensor gets enabled for 88Q222X devices in
> mv88q222x_config_init. Move enabling to mv88q2xxx_config_init because
> all 88Q2XXX devices support the temperature sensor.

Is this true for mv88q2110 devices too? The current implementation only 
enables it for mv88q222x devices. The private structure is not even 
initialized for mv88q2110, and currently crashes. I have fixed that [1], 
but I'm not sure if that should be extended to also enable temperature 
sensor for mv88q2110?

> 
> Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>

In either case with [1] for an unrelated fix this is tested on 
mv88q2110.

Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

1.  https://lore.kernel.org/all/20250214174650.2056949-1-niklas.soderlund+renesas@ragnatech.se/

> ---
>  drivers/net/phy/marvell-88q2xxx.c | 21 +++++++++------------
>  1 file changed, 9 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/phy/marvell-88q2xxx.c b/drivers/net/phy/marvell-88q2xxx.c
> index 7b0913968bb404df1d271b040e698a4c8c391705..1859db10b3914f54486c7e6132b10b0353fa49e6 100644
> --- a/drivers/net/phy/marvell-88q2xxx.c
> +++ b/drivers/net/phy/marvell-88q2xxx.c
> @@ -513,6 +513,15 @@ static int mv88q2xxx_config_init(struct phy_device *phydev)
>  			return ret;
>  	}
>  
> +	/* Enable temperature sense */
> +	if (priv->enable_temp) {
> +		ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
> +				     MDIO_MMD_PCS_MV_TEMP_SENSOR2,
> +				     MDIO_MMD_PCS_MV_TEMP_SENSOR2_DIS_MASK, 0);
> +		if (ret < 0)
> +			return ret;
> +	}
> +
>  	return 0;
>  }
>  
> @@ -903,18 +912,6 @@ static int mv88q222x_revb1_revb2_config_init(struct phy_device *phydev)
>  
>  static int mv88q222x_config_init(struct phy_device *phydev)
>  {
> -	struct mv88q2xxx_priv *priv = phydev->priv;
> -	int ret;
> -
> -	/* Enable temperature sense */
> -	if (priv->enable_temp) {
> -		ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
> -				     MDIO_MMD_PCS_MV_TEMP_SENSOR2,
> -				     MDIO_MMD_PCS_MV_TEMP_SENSOR2_DIS_MASK, 0);
> -		if (ret < 0)
> -			return ret;
> -	}
> -
>  	if (phydev->c45_ids.device_ids[MDIO_MMD_PMAPMD] == PHY_ID_88Q2220_REVB0)
>  		return mv88q222x_revb0_config_init(phydev);
>  	else
> 
> -- 
> 2.39.5
> 

-- 
Kind Regards,
Niklas Söderlund

  reply	other threads:[~2025-02-14 17:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14 16:32 [PATCH net-next 0/3] net: phy: marvell-88q2xxx: cleanup Dimitri Fedrau
2025-02-14 16:32 ` [PATCH net-next 1/3] net: phy: marvell-88q2xxx: align defines Dimitri Fedrau
2025-02-14 17:52   ` Niklas Söderlund
2025-02-18 11:54   ` Marek Behún
2025-02-18 14:12     ` Andrew Lunn
2025-02-18 14:31       ` Marek Behún
2025-02-18 16:00     ` Russell King (Oracle)
2025-02-18 18:13       ` Dimitri Fedrau
2025-02-14 16:32 ` [PATCH net-next 2/3] net: phy: marvell-88q2xxx: order includes alphabetically Dimitri Fedrau
2025-02-14 17:53   ` Niklas Söderlund
2025-02-14 16:32 ` [PATCH net-next 3/3] net: phy: marvell-88q2xxx: enable temperature sensor in mv88q2xxx_config_init Dimitri Fedrau
2025-02-14 17:59   ` Niklas Söderlund [this message]
2025-02-14 19:45     ` Dimitri Fedrau
2025-02-20 15:37       ` Niklas Söderlund
2025-02-14 18:06   ` Andrew Lunn
2025-02-15  7:13     ` Dimitri Fedrau
2025-02-18 12:50 ` [PATCH net-next 0/3] net: phy: marvell-88q2xxx: cleanup patchwork-bot+netdevbpf

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=20250214175938.GE2392035@ragnatech.se \
    --to=niklas.soderlund+renesas@ragnatech.se \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dima.fedrau@gmail.com \
    --cc=edumazet@google.com \
    --cc=eichest@gmail.com \
    --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=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®