netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] Fix QCA808X WoL Issue and Enable WoL Support for QCA807X
@ 2025-07-03 12:14 Luo Jie
  2025-07-03 12:14 ` [PATCH net-next 1/3] net: phy: qcom: move the WoL function to shared library Luo Jie
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Luo Jie @ 2025-07-03 12:14 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King (Oracle),
	Viorel Suman, Li Yang, Wei Fang
  Cc: netdev, linux-arm-msm, linux-kernel, Luo Jie, Luo Jie

Restore WoL (Wake-on-LAN) enablement via MMD3 register 0x8012 BIT5 for
the QCA808X PHY. This change resolves the issue where WoL functionality
was not working due to its unintended removal in a previous commit.

Refactor at8031_set_wol() into a shared library to enable reuse of the
Wake-on-LAN (WoL) functionality by the AT8031, QCA807X and QCA808X PHY
drivers.

Additionally, enable the WoL function for the QCA807X PHY by utilizing
the at8031_set_wol() function from the shared library.

Signed-off-by: Luo Jie <luoj@qti.qualcomm.com>
---
Luo Jie (3):
      net: phy: qcom: move the WoL function to shared library
      net: phy: qcom: qca808x: Fix WoL issue by utilizing at8031_set_wol()
      net: phy: qcom: qca807x: Enable WoL support using shared library

 drivers/net/phy/qcom/at803x.c       | 27 ---------------------------
 drivers/net/phy/qcom/qca807x.c      |  4 ++++
 drivers/net/phy/qcom/qca808x.c      |  2 +-
 drivers/net/phy/qcom/qcom-phy-lib.c | 25 +++++++++++++++++++++++++
 drivers/net/phy/qcom/qcom.h         |  5 +++++
 5 files changed, 35 insertions(+), 28 deletions(-)
---
base-commit: 8b98f34ce1d8c520403362cb785231f9898eb3ff
change-id: 20250703-qcom_phy_wol_support-402f7178c5c9

Best regards,
-- 
Luo Jie <luoj@qti.qualcomm.com>


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

* [PATCH net-next 1/3] net: phy: qcom: move the WoL function to shared library
  2025-07-03 12:14 [PATCH net-next 0/3] Fix QCA808X WoL Issue and Enable WoL Support for QCA807X Luo Jie
@ 2025-07-03 12:14 ` Luo Jie
  2025-07-03 14:19   ` Maxime Chevallier
  2025-07-03 12:14 ` [PATCH net-next 2/3] net: phy: qcom: qca808x: Fix WoL issue by utilizing at8031_set_wol() Luo Jie
  2025-07-03 12:14 ` [PATCH net-next 3/3] net: phy: qcom: qca807x: Enable WoL support using shared library Luo Jie
  2 siblings, 1 reply; 7+ messages in thread
From: Luo Jie @ 2025-07-03 12:14 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King (Oracle),
	Viorel Suman, Li Yang, Wei Fang
  Cc: netdev, linux-arm-msm, linux-kernel, Luo Jie, Luo Jie

Move the WoL (Wake-on-LAN) functionality to a shared library to enable
its reuse by the QCA808X PHY driver, incorporating support for WoL
functionality similar to the implementation in at8031_set_wol().

Signed-off-by: Luo Jie <quic_luoj@quicinc.com>
---
 drivers/net/phy/qcom/at803x.c       | 27 ---------------------------
 drivers/net/phy/qcom/qcom-phy-lib.c | 25 +++++++++++++++++++++++++
 drivers/net/phy/qcom/qcom.h         |  5 +++++
 3 files changed, 30 insertions(+), 27 deletions(-)

diff --git a/drivers/net/phy/qcom/at803x.c b/drivers/net/phy/qcom/at803x.c
index 43e604171828..51a132242462 100644
--- a/drivers/net/phy/qcom/at803x.c
+++ b/drivers/net/phy/qcom/at803x.c
@@ -27,9 +27,6 @@
 
 #define AT803X_LED_CONTROL			0x18
 
-#define AT803X_PHY_MMD3_WOL_CTRL		0x8012
-#define AT803X_WOL_EN				BIT(5)
-
 #define AT803X_REG_CHIP_CONFIG			0x1f
 #define AT803X_BT_BX_REG_SEL			0x8000
 
@@ -916,30 +913,6 @@ static int at8031_config_init(struct phy_device *phydev)
 	return at803x_config_init(phydev);
 }
 
-static int at8031_set_wol(struct phy_device *phydev,
-			  struct ethtool_wolinfo *wol)
-{
-	int ret;
-
-	/* First setup MAC address and enable WOL interrupt */
-	ret = at803x_set_wol(phydev, wol);
-	if (ret)
-		return ret;
-
-	if (wol->wolopts & WAKE_MAGIC)
-		/* Enable WOL function for 1588 */
-		ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
-				     AT803X_PHY_MMD3_WOL_CTRL,
-				     0, AT803X_WOL_EN);
-	else
-		/* Disable WoL function for 1588 */
-		ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
-				     AT803X_PHY_MMD3_WOL_CTRL,
-				     AT803X_WOL_EN, 0);
-
-	return ret;
-}
-
 static int at8031_config_intr(struct phy_device *phydev)
 {
 	struct at803x_priv *priv = phydev->priv;
diff --git a/drivers/net/phy/qcom/qcom-phy-lib.c b/drivers/net/phy/qcom/qcom-phy-lib.c
index d28815ef56bb..af7d0d8e81be 100644
--- a/drivers/net/phy/qcom/qcom-phy-lib.c
+++ b/drivers/net/phy/qcom/qcom-phy-lib.c
@@ -115,6 +115,31 @@ int at803x_set_wol(struct phy_device *phydev,
 }
 EXPORT_SYMBOL_GPL(at803x_set_wol);
 
+int at8031_set_wol(struct phy_device *phydev,
+		   struct ethtool_wolinfo *wol)
+{
+	int ret;
+
+	/* First setup MAC address and enable WOL interrupt */
+	ret = at803x_set_wol(phydev, wol);
+	if (ret)
+		return ret;
+
+	if (wol->wolopts & WAKE_MAGIC)
+		/* Enable WOL function for 1588 */
+		ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
+				     AT803X_PHY_MMD3_WOL_CTRL,
+				     0, AT803X_WOL_EN);
+	else
+		/* Disable WoL function for 1588 */
+		ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
+				     AT803X_PHY_MMD3_WOL_CTRL,
+				     AT803X_WOL_EN, 0);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(at8031_set_wol);
+
 void at803x_get_wol(struct phy_device *phydev,
 		    struct ethtool_wolinfo *wol)
 {
diff --git a/drivers/net/phy/qcom/qcom.h b/drivers/net/phy/qcom/qcom.h
index 4bb541728846..7f7151c8baca 100644
--- a/drivers/net/phy/qcom/qcom.h
+++ b/drivers/net/phy/qcom/qcom.h
@@ -172,6 +172,9 @@
 #define AT803X_LOC_MAC_ADDR_16_31_OFFSET	0x804B
 #define AT803X_LOC_MAC_ADDR_32_47_OFFSET	0x804A
 
+#define AT803X_PHY_MMD3_WOL_CTRL		0x8012
+#define AT803X_WOL_EN				BIT(5)
+
 #define AT803X_DEBUG_ADDR			0x1D
 #define AT803X_DEBUG_DATA			0x1E
 
@@ -215,6 +218,8 @@ int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg,
 int at803x_debug_reg_write(struct phy_device *phydev, u16 reg, u16 data);
 int at803x_set_wol(struct phy_device *phydev,
 		   struct ethtool_wolinfo *wol);
+int at8031_set_wol(struct phy_device *phydev,
+		   struct ethtool_wolinfo *wol);
 void at803x_get_wol(struct phy_device *phydev,
 		    struct ethtool_wolinfo *wol);
 int at803x_ack_interrupt(struct phy_device *phydev);

-- 
2.34.1


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

* [PATCH net-next 2/3] net: phy: qcom: qca808x: Fix WoL issue by utilizing at8031_set_wol()
  2025-07-03 12:14 [PATCH net-next 0/3] Fix QCA808X WoL Issue and Enable WoL Support for QCA807X Luo Jie
  2025-07-03 12:14 ` [PATCH net-next 1/3] net: phy: qcom: move the WoL function to shared library Luo Jie
