[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220125093024.121072-2-horatiu.vultur@microchip.com>
Date: Tue, 25 Jan 2022 10:30:23 +0100
From: Horatiu Vultur <horatiu.vultur@...rochip.com>
To: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <UNGLinuxDriver@...rochip.com>, <davem@...emloft.net>,
<kuba@...nel.org>, <f.fainelli@...il.com>,
<vivien.didelot@...il.com>, <vladimir.oltean@....com>,
<andrew@...n.ch>, Horatiu Vultur <horatiu.vultur@...rochip.com>
Subject: [PATCH net 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.
Fixes: d28d6d2e37d10d ("net: lan966x: add port module support")
Signed-off-by: Horatiu Vultur <horatiu.vultur@...rochip.com>
---
drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
index 0835be02f62b..42461af80ecb 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
@@ -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,
--
2.33.0
Powered by blists - more mailing lists