netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netpoll: don't require irqs disabled in rt kernels
@ 2021-05-31 15:23 wander
  2021-06-01 22:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: wander @ 2021-05-31 15:23 UTC (permalink / raw)
  Cc: linux-rt-users, bigeasy, tglx, rostedt, Wander Lairson Costa,
	David S. Miller, Jakub Kicinski, Florian Fainelli, Andrew Lunn,
	Vladimir Oltean, netdev, linux-kernel

From: Wander Lairson Costa <wander@redhat.com>

write_msg(netconsole.c:836) calls netpoll_send_udp after a call to
spin_lock_irqsave, which normally disables interrupts; but in PREEMPT_RT
this call just locks an rt_mutex without disabling irqs. In this case,
netpoll_send_udp is called with interrupts enabled.

Signed-off-by: Wander Lairson Costa <wander@redhat.com>
---
 net/core/netpoll.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index c310c7c1cef7..0a6b04714558 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -36,6 +36,7 @@
 #include <net/ip6_checksum.h>
 #include <asm/unaligned.h>
 #include <trace/events/napi.h>
+#include <linux/kconfig.h>
 
 /*
  * We maintain a small pool of fully-sized skbs, to make sure the
@@ -389,7 +390,8 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
 	static atomic_t ip_ident;
 	struct ipv6hdr *ip6h;
 
-	WARN_ON_ONCE(!irqs_disabled());
+	if (!IS_ENABLED(CONFIG_PREEMPT_RT))
+		WARN_ON_ONCE(!irqs_disabled());
 
 	udp_len = len + sizeof(*udph);
 	if (np->ipv6)
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] netpoll: don't require irqs disabled in rt kernels
  2021-05-31 15:23 [PATCH] netpoll: don't require irqs disabled in rt kernels wander
@ 2021-06-01 22:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-01 22:20 UTC (permalink / raw)
  To: None
  Cc: linux-rt-users, bigeasy, tglx, rostedt, davem, kuba, f.fainelli,
	andrew, vladimir.oltean, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Mon, 31 May 2021 12:23:23 -0300 you wrote:
> From: Wander Lairson Costa <wander@redhat.com>
> 
> write_msg(netconsole.c:836) calls netpoll_send_udp after a call to
> spin_lock_irqsave, which normally disables interrupts; but in PREEMPT_RT
> this call just locks an rt_mutex without disabling irqs. In this case,
> netpoll_send_udp is called with interrupts enabled.
> 
> [...]

Here is the summary with links:
  - netpoll: don't require irqs disabled in rt kernels
    https://git.kernel.org/netdev/net-next/c/b0f6c9ac8088

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-01 22:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-31 15:23 [PATCH] netpoll: don't require irqs disabled in rt kernels wander
2021-06-01 22:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).