Merge tag 'asm-generic-unaligned-5.14' of git://git.kernel.org/pub/scm/linux/kernel...
[platform/kernel/linux-starfive.git] / net / core / netpoll.c
index 9c49a38..edfc0f8 100644 (file)
@@ -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)