All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes
@ 2016-02-03 21:13 Florian Fainelli
  2016-02-03 21:13 ` [PATCH net 1/4] net: phy: bcm7xxx: Fix shadow mode 2 disabling Florian Fainelli
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Florian Fainelli @ 2016-02-03 21:13 UTC (permalink / raw)
  To: netdev; +Cc: davem, pgynther, opendmb, jaedon.shin, Florian Fainelli

Hi David,

Here is a collection of fixes for the 40nm Ethernet PHY supported
by the 7xxx PHY driver, please also queue these fixes for stable.

Let me know if you think patch 4 is too much of a cleanup to be taken
as a fix.

Thanks!

Florian Fainelli (4):
  net: phy: bcm7xxx: Fix shadow mode 2 disabling
  net: phy: bcm7xxx: Fix 40nm EPHY features
  net: phy: bcm7xxx: Fix bcm7xxx_config_init() check
  net: phy: bcm7xxx: Make MII_BCM7XX_64CLK_MDIO naming consistent

 drivers/net/phy/bcm7xxx.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

-- 
2.1.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net 1/4] net: phy: bcm7xxx: Fix shadow mode 2 disabling
  2016-02-03 21:13 [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes Florian Fainelli
@ 2016-02-03 21:13 ` Florian Fainelli
  2016-02-03 21:13 ` [PATCH net 2/4] net: phy: bcm7xxx: Fix 40nm EPHY features Florian Fainelli
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2016-02-03 21:13 UTC (permalink / raw)
  To: netdev; +Cc: davem, pgynther, opendmb, jaedon.shin, Florian Fainelli

The clear and set masks in the call to phy_set_clr_bits() called from
bcm7xxx_config_init() are inverted. We need to fix this by swapping the two
arguments, that is, set 0 bits, but clear the shade mode 2 enable bit.

Fixes: b560a58c45c66 ("net: phy: add Broadcom BCM7xxx internal PHY driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/bcm7xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index bf241a3ec5e5..234a28502793 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -270,7 +270,7 @@ static int bcm7xxx_config_init(struct phy_device *phydev)
 	phy_write(phydev, MII_BCM7XXX_100TX_FALSE_CAR, 0x7555);
 
 	/* reset shadow mode 2 */
-	ret = phy_set_clr_bits(phydev, MII_BCM7XXX_TEST, MII_BCM7XXX_SHD_MODE_2, 0);
+	ret = phy_set_clr_bits(phydev, MII_BCM7XXX_TEST, 0, MII_BCM7XXX_SHD_MODE_2);
 	if (ret < 0)
 		return ret;
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 2/4] net: phy: bcm7xxx: Fix 40nm EPHY features
  2016-02-03 21:13 [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes Florian Fainelli
  2016-02-03 21:13 ` [PATCH net 1/4] net: phy: bcm7xxx: Fix shadow mode 2 disabling Florian Fainelli
@ 2016-02-03 21:13 ` Florian Fainelli
  2016-02-03 21:13 ` [PATCH net 3/4] net: phy: bcm7xxx: Fix bcm7xxx_config_init() check Florian Fainelli
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2016-02-03 21:13 UTC (permalink / raw)
  To: netdev; +Cc: davem, pgynther, opendmb, jaedon.shin, Florian Fainelli

The PHY entries for BCM7425/29/35 declare the 40nm Ethernet PHY as being
10/100/1000 capable, while this is just a 10/100 capable PHY device, fix that.

