* [PATCH] net:phy:dp83640: Move all HW initialization to dp83640_config_init
@ 2014-02-13 14:26 Stefan Sørensen
2014-02-13 23:52 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Sørensen @ 2014-02-13 14:26 UTC (permalink / raw)
To: richardcochran, netdev; +Cc: Stefan Sørensen
phy_init_hw not does a full PHY reset after the driver probe has
finished, so any hw initialization done in the probe will be lost.
Part of the timestamping functionality of the dp83640 is set up in the
probe and with that lost, enabling timestamping will cause a PHY
lockup, requiring a hard reset / power cycle to recover.
This patch moves all the HW initialization in dp83640_probe to
dp83640_config_init.
Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
---
drivers/net/phy/dp83640.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 0de863c..5ff221d 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -1017,11 +1017,6 @@ static int dp83640_probe(struct phy_device *phydev)
} else
list_add_tail(&dp83640->list, &clock->phylist);
- if (clock->chosen && !list_empty(&clock->phylist))
- recalibrate(clock);
- else
- enable_broadcast(dp83640->phydev, clock->page, 1);
-
dp83640_clock_put(clock);
return 0;
@@ -1074,6 +1069,14 @@ static void dp83640_remove(struct phy_device *phydev)
static int dp83640_config_init(struct phy_device *phydev)
{
+ struct dp83640_private *dp83640 = phydev->priv;
+ struct dp83640_clock *clock = dp83640->clock;
+
+ if (clock->chosen && !list_empty(&clock->phylist))
+ recalibrate(clock);
+ else
+ enable_broadcast(phydev, clock->page, 1);
+
enable_status_frames(phydev, true);
ext_write(0, phydev, PAGE4, PTP_CTL, PTP_ENABLE);
return 0;
--
1.8.5.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] net:phy:dp83640: Move all HW initialization to dp83640_config_init
2014-02-13 14:26 [PATCH] net:phy:dp83640: Move all HW initialization to dp83640_config_init Stefan Sørensen
@ 2014-02-13 23:52 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-02-13 23:52 UTC (permalink / raw)
To: stefan.sorensen; +Cc: richardcochran, netdev
From: Stefan Sørensen <stefan.sorensen@spectralink.com>
Date: Thu, 13 Feb 2014 15:26:57 +0100
> phy_init_hw not does a full PHY reset after the driver probe has
> finished, so any hw initialization done in the probe will be lost.
> Part of the timestamping functionality of the dp83640 is set up in the
> probe and with that lost, enabling timestamping will cause a PHY
> lockup, requiring a hard reset / power cycle to recover.
>
> This patch moves all the HW initialization in dp83640_probe to
> dp83640_config_init.
>
> Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-13 23:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-13 14:26 [PATCH] net:phy:dp83640: Move all HW initialization to dp83640_config_init Stefan Sørensen
2014-02-13 23:52 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox