Skip to contentSkip to conversation

Fixes on the Microchip's LAN865x driver

PATCH Applied Parthiban Veerasooran 3 participants 5 messages Aug 18, 2025 – Aug 20, 2025

Subsystems (3)
lore
Share & tools
lore

Parthiban Veerasooran

author maintainer
#0 lore raw

v2 cover Fixes on the Microchip's LAN865x driver

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 in the Microchip LAN865x driver for silicon revisions B0 and B1, as documented in Microchip Application Note AN1760 (Rev F, June 2024). These revisions require the MAC to be configured for timestamping at the end of the Start of Frame Delimiter (SFD) and the Timer Increment register to be set to 40 ns, corresponding to a 25 MHz internal clock.

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

v2:
- Updated the register name details with proper names instead of using generic "fixup" labels
- Revised the cover letter description of the second patch to reflect the latest changes.

Parthiban Veerasooran (2):
microchip: lan865x: fix missing netif_start_queue() call on device
open
microchip: lan865x: fix missing Timer Increment config for Rev.B0/B1

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

base-commit: bab3ce404553de56242d7b09ad7ea5b70441ea41

Signature · 1 line
2.34.1
author maintainer
#1 lore raw

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

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")
---
 drivers/net/ethernet/microchip/lan865x/lan865x.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/microchip/lan865x/lan865x.c +2 -0
index dd436bdff0f8..d03f5a8de58d 100644
@@ -311,6 +311,8 @@ static int lan865x_net_open(struct net_device *netdev)
 
 	phy_start(netdev->phydev);
 
+	netif_start_queue(netdev);
+
 	return 0;
 }
 
Signature · 1 line
2.34.1
author maintainer
#2 lore raw

PATCH v2 2/2 microchip: lan865x: fix missing Timer Increment config for Rev.B0/B1

In reply to Parthiban Veerasooran

Fix missing configuration for LAN865x silicon revisions B0 and B1 as per Microchip Application Note AN1760 (Rev F, June 2024).

The Timer Increment register was not being set, which is required for accurate timestamping. As per the application note, configure the MAC to set timestamping at the end of the Start of Frame Delimiter (SFD), and set the Timer Increment register to 40 ns (corresponding to a 25 MHz internal clock).

Fixes 5cd2340cb6a3 ("microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY")
---
 .../net/ethernet/microchip/lan865x/lan865x.c  | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
drivers/net/ethernet/microchip/lan865x/lan865x.c +19 -0
index d03f5a8de58d..84c41f193561 100644
@@ -32,6 +32,10 @@
 /* MAC Specific Addr 1 Top Reg */
 #define LAN865X_REG_MAC_H_SADDR1	0x00010023
 
+/* MAC TSU Timer Increment Register */
+#define LAN865X_REG_MAC_TSU_TIMER_INCR		0x00010077
+#define MAC_TSU_TIMER_INCR_COUNT_NANOSECONDS	0x0028
+
 struct lan865x_priv {
 	struct work_struct multicast_work;
 	struct net_device *netdev;
@@ -346,6 +350,21 @@ static int lan865x_probe(struct spi_device *spi)
 		goto free_netdev;
 	}
 
+	/* LAN865x Rev.B0/B1 configuration parameters from AN1760
+	 * As per the Configuration Application Note AN1760 published in the
+	 * link, https://www.microchip.com/en-us/application-notes/an1760
+	 * Revision F (DS60001760G - June 2024), configure the MAC to set time
+	 * stamping at the end of the Start of Frame Delimiter (SFD) and set the
+	 * Timer Increment reg to 40 ns to be used as a 25 MHz internal clock.
+	 */
+	ret = oa_tc6_write_register(priv->tc6, LAN865X_REG_MAC_TSU_TIMER_INCR,
+				    MAC_TSU_TIMER_INCR_COUNT_NANOSECONDS);
+	if (ret) {
+		dev_err(&spi->dev, "Failed to config TSU Timer Incr reg: %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
Signature · 1 line
2.34.1
Reviewed-by on v2 2/2
#3 lore raw

Re: [PATCH net v2 2/2] microchip: lan865x: fix missing Timer Increment config for Rev.B0/B1

Quoted 44 lines · Parthiban Veerasooran

Fix missing configuration for LAN865x silicon revisions B0 and B1 as per Microchip Application Note AN1760 (Rev F, June 2024).

The Timer Increment register was not being set, which is required for accurate timestamping. As per the application note, configure the MAC to set timestamping at the end of the Start of Frame Delimiter (SFD), and set the Timer Increment register to 40 ns (corresponding to a 25 MHz internal clock).

Fixes 5cd2340cb6a3 ("microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY")
---
  .../net/ethernet/microchip/lan865x/lan865x.c  | 19 +++++++++++++++++++
  1 file changed, 19 insertions(+)
drivers/net/ethernet/microchip/lan865x/lan865x.c +12 -0
index d03f5a8de58d..84c41f193561 100644
@@ -32,6 +32,10 @@
  /* MAC Specific Addr 1 Top Reg */
  #define LAN865X_REG_MAC_H_SADDR1	0x00010023
 
+/* MAC TSU Timer Increment Register */
+#define LAN865X_REG_MAC_TSU_TIMER_INCR		0x00010077
+#define MAC_TSU_TIMER_INCR_COUNT_NANOSECONDS	0x0028
+
  struct lan865x_priv {
  	struct work_struct multicast_work;
  	struct net_device *netdev;
@@ -346,6 +350,21 @@ static int lan865x_probe(struct spi_device *spi)
  		goto free_netdev;
  	}
 
+	/* LAN865x Rev.B0/B1 configuration parameters from AN1760
+	 * As per the Configuration Application Note AN1760 published in the
+	 * link, https://www.microchip.com/en-us/application-notes/an1760
+	 * Revision F (DS60001760G - June 2024), configure the MAC to set time
+	 * stamping at the end of the Start of Frame Delimiter (SFD) and set the
+	 * Timer Increment reg to 40 ns to be used as a 25 MHz internal clock.
+	 */
+	ret = oa_tc6_write_register(priv->tc6, LAN865X_REG_MAC_TSU_TIMER_INCR,

drivers/net/ethernet/microchip/lan865x/lan865x.c static int lan865x_probe(struct spi_device *spi) · line 370

Quoted 10 lines
drivers/net/ethernet/microchip/lan865x/lan865x.c +7 -0
+				    MAC_TSU_TIMER_INCR_COUNT_NANOSECONDS);
+	if (ret) {
+		dev_err(&spi->dev, "Failed to config TSU Timer Incr reg: %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
#4 lore raw
In reply to Parthiban Veerasooran
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Mon, 18 Aug 2025 11:35:12 +0530 you wrote:

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.

Quoted 1 line

[...]

Here is the summary with links:
- [net,v2,1/2] microchip: lan865x: fix missing netif_start_queue() call on device open

    https://git.kernel.org/netdev/net/c/1683fd1b2fa7
  - [net,v2,2/2] microchip: lan865x: fix missing Timer Increment config for Rev.B0/B1
    https://git.kernel.org/netdev/net/c/2cd58fec912a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html