Skip to content

Commit 51f27be

Browse files
committed
Merge branch 'fixes-on-the-microchip-s-lan865x-driver'
Parthiban Veerasooran says: ==================== 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. ==================== Link: https://patch.msgid.link/20250818060514.52795-1-parthiban.veerasooran@microchip.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 4f953be + 2cd58fe commit 51f27be

File tree

1 file changed

+21
-0
lines changed
  • drivers/net/ethernet/microchip/lan865x

1 file changed

+21
-0
lines changed

drivers/net/ethernet/microchip/lan865x/lan865x.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
/* MAC Specific Addr 1 Top Reg */
3333
#define LAN865X_REG_MAC_H_SADDR1 0x00010023
3434

35+
/* MAC TSU Timer Increment Register */
36+
#define LAN865X_REG_MAC_TSU_TIMER_INCR 0x00010077
37+
#define MAC_TSU_TIMER_INCR_COUNT_NANOSECONDS 0x0028
38+
3539
struct lan865x_priv {
3640
struct work_struct multicast_work;
3741
struct net_device *netdev;
@@ -311,6 +315,8 @@ static int lan865x_net_open(struct net_device *netdev)
311315

312316
phy_start(netdev->phydev);
313317

318+
netif_start_queue(netdev);
319+
314320
return 0;
315321
}
316322

@@ -344,6 +350,21 @@ static int lan865x_probe(struct spi_device *spi)
344350
goto free_netdev;
345351
}
346352

353+
/* LAN865x Rev.B0/B1 configuration parameters from AN1760
354+
* As per the Configuration Application Note AN1760 published in the
355+
* link, https://www.microchip.com/en-us/application-notes/an1760
356+
* Revision F (DS60001760G - June 2024), configure the MAC to set time
357+
* stamping at the end of the Start of Frame Delimiter (SFD) and set the
358+
* Timer Increment reg to 40 ns to be used as a 25 MHz internal clock.
359+
*/
360+
ret = oa_tc6_write_register(priv->tc6, LAN865X_REG_MAC_TSU_TIMER_INCR,
361+
MAC_TSU_TIMER_INCR_COUNT_NANOSECONDS);
362+
if (ret) {
363+
dev_err(&spi->dev, "Failed to config TSU Timer Incr reg: %d\n",
364+
ret);
365+
goto oa_tc6_exit;
366+
}
367+
347368
/* As per the point s3 in the below errata, SPI receive Ethernet frame
348369
* transfer may halt when starting the next frame in the same data block
349370
* (chunk) as the end of a previous frame. The RFA field should be

0 commit comments

Comments
 (0)