net: lan966x: Fixes for sleep in atomic context
Subsystems (3)
Horatiu Vultur
maintainerv2 cover net: lan966x: Fixes for sleep in atomic context
This patch series contains 2 fixes for lan966x that is sleeping in atomic context. The first patch fixes the injection of the frames while the second one fixes the updating of the MAC table.
v1->v2:
- correct the fix tag in the second patch, it was using the wrong sha.
Horatiu Vultur (2):
net: lan966x: Fix sleep in atomic context when injecting frames
net: lan966x: Fix sleep in atomic context when updating MAC table
drivers/net/ethernet/microchip/lan966x/lan966x_mac.c | 11 ++++++----- drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-)
Signature · 1 line
2.33.0
Horatiu Vultur
maintainerPATCH v2 1/2 net: lan966x: Fix sleep in atomic context when injecting frames
On lan966x, when injecting a frame it was polling the register QS_INJ_STATUS to see if it can continue with the injection of the frame. The problem was that it was using readx_poll_timeout which could sleep in atomic context.
This patch fixes this issue by using readx_poll_timeout_atomic.
--- drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/microchip/lan966x/lan966x_main.c +3 -3
@@ -183,9 +183,9 @@ static int lan966x_port_inj_ready(struct lan966x *lan966x, u8 grp) {u32 val; -return readx_poll_timeout (lan966x_port_inj_status, lan966x, val, -QS_INJ_STATUS_FIFO_RDY_GET (val) &BIT (grp), -READL_SLEEP_US ,READL_TIMEOUT_US ); +return readx_poll_timeout_atomic (lan966x_port_inj_status, lan966x, val, +QS_INJ_STATUS_FIFO_RDY_GET (val) &BIT (grp), +READL_SLEEP_US ,READL_TIMEOUT_US ); } static int lan966x_port_ifh_xmit(struct sk_buff *skb,
Signature · 1 line
2.33.0
Horatiu Vultur
maintainerPATCH v2 2/2 net: lan966x: Fix sleep in atomic context when updating MAC table
In reply to Horatiu VulturThe function lan966x_mac_wait_for_completion is used to poll the status of the MAC table using the function readx_poll_timeout. The problem with this function is that is called also from atomic context. Therefore update the function to use readx_poll_timeout_atomic.
--- drivers/net/ethernet/microchip/lan966x/lan966x_mac.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/ethernet/microchip/lan966x/lan966x_mac.c +6 -5
@@ -40,11 +40,12 @@ static int lan966x_mac_wait_for_completion(struct lan966x *lan966x) {u32 val; -return readx_poll_timeout (lan966x_mac_get_status, - lan966x, val, - (ANA_MACACCESS_MAC_TABLE_CMD_GET (val)) == -MACACCESS_CMD_IDLE , -TABLE_UPDATE_SLEEP_US ,TABLE_UPDATE_TIMEOUT_US ); +return readx_poll_timeout_atomic (lan966x_mac_get_status, + lan966x, val, + (ANA_MACACCESS_MAC_TABLE_CMD_GET (val)) == +MACACCESS_CMD_IDLE , +TABLE_UPDATE_SLEEP_US , +TABLE_UPDATE_TIMEOUT_US ); } static void lan966x_mac_select(struct lan966x *lan966x,
Signature · 1 line
2.33.0
This series was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This series was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Quoted 8 lines · On Tue, 25 Jan 2022 12:48:14 +0100 you wrote:
This patch series contains 2 fixes for lan966x that is sleeping in atomic context. The first patch fixes the injection of the frames while the second one fixes the updating of the MAC table.
v1->v2:
- correct the fix tag in the second patch, it was using the wrong sha.[...]
Here is the summary with links:
- [net,v2,1/2] net: lan966x: Fix sleep in atomic context when injecting frames
https://git.kernel.org/netdev/net/c/b6ab149654ef - [net,v2,2/2] net: lan966x: Fix sleep in atomic context when updating MAC table https://git.kernel.org/netdev/net/c/77bdaf39f3c8
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html