All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
To: Jim Liu <jim.t90615@gmail.com>
Cc: JJLIU0@nuvoton.com, florian.fainelli@broadcom.com,
	andrew@lunn.ch, hkallweit1@gmail.com, kuba@kernel.org,
	linux@armlinux.org.uk, edumazet@google.com, pabeni@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] net: phy: broadcom: Correct BCM5221 PHY model detection failure
Date: Mon, 17 Mar 2025 09:47:37 +0100	[thread overview]
Message-ID: <Z9fhqbfoQGSm1Njx@mev-dev.igk.intel.com> (raw)
In-Reply-To: <20250317035005.3064083-1-JJLIU0@nuvoton.com>

On Mon, Mar 17, 2025 at 11:50:05AM +0800, Jim Liu wrote:
> Use "BRCM_PHY_MODEL" can be applied to the entire 5221 family of PHYs.
> 
> Fixes: 3abbd0699b67 (net: phy: broadcom: add support for BCM5221 phy)
> Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
> ---
>  drivers/net/phy/broadcom.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
> index 22edb7e4c1a1..3529289e9d13 100644
> --- a/drivers/net/phy/broadcom.c
> +++ b/drivers/net/phy/broadcom.c
> @@ -859,7 +859,7 @@ static int brcm_fet_config_init(struct phy_device *phydev)
>  		return reg;
>  
>  	/* Unmask events we are interested in and mask interrupts globally. */
> -	if (phydev->phy_id == PHY_ID_BCM5221)
> +	if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM5221)
>  		reg = MII_BRCM_FET_IR_ENABLE |
>  		      MII_BRCM_FET_IR_MASK;
>  	else
> @@ -888,7 +888,7 @@ static int brcm_fet_config_init(struct phy_device *phydev)
>  		return err;
>  	}
>  
> -	if (phydev->phy_id != PHY_ID_BCM5221) {
> +	if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM5221) {
>  		/* Set the LED mode */
>  		reg = __phy_read(phydev, MII_BRCM_FET_SHDW_AUXMODE4);
>  		if (reg < 0) {
> @@ -1009,7 +1009,7 @@ static int brcm_fet_suspend(struct phy_device *phydev)
>  		return err;
>  	}
>  
> -	if (phydev->phy_id == PHY_ID_BCM5221)
> +	if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM5221)
>  		/* Force Low Power Mode with clock enabled */
>  		reg = BCM5221_SHDW_AM4_EN_CLK_LPM | BCM5221_SHDW_AM4_FORCE_LPM;
>  	else
> -- 
> 2.34.1

It will be nice to have wider explanation what it is fixing in commit
message. Is phydev->phy_id different than phydev->driver->phy_id? Looks
like masking isn't crucial as phydev->driver->phy_id is initialized by
PHY_ID_BCM5221 which is already masked.

Anyway, looks fine, thanks.
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

  reply	other threads:[~2025-03-17  8:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17  3:50 [PATCH v1] net: phy: broadcom: Correct BCM5221 PHY model detection failure Jim Liu
2025-03-17  8:47 ` Michal Swiatkowski [this message]
2025-03-17 10:28   ` Russell King (Oracle)

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=Z9fhqbfoQGSm1Njx@mev-dev.igk.intel.com \
    --to=michal.swiatkowski@linux.intel.com \
    --cc=JJLIU0@nuvoton.com \
    --cc=andrew@lunn.ch \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=hkallweit1@gmail.com \
    --cc=jim.t90615@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.