Skip to content

Commit 1a82d19

Browse files
NikAleksandrovPaolo Abeni
authored andcommitted
be2net: fix sleeping while atomic bugs in be_ndo_bridge_getlink
Partially revert commit b717241 ("be2net: replace polling with sleeping in the FW completion path") w.r.t mcc mutex it introduces and the use of usleep_range. The be2net be_ndo_bridge_getlink() callback is called with rcu_read_lock, so this code has been broken for a long time. Both the mutex_lock and the usleep_range can cause the issue Ian Kumlien reported[1]. The call path is: be_ndo_bridge_getlink -> be_cmd_get_hsw_config -> be_mcc_notify_wait -> be_mcc_wait_compl -> usleep_range() [1] https://lore.kernel.org/netdev/CAA85sZveppNgEVa_FD+qhOMtG_AavK9_mFiU+jWrMtXmwqefGA@mail.gmail.com/ Tested-by: Ian Kumlien <ian.kumlien@gmail.com> Fixes: b717241 ("be2net: replace polling with sleeping in the FW completion path") Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org> Link: https://patch.msgid.link/20250227164129.1201164-1-razor@blackwall.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 64e6a75 commit 1a82d19

File tree

3 files changed

+100
-101
lines changed

3 files changed

+100
-101
lines changed

drivers/net/ethernet/emulex/benet/be.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ struct be_adapter {
562562
struct be_dma_mem mbox_mem_alloced;
563563

564564
struct be_mcc_obj mcc_obj;
565-
struct mutex mcc_lock; /* For serializing mcc cmds to BE card */
565+
spinlock_t mcc_lock; /* For serializing mcc cmds to BE card */
566566
spinlock_t mcc_cq_lock;
567567

568568
u16 cfg_num_rx_irqs; /* configured via set-channels */

0 commit comments

Comments
 (0)