@ 2025-07-03 12:14 ` Luo Jie
  2025-07-03 14:23   ` Maxime Chevallier
  2025-07-03 12:14 ` [PATCH net-next 3/3] net: phy: qcom: qca807x: Enable WoL support using shared library Luo Jie
  2 siblings, 1 reply; 7+ messages in thread
From: Luo Jie @ 2025-07-03 12:14 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King (Oracle),
	Viorel Suman, Li Yang, Wei Fang
  Cc: netdev, linux-arm-msm, linux-kernel, Luo Jie, Luo Jie

The previous commit unintentionally removed the code responsible for
enabling WoL via MMD3 register 0x8012 BIT5. As a result, Wake-on-LAN
(WoL) support for the QCA808X PHY is no longer functional.

The WoL (Wake-on-LAN) feature for the QCA808X PHY is enabled via MMD3
register 0x8012, BIT5. This implementation is aligned with the approach
used in at8031_set_wol().

Fixes: e58f30246c35 ("net: phy: at803x: fix the wol setting functions")
Signed-off-by: Luo Jie <quic_luoj@quicinc.com>
---
 drivers/net/phy/qcom/qca808x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c
index 71498c518f0f..6de16c0eaa08 100644
--- a/drivers/net/phy/qcom/qca808x.c
+++ b/drivers/net/phy/qcom/qca808x.c
@@ -633,7 +633,7 @@ static struct phy_driver qca808x_driver[] = {
 	.handle_interrupt	= at803x_handle_interrupt,
 	.get_tunable		= at803x_get_tunable,
 	.set_tunable		= at803x_set_tunable,
-	.set_wol		= at803x_set_wol,
+	.set_wol		= at8031_set_wol,
 	.get_wol		= at803x_get_wol,
 	.get_features		= qca808x_get_features,
 	.config_aneg		= qca808x_config_aneg,

-- 
2.34.1


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

* [PATCH net-next 3/3] net: phy: qcom: qca807x: Enable WoL support using shared library
  2025-07-03 12:14 [PATCH net-next 0/3] Fix QCA808X WoL Issue and Enable WoL Support for QCA807X Luo Jie
  2025-07-03 12:14 ` [PATCH net-next 1/3] net: phy: qcom: move the WoL function to shared library Luo Jie
  2025-07-03 12:14 ` [PATCH net-next 2/3] net: phy: qcom: qca808x: Fix WoL issue by utilizing at8031_set_wol() Luo Jie
@ 2025-07-03 12:14 ` Luo Jie
  2 siblings, 0 replies; 7+ messages in thread
