Skip to content

Commit 77bdaf3

Browse files
HoratiuVulturdavem330
authored andcommitted
net: lan966x: Fix sleep in atomic context when updating MAC table
The 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. Fixes: e18aba8 ("net: lan966x: add mactable support") Signed-off-by: Horatiu Vultur <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b6ab149 commit 77bdaf3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/net/ethernet/microchip/lan966x/lan966x_mac.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ static int lan966x_mac_wait_for_completion(struct lan966x *lan966x)
4040
{
4141
u32 val;
4242

43-
return readx_poll_timeout(lan966x_mac_get_status,
44-
lan966x, val,
45-
(ANA_MACACCESS_MAC_TABLE_CMD_GET(val)) ==
46-
MACACCESS_CMD_IDLE,
47-
TABLE_UPDATE_SLEEP_US, TABLE_UPDATE_TIMEOUT_US);
43+
return readx_poll_timeout_atomic(lan966x_mac_get_status,
44+
lan966x, val,
45+
(ANA_MACACCESS_MAC_TABLE_CMD_GET(val)) ==
46+
MACACCESS_CMD_IDLE,
47+
TABLE_UPDATE_SLEEP_US,
48+
TABLE_UPDATE_TIMEOUT_US);
4849
}
4950

5051
static void lan966x_mac_select(struct lan966x *lan966x,

0 commit comments

Comments
 (0)