Skip to contentSkip to conversation

phy: fix force mode

PATCH Applied Jean-Christophe PLAGNIOL-VILLARD 2 participants 2 messages Feb 24, 2013 – Feb 25, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: fix force mode

do not try to read the status in force mode
the link is up

---
 drivers/net/phy/mdio_bus.c |    4 ++++
 drivers/net/phy/phy.c      |    4 ++++
 include/linux/phy.h        |    1 +
 3 files changed, 9 insertions(+)
drivers/net/phy/mdio_bus.c +4 -0
index d1d802b..e1bb7b1 100644
@@ -167,10 +167,14 @@ static int mdio_bus_probe(struct device_d *_dev)
 			dev->speed = SPEED_10;
 			dev->duplex = DUPLEX_FULL;
 			dev->autoneg = !AUTONEG_ENABLE;
+			dev->force = 1;
+			dev->link = 1;
 		} else if (dev->dev_flags & PHYLIB_FORCE_100) {
 			dev->speed = SPEED_100;
 			dev->duplex = DUPLEX_FULL;
 			dev->autoneg = !AUTONEG_ENABLE;
+			dev->force = 1;
+			dev->link = 1;
 		}
 	}
 
drivers/net/phy/phy.c +4 -0
index 1cf2cb9..12739ff 100644
@@ -549,6 +549,10 @@ int genphy_read_status(struct phy_device *phydev)
 	int lpa;
 	int lpagb = 0;
 
+	/* if force the status and link are set */
+	if (phydev->force)
+		return 0;
+
 	/* Update the link, but return if there
 	 * was an error */
 	err = genphy_update_link(phydev);
include/linux/phy.h +1 -0
index 6c9cac9..99c9639 100644
@@ -158,6 +158,7 @@ struct phy_device {
 	u32 advertising;
 
 	int autoneg;
+	int force;
 
 
 	/* private data pointer */
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 4 lines · Jean-Christophe PLAGNIOL-VILLARD

do not try to read the status in force mode
the link is up

Applied, thanks

Sascha

Quoted 61 lines
---
 drivers/net/phy/mdio_bus.c |    4 ++++
 drivers/net/phy/phy.c      |    4 ++++
 include/linux/phy.h        |    1 +
 3 files changed, 9 insertions(+)
drivers/net/phy/mdio_bus.c +4 -0
index d1d802b..e1bb7b1 100644
@@ -167,10 +167,14 @@ static int mdio_bus_probe(struct device_d *_dev)
 			dev->speed = SPEED_10;
 			dev->duplex = DUPLEX_FULL;
 			dev->autoneg = !AUTONEG_ENABLE;
+			dev->force = 1;
+			dev->link = 1;
 		} else if (dev->dev_flags & PHYLIB_FORCE_100) {
 			dev->speed = SPEED_100;
 			dev->duplex = DUPLEX_FULL;
 			dev->autoneg = !AUTONEG_ENABLE;
+			dev->force = 1;
+			dev->link = 1;
 		}
 	}
 
drivers/net/phy/phy.c +4 -0
index 1cf2cb9..12739ff 100644
@@ -549,6 +549,10 @@ int genphy_read_status(struct phy_device *phydev)
 	int lpa;
 	int lpagb = 0;
 
+	/* if force the status and link are set */
+	if (phydev->force)
+		return 0;
+
 	/* Update the link, but return if there
 	 * was an error */
 	err = genphy_update_link(phydev);
include/linux/phy.h +1 -0
index 6c9cac9..99c9639 100644
@@ -158,6 +158,7 @@ struct phy_device {
 	u32 advertising;
 
 	int autoneg;
+	int force;
 
 
 	/* private data pointer */
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox