* [PATCH net 0/3] net: phy: bcm7xxx internal PHY fixes
@ 2014-08-14 23:52 Florian Fainelli
2014-08-14 23:52 ` [PATCH net 1/3] net: phy: bcm7xxx: remove 28nm wildcard entry Florian Fainelli
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Florian Fainelli @ 2014-08-14 23:52 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
Hi David,
Here are 3 small fixes for the Broadcom BCM7xxx internal PHY targeting
suspend/resume issues.
Thanks!
Florian Fainelli (3):
net: phy: bcm7xxx: remove 28nm wildcard entry
net: phy: bcm7xxx: re-advertise all supported modes out of suspend
net: phy: bcm7xxx: remove suspend callback for 28nm PHYs
drivers/net/phy/bcm7xxx.c | 42 +++++++++++++++++++++---------------------
include/linux/brcmphy.h | 1 -
2 files changed, 21 insertions(+), 22 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net 1/3] net: phy: bcm7xxx: remove 28nm wildcard entry
2014-08-14 23:52 [PATCH net 0/3] net: phy: bcm7xxx internal PHY fixes Florian Fainelli
@ 2014-08-14 23:52 ` Florian Fainelli
2014-08-14 23:52 ` [PATCH net 2/3] net: phy: bcm7xxx: re-advertise all supported modes out of suspend Florian Fainelli
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2014-08-14 23:52 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
A wildcard entry with the 32-bits OUI 0x600d8400 was added as part of
the BCM7xxx internal PHY driver, but that entry might match other PHYs
that are not covered by this driver, so let's just remove it.
Fixes: b560a58c45c6 ("net: phy: add Broadcom BCM7xxx internal PHY driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/bcm7xxx.c | 14 --------------
include/linux/brcmphy.h | 1 -
2 files changed, 15 deletions(-)
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index 526b94cea569..2b40548c85d5 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -287,19 +287,6 @@ static struct phy_driver bcm7xxx_driver[] = {
.resume = bcm7xxx_28nm_config_init,
.driver = { .owner = THIS_MODULE },
}, {
- .name = "Broadcom BCM7XXX 28nm",
- .phy_id = PHY_ID_BCM7XXX_28,
- .phy_id_mask = PHY_BCM_OUI_MASK,
- .features = PHY_GBIT_FEATURES |
- SUPPORTED_Pause | SUPPORTED_Asym_Pause,
- .flags = PHY_IS_INTERNAL,
- .config_init = bcm7xxx_28nm_config_init,
- .config_aneg = genphy_config_aneg,
- .read_status = genphy_read_status,
- .suspend = bcm7xxx_suspend,
- .resume = bcm7xxx_28nm_config_init,
- .driver = { .owner = THIS_MODULE },
-}, {
.phy_id = PHY_BCM_OUI_4,
.phy_id_mask = 0xffff0000,
.name = "Broadcom BCM7XXX 40nm",
@@ -331,7 +318,6 @@ static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = {
{ PHY_ID_BCM7366, 0xfffffff0, },
{ PHY_ID_BCM7439, 0xfffffff0, },
{ PHY_ID_BCM7445, 0xfffffff0, },
- { PHY_ID_BCM7XXX_28, 0xfffffc00 },
{ PHY_BCM_OUI_4, 0xffff0000 },
{ PHY_BCM_OUI_5, 0xffffff00 },
{ }
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index 6f76277baf39..61219b9b3445 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -16,7 +16,6 @@
#define PHY_ID_BCM7366 0x600d8490
#define PHY_ID_BCM7439 0x600d8480
#define PHY_ID_BCM7445 0x600d8510
-#define PHY_ID_BCM7XXX_28 0x600d8400
#define PHY_BCM_OUI_MASK 0xfffffc00
#define PHY_BCM_OUI_1 0x00206000
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 2/3] net: phy: bcm7xxx: re-advertise all supported modes out of suspend
2014-08-14 23:52 [PATCH net 0/3] net: phy: bcm7xxx internal PHY fixes Florian Fainelli
2014-08-14 23:52 ` [PATCH net 1/3] net: phy: bcm7xxx: remove 28nm wildcard entry Florian Fainelli
@ 2014-08-14 23:52 ` Florian Fainelli
2014-08-14 23:52 ` [PATCH net 3/3] net: phy: bcm7xxx: remove suspend callback for 28nm PHYs Florian Fainelli
2014-08-17 2:16 ` [PATCH net 0/3] net: phy: bcm7xxx internal PHY fixes David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2014-08-14 23:52 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
The BCM7xxx internal Gigabit PHYs on 28nm process platforms come out
reset without any half-duplex or "hub" compatible advertised modes,
which was causing auto-negotiation issues coming out of S3
suspend/resume, we just could not establish a link with a half-duplex
only link partner.
Make sure that the resume function properly re-configures the PHY device
to advertise all supported modes.
Fixes: b560a58c45c6 ("net: phy: add Broadcom BCM7xxx internal PHY driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/bcm7xxx.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index 2b40548c85d5..a8ca03ff4f1e 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -157,6 +157,23 @@ static int bcm7xxx_28nm_config_init(struct phy_device *phydev)
return bcm7xxx_28nm_afe_config_init(phydev);
}
+static int bcm7xxx_28nm_resume(struct phy_device *phydev)
+{
+ int ret;
+
+ /* Re-apply workarounds coming out suspend/resume */
+ ret = bcm7xxx_28nm_config_init(phydev);
+ if (ret)
+ return ret;
+
+ /* 28nm Gigabit PHYs come out of reset without any half-duplex
+ * or "hub" compliant advertised mode, fix that. This does not
+ * cause any problems with the PHY library since genphy_config_aneg()
+ * gracefully handles auto-negotiated and forced modes.
+ */
+ return genphy_config_aneg(phydev);
+}
+
static int phy_set_clr_bits(struct phy_device *dev, int location,
int set_mask, int clr_mask)
{
@@ -258,7 +275,7 @@ static struct phy_driver bcm7xxx_driver[] = {
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
.suspend = bcm7xxx_suspend,
- .resume = bcm7xxx_28nm_afe_config_init,
+ .resume = bcm7xxx_28nm_resume,
.driver = { .owner = THIS_MODULE },
}, {
.phy_id = PHY_ID_BCM7439,
@@ -271,7 +288,7 @@ static struct phy_driver bcm7xxx_driver[] = {
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
.suspend = bcm7xxx_suspend,
- .resume = bcm7xxx_28nm_afe_config_init,
+ .resume = bcm7xxx_28nm_resume,
.driver = { .owner = THIS_MODULE },
}, {
.phy_id = PHY_ID_BCM7445,
@@ -284,7 +301,7 @@ static struct phy_driver bcm7xxx_driver[] = {
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
.suspend = bcm7xxx_suspend,
- .resume = bcm7xxx_28nm_config_init,
+ .resume = bcm7xxx_28nm_afe_config_init,
.driver = { .owner = THIS_MODULE },
}, {
.phy_id = PHY_BCM_OUI_4,
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 3/3] net: phy: bcm7xxx: remove suspend callback for 28nm PHYs
2014-08-14 23:52 [PATCH net 0/3] net: phy: bcm7xxx internal PHY fixes Florian Fainelli
2014-08-14 23:52 ` [PATCH net 1/3] net: phy: bcm7xxx: remove 28nm wildcard entry Florian Fainelli
2014-08-14 23:52 ` [PATCH net 2/3] net: phy: bcm7xxx: re-advertise all supported modes out of suspend Florian Fainelli
@ 2014-08-14 23:52 ` Florian Fainelli
2014-08-17 2:16 ` [PATCH net 0/3] net: phy: bcm7xxx internal PHY fixes David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2014-08-14 23:52 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
BCM7xxx internal Gigabit PHY on 28nm process do not need anything
special to be done during suspend, remove the suspend callback since it
might be harmful rather than useful. While at it, update the comment
above bcm7xxx_suspend() to reflect that it applies only to 40nm and 65nm
process PHY devices.
Fixes: b560a58c45c6 ("net: phy: add Broadcom BCM7xxx internal PHY driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/bcm7xxx.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index a8ca03ff4f1e..fdce1ea28790 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -229,7 +229,7 @@ static int bcm7xxx_config_init(struct phy_device *phydev)
}
/* Workaround for putting the PHY in IDDQ mode, required
- * for all BCM7XXX PHYs
+ * for all BCM7XXX 40nm and 65nm PHYs
*/
static int bcm7xxx_suspend(struct phy_device *phydev)
{
@@ -274,7 +274,6 @@ static struct phy_driver bcm7xxx_driver[] = {
.config_init = bcm7xxx_28nm_afe_config_init,
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
- .suspend = bcm7xxx_suspend,
.resume = bcm7xxx_28nm_resume,
.driver = { .owner = THIS_MODULE },
}, {
@@ -287,7 +286,6 @@ static struct phy_driver bcm7xxx_driver[] = {
.config_init = bcm7xxx_28nm_afe_config_init,
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
- .suspend = bcm7xxx_suspend,
.resume = bcm7xxx_28nm_resume,
.driver = { .owner = THIS_MODULE },
}, {
@@ -300,7 +298,6 @@ static struct phy_driver bcm7xxx_driver[] = {
.config_init = bcm7xxx_28nm_config_init,
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
- .suspend = bcm7xxx_suspend,
.resume = bcm7xxx_28nm_afe_config_init,
.driver = { .owner = THIS_MODULE },
}, {
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net 0/3] net: phy: bcm7xxx internal PHY fixes
2014-08-14 23:52 [PATCH net 0/3] net: phy: bcm7xxx internal PHY fixes Florian Fainelli
` (2 preceding siblings ...)
2014-08-14 23:52 ` [PATCH net 3/3] net: phy: bcm7xxx: remove suspend callback for 28nm PHYs Florian Fainelli
@ 2014-08-17 2:16 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2014-08-17 2:16 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Thu, 14 Aug 2014 16:52:50 -0700
> Here are 3 small fixes for the Broadcom BCM7xxx internal PHY targeting
> suspend/resume issues.
Series applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-08-17 2:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14 23:52 [PATCH net 0/3] net: phy: bcm7xxx internal PHY fixes Florian Fainelli
2014-08-14 23:52 ` [PATCH net 1/3] net: phy: bcm7xxx: remove 28nm wildcard entry Florian Fainelli
2014-08-14 23:52 ` [PATCH net 2/3] net: phy: bcm7xxx: re-advertise all supported modes out of suspend Florian Fainelli
2014-08-14 23:52 ` [PATCH net 3/3] net: phy: bcm7xxx: remove suspend callback for 28nm PHYs Florian Fainelli
2014-08-17 2:16 ` [PATCH net 0/3] net: phy: bcm7xxx internal PHY fixes David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).