Fixes: d068b02cfdfc2 ("net: phy: add BCM7425 and BCM7429 PHYs")
Fixes: 9458ceab4917 ("net: phy: bcm7xxx: Add entry for BCM7435")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/bcm7xxx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index 234a28502793..524806dd0f6b 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -337,7 +337,7 @@ static struct phy_driver bcm7xxx_driver[] = {
 	.phy_id         = PHY_ID_BCM7425,
 	.phy_id_mask    = 0xfffffff0,
 	.name           = "Broadcom BCM7425",
-	.features       = PHY_GBIT_FEATURES |
+	.features       = PHY_BASIC_FEATURES |
 			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
 	.flags          = PHY_IS_INTERNAL,
 	.config_init    = bcm7xxx_config_init,
@@ -349,7 +349,7 @@ static struct phy_driver bcm7xxx_driver[] = {
 	.phy_id         = PHY_ID_BCM7429,
 	.phy_id_mask    = 0xfffffff0,
 	.name           = "Broadcom BCM7429",
-	.features       = PHY_GBIT_FEATURES |
+	.features       = PHY_BASIC_FEATURES |
 			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
 	.flags          = PHY_IS_INTERNAL,
 	.config_init    = bcm7xxx_config_init,
@@ -361,7 +361,7 @@ static struct phy_driver bcm7xxx_driver[] = {
 	.phy_id         = PHY_ID_BCM7435,
 	.phy_id_mask    = 0xfffffff0,
 	.name           = "Broadcom BCM7435",
-	.features       = PHY_GBIT_FEATURES |
+	.features       = PHY_BASIC_FEATURES |
 			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
 	.flags          = PHY_IS_INTERNAL,
 	.config_init    = bcm7xxx_config_init,
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 3/4] net: phy: bcm7xxx: Fix bcm7xxx_config_init() check
  2016-02-03 21:13 [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes Florian Fainelli
  2016-02-03 21:13 ` [PATCH net 1/4] net: phy: bcm7xxx: Fix shadow mode 2 disabling Florian Fainelli
  2016-02-03 21:13 ` [PATCH net 2/4] net: phy: bcm7xxx: Fix 40nm EPHY features Florian Fainelli
@ 2016-02-03 21:13 ` Florian Fainelli
  2016-02-03 21:13 ` [PATCH net 4/4] net: phy: bcm7xxx: Make MII_BCM7XX_64CLK_MDIO naming consistent Florian Fainelli
  2016-02-06  1:25 ` [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes Florian Fainelli
  4 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2016-02-03 21:13 UTC (permalink / raw)
  To: netdev; +Cc: davem, pgynther, opendmb, jaedon.shin, Florian Fainelli

Since we were wrongly advertising gigabit features for these 10/100 only
Ethernet PHYs, bcm7xxx_config_init() which is supposed to apply workaround
would have not run since the check would be true, now that we have fixed the
PHY features, remove that check since it has no reasoning to be there anymore.

Fixes: e18556ee3bd83 ("net: phy: bcm7xxx: do not use PHY_BRCM_100MBPS_WAR")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/bcm7xxx.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index 524806dd0f6b..568768abe3ed 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -250,10 +250,6 @@ static int bcm7xxx_config_init(struct phy_device *phydev)
 	phy_write(phydev, MII_BCM7XXX_AUX_MODE, MII_BCM7XX_64CLK_MDIO);
 	phy_read(phydev, MII_BCM7XXX_AUX_MODE);
 
-	/* Workaround only required for 100Mbits/sec capable PHYs */
-	if (phydev->supported & PHY_GBIT_FEATURES)
-		return 0;
-
 	/* set shadow mode 2 */
 	ret = phy_set_clr_bits(phydev, MII_BCM7XXX_TEST,
 			MII_BCM7XXX_SHD_MODE_2, MII_BCM7XXX_SHD_MODE_2);
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 4/4] net: phy: bcm7xxx: Make MII_BCM7XX_64CLK_MDIO naming consistent
  2016-02-03 21:13 [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes Florian Fainelli
                   ` (2 preceding siblings ...)
  2016-02-03 21:13 ` [PATCH net 3/4] net: phy: bcm7xxx: Fix bcm7xxx_config_init() check Florian Fainelli
@ 2016-02-03 21:13 ` Florian Fainelli
  2016-02-06  1:25 ` [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes Florian Fainelli
  4 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2016-02-03 21:13 UTC (permalink / raw)
  To: netdev; +Cc: davem, pgynther, opendmb, jaedon.shin, Florian Fainelli

The driver is BCM7xxx, we were missing an additional X in the constant naming,
fix that to be consistent.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/bcm7xxx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index 568768abe3ed..0666f54ceeb5 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -24,7 +24,7 @@
 #define MII_BCM7XXX_100TX_FALSE_CAR	0x13
 #define MII_BCM7XXX_100TX_DISC		0x14
 #define MII_BCM7XXX_AUX_MODE		0x1d
-#define  MII_BCM7XX_64CLK_MDIO		BIT(12)
+#define  MII_BCM7XXX_64CLK_MDIO		BIT(12)
 #define MII_BCM7XXX_TEST		0x1f
 #define  MII_BCM7XXX_SHD_MODE_2		BIT(2)
 
@@ -247,7 +247,7 @@ static int bcm7xxx_config_init(struct phy_device *phydev)
 	int ret;
 
 	/* Enable 64 clock MDIO */
-	phy_write(phydev, MII_BCM7XXX_AUX_MODE, MII_BCM7XX_64CLK_MDIO);
+	phy_write(phydev, MII_BCM7XXX_AUX_MODE, MII_BCM7XXX_64CLK_MDIO);
 	phy_read(phydev, MII_BCM7XXX_AUX_MODE);
 
 	/* set shadow mode 2 */
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes
  2016-02-03 21:13 [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes Florian Fainelli
                   ` (3 preceding siblings ...)
  2016-02-03 21:13 ` [PATCH net 4/4] net: phy: bcm7xxx: Make MII_BCM7XX_64CLK_MDIO naming consistent Florian Fainelli
@ 2016-02-06  1:25 ` Florian Fainelli
  2016-02-06  7:43   ` David Miller
  4 siblings, 1 reply; 7+ messages in thread
From: Florian Fainelli @ 2016-02-06  1:25 UTC (permalink / raw)
  To: netdev; +Cc: davem, pgynther, opendmb, jaedon.shin

On 03/02/16 13:13, Florian Fainelli wrote:
> Hi David,
> 
> Here is a collection of fixes for the 40nm Ethernet PHY supported
> by the 7xxx PHY driver, please also queue these fixes for stable.
> 
> Let me know if you think patch 4 is too much of a cleanup to be taken
> as a fix.

David, if you have not applied these yet (patchwork says they are under
review), I have another fix coming your way, and patch 4 should probably
be targetted at net-next, and bundled with another cleanup.

Let me know what's the outcome and I will re-submit where appropriate,
thanks!
-- 
Florian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes
  2016-02-06  1:25 ` [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes Florian Fainelli
@ 2016-02-06  7:43   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2016-02-06  7:43 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, pgynther, opendmb, jaedon.shin

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 5 Feb 2016 17:25:50 -0800

> On 03/02/16 13:13, Florian Fainelli wrote:
>> Hi David,
>> 
>> Here is a collection of fixes for the 40nm Ethernet PHY supported
>> by the 7xxx PHY driver, please also queue these fixes for stable.
>> 
>> Let me know if you think patch 4 is too much of a cleanup to be taken
>> as a fix.
> 
> David, if you have not applied these yet (patchwork says they are under
> review), I have another fix coming your way, and patch 4 should probably
> be targetted at net-next, and bundled with another cleanup.
> 
> Let me know what's the outcome and I will re-submit where appropriate,
> thanks!

I haven't applied any of this so please feel free to resubmit updated
versions as needed.

Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-02-06  7:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-03 21:13 [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes Florian Fainelli
2016-02-03 21:13 ` [PATCH net 1/4] net: phy: bcm7xxx: Fix shadow mode 2 disabling Florian Fainelli
2016-02-03 21:13 ` [PATCH net 2/4] net: phy: bcm7xxx: Fix 40nm EPHY features Florian Fainelli
2016-02-03 21:13 ` [PATCH net 3/4] net: phy: bcm7xxx: Fix bcm7xxx_config_init() check Florian Fainelli
2016-02-03 21:13 ` [PATCH net 4/4] net: phy: bcm7xxx: Make MII_BCM7XX_64CLK_MDIO naming consistent Florian Fainelli
2016-02-06  1:25 ` [PATCH net 0/4] net: phy: bcm7xxx 40nm PHY fixes Florian Fainelli
2016-02-06  7:43   ` David Miller

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.