[PATCH net 0/2] Fixes on the Microchip's LAN865x driver

STALE380d

Revision v1 of 2 in this series.

5 messages, 2 authors, 2025-08-18 · open the first message on its own page

[PATCH net 0/2] Fixes on the Microchip's LAN865x driver

From: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
Date: 2025-08-13 10:34:35

This patch series includes two bug fixes for the LAN865x Ethernet MAC-PHY
driver:

1. Fix missing transmit queue restart on device reopen
   This patch addresses an issue where the transmit queue is not restarted
   when the network interface is brought back up after being taken down
   (e.g., via ip or ifconfig). As a result, packet transmission hangs
   after the first down/up cycle. The fix ensures netif_start_queue() is
   explicitly called in lan865x_net_open() to properly restart the queue
   on every reopen.

2. Fix missing configuration for LAN865x Rev.B0/B1 hardware
   This patch applies a required configuration for LAN865x silicon
   revisions B0 and B1, as specified in Microchip Application Note AN1760.
   Without this fix, affected hardware may not initialize or function
   correctly. The patch programs register 0x10077 with the value 0x0028
   during initialization, ensuring compatibility with these hardware
   revisions.

Both patches address issues introduced with the initial driver support and
are marked with the appropriate Fixes: tag.


Parthiban Veerasooran (2):
  microchip: lan865x: fix missing netif_start_queue() call on device
    open
  microchip: lan865x: fix missing configuration for Rev.B0/B1 as per
    AN1760

 .../net/ethernet/microchip/lan865x/lan865x.c   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)


base-commit: fdbe93b7f0f86c943351ceab26c8fad548869f91
-- 
2.34.1

[PATCH net 1/2] microchip: lan865x: fix missing netif_start_queue() call on device open

From: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
Date: 2025-08-13 10:34:13

This fixes an issue where the transmit queue is started implicitly only
the very first time the device is registered. When the device is taken
down and brought back up again (using `ip` or `ifconfig`), the transmit
queue is not restarted, causing packet transmission to hang.

Adding an explicit call to netif_start_queue() in lan865x_net_open()
ensures the transmit queue is properly started every time the device
is reopened.

Fixes: 5cd2340cb6a3 ("microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY")
Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
---
 drivers/net/ethernet/microchip/lan865x/lan865x.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
index dd436bdff0f8..d03f5a8de58d 100644
--- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
+++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
@@ -311,6 +311,8 @@ static int lan865x_net_open(struct net_device *netdev)
 
 	phy_start(netdev->phydev);
 
+	netif_start_queue(netdev);
+
 	return 0;
 }
 
-- 
2.34.1

[PATCH net 2/2] microchip: lan865x: fix missing configuration for Rev.B0/B1 as per AN1760

From: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
Date: 2025-08-13 10:34:15

Fix missing configuration required for LAN865x silicon revisions B0 and B1,
as documented in Microchip Application Note AN1760 (Revision F, June 2024).

According to the guidance in the application note, register 0x10077 must be
programmed with the value 0x0028 to ensure correct operation on Rev.B0/B1
devices. Without this fixup, the device may not function correctly or may
fail to initialize.

Reference:
https://www.microchip.com/en-us/application-notes/an1760

Fixes: 5cd2340cb6a3 ("microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY")
Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
---
 drivers/net/ethernet/microchip/lan865x/lan865x.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
index d03f5a8de58d..a55ca485062f 100644
--- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
+++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
@@ -32,6 +32,14 @@
 /* MAC Specific Addr 1 Top Reg */
 #define LAN865X_REG_MAC_H_SADDR1	0x00010023
 
+/* LAN865x Rev.B0/B1 configuration parameters from AN1760
+ * As per the Configuration Application Note AN1760 published in the below link,
+ * https://www.microchip.com/en-us/application-notes/an1760
+ * Revision F (DS60001760G - June 2024)
+ */
+#define LAN865X_REG_FIXUP		0x00010077
+#define LAN865X_FIXUP_VALUE		0x0028
+
 struct lan865x_priv {
 	struct work_struct multicast_work;
 	struct net_device *netdev;
@@ -346,6 +354,14 @@ static int lan865x_probe(struct spi_device *spi)
 		goto free_netdev;
 	}
 
+	/* LAN8650/1 configuration fixup from AN1760 */
+	ret = oa_tc6_write_register(priv->tc6, LAN865X_REG_FIXUP,
+				    LAN865X_FIXUP_VALUE);
+	if (ret) {
+		dev_err(&spi->dev, "Failed to configure fixup: %d\n", ret);
+		goto oa_tc6_exit;
+	}
+
 	/* As per the point s3 in the below errata, SPI receive Ethernet frame
 	 * transfer may halt when starting the next frame in the same data block
 	 * (chunk) as the end of a previous frame. The RFA field should be
-- 
2.34.1

Re: [PATCH net 2/2] microchip: lan865x: fix missing configuration for Rev.B0/B1 as per AN1760

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-08-16 01:40:20

On Wed, 13 Aug 2025 16:03:55 +0530 Parthiban Veerasooran wrote:
+#define LAN865X_REG_FIXUP		0x00010077
+#define LAN865X_FIXUP_VALUE		0x0028
Looks like the application note explains what this register is and what
is the meaning of the bits in it. Please break this up and name
properly. "FIXUP_REGISTER" and "FIXUP_VALUE" is about as useful
as naming it "REGSITER_AT_10077" and "VALUE_28" :/
-- 
pw-bot: cr

Re: [PATCH net 2/2] microchip: lan865x: fix missing configuration for Rev.B0/B1 as per AN1760

From: <Parthiban.Veerasooran@microchip.com>
Date: 2025-08-18 04:44:56

Hi Kakub,

Thank you for reviewing the patches.

On 16/08/25 7:10 am, Jakub Kicinski wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

On Wed, 13 Aug 2025 16:03:55 +0530 Parthiban Veerasooran wrote:
quoted
+#define LAN865X_REG_FIXUP            0x00010077
+#define LAN865X_FIXUP_VALUE          0x0028
Looks like the application note explains what this register is and what
is the meaning of the bits in it. Please break this up and name
properly. "FIXUP_REGISTER" and "FIXUP_VALUE" is about as useful
as naming it "REGSITER_AT_10077" and "VALUE_28" :/
Yes, sure. I will update the correct details in the next version.

Since this falls under the initial settings, I initially kept this 
configuration as a "fixup," similar to what we did in the PHY driver. In 
that case, the PHY initial settings didn’t have valid register names or 
details, so the "fixup" approach was appropriate.

However, in this case, we do have the register names and details 
available in the configuration application note. So, I will update the 
configuration accordingly.

Best regards,
Parthiban V
--
pw-bot: cr

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help