Skip to contentSkip to conversation

net: phy: introduce a quirk PHY_FLAG_BROKEN_RESET

PATCH In review shh.xie at gmail.com 3 participants 3 messages Jan 28, 2016 – Jan 29, 2016

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

PATCH v2 1/2 net: phy: introduce a quirk PHY_FLAG_BROKEN_RESET

From: Shaohui Xie <[email protected]>

Current driver always performs a phy soft reset when connecting the phy device, but soft reset is not always supported by a phy device, so introduce a quirk PHY_FLAG_BROKEN_RESET to let such a phy device to skip soft reset. This commit uses 'flags' of phy device structure to store the quirk.

---
changes in v2:
1. use PHY_FLAG_BROKEN_RESET instead of PHY_BROKEN_RESET
2. use '&' to check the phydev->flags instead of '=='

 drivers/net/phy/phy.c | 3 +++
 include/phy.h         | 2 ++
 2 files changed, 5 insertions(+)
drivers/net/phy/phy.c +3 -0
index 9bf231c..9126d5d 100644
@@ -741,6 +741,9 @@ int phy_reset(struct phy_device *phydev)
 	int timeout = 500;
 	int devad = MDIO_DEVAD_NONE;
 
+	if (phydev->flags & PHY_FLAG_BROKEN_RESET)
+		return 0;
+
 #ifdef CONFIG_PHYLIB_10G
 	/* If it's 10G, we need to issue reset through one of the MMDs */
 	if (is_10g_interface(phydev->interface)) {
include/phy.h +2 -0
index e030c9f..09bbe48 100644
@@ -17,6 +17,8 @@
 
 #define PHY_MAX_ADDR 32
 
+#define PHY_FLAG_BROKEN_RESET	(1 << 0) /* soft reset not supported */
+
 #define PHY_DEFAULT_FEATURES	(SUPPORTED_Autoneg | \
 				 SUPPORTED_TP | \
 				 SUPPORTED_MII)
Signature · 1 line
2.1.0.27.g96db324
#1 lore raw

PATCH v2 1/2 net: phy: introduce a quirk PHY_FLAG_BROKEN_RESET

Quoted 9 lines · On Thu, Jan 28, 2016 at 1:55 AM, <[email protected]> wrote:

From: Shaohui Xie <[email protected]>

Current driver always performs a phy soft reset when connecting the phy device, but soft reset is not always supported by a phy device, so introduce a quirk PHY_FLAG_BROKEN_RESET to let such a phy device to skip soft reset. This commit uses 'flags' of phy device structure to store the quirk.