* [PATCH] net: phy: micrel: use generic config_init for KSZ8021/KSZ8031
@ 2014-12-23 11:59 Johan Hovold
2014-12-26 21:24 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Johan Hovold @ 2014-12-23 11:59 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev, linux-kernel, Bruno Thomsen, Johan Hovold
Use generic config_init callback also for KSZ8021 and KSZ8031.
This has been avoided this far due to commit b838b4aced99 ("phy/micrel:
KSZ8031RNL RMII clock reconfiguration bug"), which claims that the PHY
becomes unresponsive if the broadcast-disable flag is set before
configuring the clock mode.
Turns out that the problem seemingly worked-around by the above
mentioned commit was really due to a hardware-configuration issue, where
the PHY was in fact strapped to address 3 rather than 0.
Tested-by: Bruno Thomsen <bth@kamstrup.dk>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/net/phy/micrel.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index c530de1e63f5..3ad8ca76196d 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -88,6 +88,7 @@ struct kszphy_priv {
static const struct kszphy_type ksz8021_type = {
.led_mode_reg = MII_KSZPHY_CTRL_2,
+ .has_broadcast_disable = true,
.has_rmii_ref_clk_sel = true,
};
@@ -258,19 +259,6 @@ static int kszphy_config_init(struct phy_device *phydev)
return 0;
}
-static int ksz8021_config_init(struct phy_device *phydev)
-{
- int rc;
-
- rc = kszphy_config_init(phydev);
- if (rc)
- return rc;
-
- rc = kszphy_broadcast_disable(phydev);
-
- return rc < 0 ? rc : 0;
-}
-
static int ksz9021_load_values_from_of(struct phy_device *phydev,
struct device_node *of_node, u16 reg,
char *field1, char *field2,
@@ -584,7 +572,7 @@ static struct phy_driver ksphy_driver[] = {
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.driver_data = &ksz8021_type,
.probe = kszphy_probe,
- .config_init = ksz8021_config_init,
+ .config_init = kszphy_config_init,
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
@@ -601,7 +589,7 @@ static struct phy_driver ksphy_driver[] = {
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.driver_data = &ksz8021_type,
.probe = kszphy_probe,
- .config_init = ksz8021_config_init,
+ .config_init = kszphy_config_init,
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
--
2.0.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: phy: micrel: use generic config_init for KSZ8021/KSZ8031
2014-12-23 11:59 [PATCH] net: phy: micrel: use generic config_init for KSZ8021/KSZ8031 Johan Hovold
@ 2014-12-26 21:24 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-12-26 21:24 UTC (permalink / raw)
To: johan; +Cc: f.fainelli, netdev, linux-kernel, bth
From: Johan Hovold <johan@kernel.org>
Date: Tue, 23 Dec 2014 12:59:17 +0100
> Use generic config_init callback also for KSZ8021 and KSZ8031.
>
> This has been avoided this far due to commit b838b4aced99 ("phy/micrel:
> KSZ8031RNL RMII clock reconfiguration bug"), which claims that the PHY
> becomes unresponsive if the broadcast-disable flag is set before
> configuring the clock mode.
>
> Turns out that the problem seemingly worked-around by the above
> mentioned commit was really due to a hardware-configuration issue, where
> the PHY was in fact strapped to address 3 rather than 0.
>
> Tested-by: Bruno Thomsen <bth@kamstrup.dk>
> Signed-off-by: Johan Hovold <johan@kernel.org>
Applied, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-26 21:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-23 11:59 [PATCH] net: phy: micrel: use generic config_init for KSZ8021/KSZ8031 Johan Hovold
2014-12-26 21:24 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox