netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] Fixes on the Microchip's LAN865x driver
@ 2025-08-18  6:05 Parthiban Veerasooran
  2025-08-18  6:05 ` [PATCH net v2 1/2] microchip: lan865x: fix missing netif_start_queue() call on device open Parthiban Veerasooran
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Parthiban Veerasooran @ 2025-08-18  6:05 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Parthiban Veerasooran

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
-- 
2.34.1


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

* [PATCH net v2 1/2] microchip: lan865x: fix missing netif_start_queue() call on device open
  2025-08-18  6:05 [PATCH net v2 0/2] Fixes on the Microchip's LAN865x driver Parthiban Veerasooran
@ 2025-08-18  6:05 ` Parthiban Veerasooran
  2025-08-18  6:05 ` [PATCH net v2 2/2] microchip: lan865x: fix missing Timer Increment config for Rev.B0/B1 Parthiban Veerasooran
  2025-08-20  3:11 ` [PATCH net v2 0/2] Fixes on the Microchip's LAN865x driver patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Parthiban Veerasooran @ 2025-08-18  6:05 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Parthiban Veerasooran

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


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

* [PATCH net v2 2/2] microchip: lan865x: fix missing Timer Increment config for Rev.B0/B1
  2025-08-18  6:05 [PATCH net v2 0/2] Fixes on the Microchip's LAN865x driver Parthiban Veerasooran
  2025-08-18  6:05 ` [PATCH net v2 1/2] microchip: lan865x: fix missing netif_start_queue() call on device open Parthiban Veerasooran
@ 2025-08-18  6:05 ` Parthiban Veerasooran
  2025-08-18 11:06   ` Vadim Fedorenko
  2025-08-20  3:11 ` [PATCH net v2 0/2] Fixes on the Microchip's LAN865x driver patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Parthiban Veerasooran @ 2025-08-18  6:05 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, 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).

Link: 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>
---
 .../net/ethernet/microchip/lan865x/lan865x.c  | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
index d03f5a8de58d..84c41f193561 100644
--- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
+++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
@@ -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
-- 
2.34.1


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

* Re: [PATCH net v2 2/2] microchip: lan865x: fix missing Timer Increment config for Rev.B0/B1
  2025-08-18  6:05 ` [PATCH net v2 2/2] microchip: lan865x: fix missing Timer Increment config for Rev.B0/B1 Parthiban Veerasooran
@ 2025-08-18 11:06   ` Vadim Fedorenko
  0 siblings, 0 replies; 5+ messages in thread
From: Vadim Fedorenko @ 2025-08-18 11:06 UTC (permalink / raw)
  To: Parthiban Veerasooran, andrew+netdev, davem, edumazet, kuba,
	pabeni
  Cc: netdev, linux-kernel

On 18/08/2025 07:05, Parthiban Veerasooran wrote:
> 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).
> 
> Link: 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>
> ---
>   .../net/ethernet/microchip/lan865x/lan865x.c  | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
> 
> diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> index d03f5a8de58d..84c41f193561 100644
> --- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
> +++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> @@ -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

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

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

* Re: [PATCH net v2 0/2] Fixes on the Microchip's LAN865x driver
  2025-08-18  6:05 [PATCH net v2 0/2] Fixes on the Microchip's LAN865x driver Parthiban Veerasooran
  2025-08-18  6:05 ` [PATCH net v2 1/2] microchip: lan865x: fix missing netif_start_queue() call on device open Parthiban Veerasooran
  2025-08-18  6:05 ` [PATCH net v2 2/2] microchip: lan865x: fix missing Timer Increment config for Rev.B0/B1 Parthiban Veerasooran
@ 2025-08-20  3:11 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-20  3:11 UTC (permalink / raw)
  To: Parthiban Veerasooran
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel, parthiban.veerasooran

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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.
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-08-20  3:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18  6:05 [PATCH net v2 0/2] Fixes on the Microchip's LAN865x driver Parthiban Veerasooran
2025-08-18  6:05 ` [PATCH net v2 1/2] microchip: lan865x: fix missing netif_start_queue() call on device open Parthiban Veerasooran
2025-08-18  6:05 ` [PATCH net v2 2/2] microchip: lan865x: fix missing Timer Increment config for Rev.B0/B1 Parthiban Veerasooran
2025-08-18 11:06   ` Vadim Fedorenko
2025-08-20  3:11 ` [PATCH net v2 0/2] Fixes on the Microchip's LAN865x driver patchwork-bot+netdevbpf

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