From: Luo Jie @ 2025-07-03 12:14 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King (Oracle),
	Viorel Suman, Li Yang, Wei Fang
  Cc: netdev, linux-arm-msm, linux-kernel, Luo Jie

From: Luo Jie <luoj@qti.qualcomm.com>

The Wake-on-LAN (WoL) functionality for the QCA807x series is identical
to that of the AT8031. WoL support for QCA807x is enabled by utilizing
the at8031_set_wol() function provided in the shared library.

Signed-off-by: Luo Jie <luoj@qti.qualcomm.com>
---
 drivers/net/phy/qcom/qca807x.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/phy/qcom/qca807x.c b/drivers/net/phy/qcom/qca807x.c
index 6d10ef7e9a8a..40064d820821 100644
--- a/drivers/net/phy/qcom/qca807x.c
+++ b/drivers/net/phy/qcom/qca807x.c
@@ -800,6 +800,8 @@ static struct phy_driver qca807x_drivers[] = {
 		.suspend	= genphy_suspend,
 		.cable_test_start	= qca807x_cable_test_start,
 		.cable_test_get_status	= qca808x_cable_test_get_status,
+		.set_wol		= at8031_set_wol,
+		.get_wol		= at803x_get_wol,
 	},
 	{
 		PHY_ID_MATCH_EXACT(PHY_ID_QCA8075),
@@ -823,6 +825,8 @@ static struct phy_driver qca807x_drivers[] = {
 		.led_hw_is_supported = qca807x_led_hw_is_supported,
 		.led_hw_control_set = qca807x_led_hw_control_set,
 		.led_hw_control_get = qca807x_led_hw_control_get,
+		.set_wol		= at8031_set_wol,
+		.get_wol		= at803x_get_wol,
 	},
 };
 module_phy_driver(qca807x_drivers);

-- 
2.34.1


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

* Re: [PATCH net-next 1/3] net: phy: qcom: move the WoL function to shared library
  2025-07-03 12:14 ` [PATCH net-next 1/3] net: phy: qcom: move the WoL function to shared library Luo Jie
@ 2025-07-03 14:19   ` Maxime Chevallier
  0 siblings, 0 replies; 7+ messages in thread
From: Maxime Chevallier @ 2025-07-03 14:19 UTC (permalink / raw)
  To: Luo Jie
  Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King (Oracle),
	Viorel Suman, Li Yang, Wei Fang, netdev, linux-arm-msm,
	linux-kernel, Luo Jie

