Re: [PATCH net-next v12 0/5] Add Ethernet MAC support for SpacemiT K1
From: Vivian Wang <hidden>
Date: 2025-09-19 08:55:18
Also in:
linux-devicetree, linux-riscv, lkml, spacemit
Hi Marek, Thanks for the testing. On 9/19/25 16:27, Marek Szyprowski wrote:
Hi All, On 14.09.2025 06:23, Vivian Wang wrote:quoted
SpacemiT K1 has two gigabit Ethernet MACs with RGMII and RMII support. Add devicetree bindings, driver, and DTS for it. Tested primarily on BananaPi BPI-F3. Basic TX/RX functionality also tested on Milk-V Jupiter. I would like to note that even though some bit field names superficially resemble that of DesignWare MAC, all other differences point to it in fact being a custom design. Based on SpacemiT drivers [1]. These patches are also available at: https://github.com/dramforever/linux/tree/k1/ethernet/v12 [1]: https://github.com/spacemit-com/linux-k1xThis driver recently landed in linux-next as commit bfec6d7f2001 ("net: spacemit: Add K1 Ethernet MAC"). In my tests I found that it triggers lock dep warnings related to stats_lock acquisition. In the current code it is being acquired with spin_lock(). For tests I've changed that to spin_lock_irqsave() and the warnings went away, but I'm not sure that this is the proper fix. I've also checked the driver history and 'irqsave' locking was used in pre-v7 version, but it was removed later on Jakub's request and described a bit misleading as "Removed scoped_guard usage".
Oops, I had assumed that irqsave was unnecessary and missed that the statistics functions are called with softirq enabled during register_netdev. The ones called at probe time should be changed to _irqsave or some other variant. I'll take a look at the details myself and send a fix. Thanks, Vivian "dramforever" Wang