]> git.baikalelectronics.ru Git - kernel.git/commit
net: Correct wrong BH disable in hard-interrupt.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 16 Feb 2022 17:50:46 +0000 (18:50 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 23 Feb 2022 16:04:27 +0000 (08:04 -0800)
commit1a8fa62a8bd017061241410b5103c9ef2cce0ad8
tree4cc4c7db171bf68db80a02f856762690fb7cb5a9
parentdd02b19f2fb0bcaf723eede090a5aea6d0e7b475
net: Correct wrong BH disable in hard-interrupt.

I missed the obvious case where netif_ix() is invoked from hard-IRQ
context.

Disabling bottom halves is only needed in process context. This ensures
that the code remains on the current CPU and that the soft-interrupts
are processed at local_bh_enable() time.
In hard- and soft-interrupt context this is already the case and the
soft-interrupts will be processed once the context is left (at irq-exit
time).

Disable bottom halves if neither hard-interrupts nor soft-interrupts are
disabled. Update the kernel-doc, mention that interrupts must be enabled
if invoked from process context.

Fixes: 43ad27a5b2bf3 ("net: dev: Makes sure netif_rx() can be invoked in any context.")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/Yg05duINKBqvnxUc@linutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/dev.c