On Thu, 3 Jul 2025 20:14:28 +0800
Luo Jie <quic_luoj@quicinc.com> wrote:

> Move the WoL (Wake-on-LAN) functionality to a shared library to enable
> its reuse by the QCA808X PHY driver, incorporating support for WoL
> functionality similar to the implementation in at8031_set_wol().
> 
> Signed-off-by: Luo Jie <quic_luoj@quicinc.com>

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Maxime

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

* Re: [PATCH net-next 2/3] net: phy: qcom: qca808x: Fix WoL issue by utilizing at8031_set_wol()
  2025-07-03 12:14 ` [PATCH net-next 2/3] net: phy: qcom: qca808x: Fix WoL issue by utilizing at8031_set_wol() Luo Jie
@ 2025-07-03 14:23   ` Maxime Chevallier
  2025-07-03 15:14     ` Luo Jie
  0 siblings, 1 reply; 7+ messages in thread
From: Maxime Chevallier @ 2025-07-03 14:23 UTC (permalink / raw)
  To: Luo Jie
  Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King (Oracle),
	Viorel Suman, Li Yang, Wei Fang, netdev, linux-arm-msm,
	linux-kernel, Luo Jie

Hi,

On Thu, 3 Jul 2025 20:14:29 +0800
Luo Jie <quic_luoj@quicinc.com> wrote:

> The previous commit unintentionally removed the code responsible for
> enabling WoL via MMD3 register 0x8012 BIT5. As a result, Wake-on-LAN
> (WoL) support for the QCA808X PHY is no longer functional.
> 
> The WoL (Wake-on-LAN) feature for the QCA808X PHY is enabled via MMD3
> register 0x8012, BIT5. This implementation is aligned with the approach
> used in at8031_set_wol().
> 
> Fixes: e58f30246c35 ("net: phy: at803x: fix the wol setting functions")
> Signed-off-by: Luo Jie <quic_luoj@quicinc.com>

If this is a fix, you should target the -net tree instead -net-next :)

Maxime

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

* Re: [PATCH net-next 2/3] net: phy: qcom: qca808x: Fix WoL issue by utilizing at8031_set_wol()
  2025-07-03 14:23   ` Maxime Chevallier
@ 2025-07-03 15:14     ` Luo Jie
  0 siblings, 0 replies; 7+ messages in thread
From: Luo Jie @ 2025-07-03 15:14 UTC (permalink / raw)
  To: Maxime Chevallier
  Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Russell King (Oracle),
	Viorel Suman, Li Yang, Wei Fang, netdev, linux-arm-msm,
	linux-kernel, Luo Jie



On 7/3/2025 10:23 PM, Maxime Chevallier wrote:
> Hi,
> 
> On Thu, 3 Jul 2025 20:14:29 +0800
> Luo Jie <quic_luoj@quicinc.com> wrote:
> 
>> The previous commit unintentionally removed the code responsible for
>> enabling WoL via MMD3 register 0x8012 BIT5. As a result, Wake-on-LAN
>> (WoL) support for the QCA808X PHY is no longer functional.
>>
>> The WoL (Wake-on-LAN) feature for the QCA808X PHY is enabled via MMD3
>> register 0x8012, BIT5. This implementation is aligned with the approach
>> used in at8031_set_wol().
>>
>> Fixes: e58f30246c35 ("net: phy: at803x: fix the wol setting functions")
>> Signed-off-by: Luo Jie <quic_luoj@quicinc.com>
> 
> If this is a fix, you should target the -net tree instead -net-next :)
> 
> Maxime

OK. I will resend the patch series targeting the -net tree instead.
Thank you for the feedback.


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

end of thread, other threads:[~2025-07-03 15:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-03 12:14 [PATCH net-next 0/3] Fix QCA808X WoL Issue and Enable WoL Support for QCA807X Luo Jie
2025-07-03 12:14 ` [PATCH net-next 1/3] net: phy: qcom: move the WoL function to shared library Luo Jie
2025-07-03 14:19   ` Maxime Chevallier
2025-07-03 12:14 ` [PATCH net-next 2/3] net: phy: qcom: qca808x: Fix WoL issue by utilizing at8031_set_wol() Luo Jie
2025-07-03 14:23   ` Maxime Chevallier
2025-07-03 15:14     ` Luo Jie
2025-07-03 12:14 ` [PATCH net-next 3/3] net: phy: qcom: qca807x: Enable WoL support using shared library Luo Jie

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).