https://github.com/torvalds/linux
Revision bf5a6b4c474c589244dc25ee1af2c3c829228ef8 authored by Salil Mehta on 07 November 2019, 17:09:53 UTC, committed by David S. Miller on 08 November 2019, 00:12:15 UTC
This patch fixes the problem of the spin locks, originally meant for the netpoll path of hns driver, causing deadlock in the normal NAPI poll path. The issue happened due to the presence of the stray leftover spin lock code related to the netpoll, whose support was earlier removed from the HNS[1], got activated due to enabling of NET_POLL_CONTROLLER switch. Earlier background: The netpoll handling code originally had this bug(as identified by Marc Zyngier[2]) of wrong spin lock API being used which did not disable the interrupts and hence could cause locking issues. i.e. if the lock were first acquired in context to thread like 'ip' util and this lock if ever got later acquired again in context to the interrupt context like TX/RX (Interrupts could always pre-empt the lock holding task and acquire the lock again) and hence could cause deadlock. Proposed Solution: 1. If the netpoll was enabled in the HNS driver, which is not right now, we could have simply used spin_[un]lock_irqsave() 2. But as netpoll is disabled, therefore, it is best to get rid of the existing locks and stray code for now. This should solve the problem reported by Marc. [1] https://git.kernel.org/torvalds/c/4bd2c03be7 [2] https://patchwork.ozlabs.org/patch/1189139/ Fixes: 4bd2c03be707 ("net: hns: remove ndo_poll_controller") Cc: lipeng <lipeng321@huawei.com> Cc: Yisen Zhuang <yisen.zhuang@huawei.com> Cc: Eric Dumazet <edumazet@google.com> Cc: David S. Miller <davem@davemloft.net> Reported-by: Marc Zyngier <maz@kernel.org> Acked-by: Marc Zyngier <maz@kernel.org> Tested-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Salil Mehta <salil.mehta@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e497df6
Tip revision: bf5a6b4c474c589244dc25ee1af2c3c829228ef8 authored by Salil Mehta on 07 November 2019, 17:09:53 UTC
net: hns: Fix the stray netpoll locks causing deadlock in NAPI path
net: hns: Fix the stray netpoll locks causing deadlock in NAPI path
Tip revision: bf5a6b4
File | Mode | Size |
---|---|---|
.gitignore | -rw-r--r-- | 44 bytes |
Kconfig | -rw-r--r-- | 3.4 KB |
Makefile | -rw-r--r-- | 4.1 KB |
blacklist.c | -rw-r--r-- | 3.8 KB |
blacklist.h | -rw-r--r-- | 84 bytes |
blacklist_hashes.c | -rw-r--r-- | 166 bytes |
blacklist_nohashes.c | -rw-r--r-- | 122 bytes |
system_certificates.S | -rw-r--r-- | 828 bytes |
system_keyring.c | -rw-r--r-- | 8.7 KB |
Computing file changes ...