* [v3,net] net: phy: broadcom: Correct BCM5221 PHY model detection failure
@ 2025-03-25 9:10 Jim Liu
2025-03-26 15:52 ` Florian Fainelli
0 siblings, 1 reply; 2+ messages in thread
From: Jim Liu @ 2025-03-25 9:10 UTC (permalink / raw)
To: JJLIU0, jim.t90615, florian.fainelli, andrew, hkallweit1, kuba,
linux, edumazet, pabeni
Cc: netdev, giulio.benetti+tekvox, bcm-kernel-feedback-list,
linux-kernel, Michal Swiatkowski
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 <jim.t90615@gmail.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
---
v3:
modify BRCM_PHY_MODEL define
---
drivers/net/phy/broadcom.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 22edb7e4c1a1..4327d946d524 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -23,8 +23,7 @@
#include <linux/irq.h>
#include <linux/gpio/consumer.h>
-#define BRCM_PHY_MODEL(phydev) \
- ((phydev)->drv->phy_id & (phydev)->drv->phy_id_mask)
+#define BRCM_PHY_MODEL(phydev) ((phydev)->drv->phy_id)
#define BRCM_PHY_REV(phydev) \
((phydev)->drv->phy_id & ~((phydev)->drv->phy_id_mask))
@@ -859,7 +858,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 +887,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 +1008,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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [v3,net] net: phy: broadcom: Correct BCM5221 PHY model detection failure
2025-03-25 9:10 [v3,net] net: phy: broadcom: Correct BCM5221 PHY model detection failure Jim Liu
@ 2025-03-26 15:52 ` Florian Fainelli
0 siblings, 0 replies; 2+ messages in thread
From: Florian Fainelli @ 2025-03-26 15:52 UTC (permalink / raw)
To: Jim Liu, JJLIU0, andrew, hkallweit1, kuba, linux, edumazet, pabeni
Cc: netdev, giulio.benetti+tekvox, bcm-kernel-feedback-list,
linux-kernel, Michal Swiatkowski
On 3/25/25 02:10, 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 <jim.t90615@gmail.com>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> ---
> v3:
> modify BRCM_PHY_MODEL define
Humm, I am not super confident in modifying BRCM_PHY_MODEL() since that
impacts the entire driver, how about just using Russell's suggestion:
if (phydev->drv->phy_id == PHY_ID_BCM5221)
all over the place? That also paves the way for getting rid of
BRCM_PHY_MODEL() once this patch is in net-next.
Thanks!
--
Florian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-26 15:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-25 9:10 [v3,net] net: phy: broadcom: Correct BCM5221 PHY model detection failure Jim Liu
2025-03-26 15:52 ` Florian Fainelli
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®