Skip to content

Commit

Permalink
be2net: disable bh with spin_lock in be_process_mcc
Browse files Browse the repository at this point in the history
be_process_mcc() is invoked in 3 different places and
always with BHs disabled except the be_poll function
but since it's invoked from softirq with BHs
disabled it won't hurt.

v1->v2: added explanation to the patch
v2->v3: add a missing call from be_cmds.c

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Denis Kirjanov authored and davem330 committed Aug 6, 2019
1 parent debea2c commit d0d006a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/emulex/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ int be_process_mcc(struct be_adapter *adapter)
int num = 0, status = 0;
struct be_mcc_obj *mcc_obj = &adapter->mcc_obj;

spin_lock(&adapter->mcc_cq_lock);
spin_lock_bh(&adapter->mcc_cq_lock);

while ((compl = be_mcc_compl_get(adapter))) {
if (compl->flags & CQE_FLAGS_ASYNC_MASK) {
Expand All @@ -566,7 +566,7 @@ int be_process_mcc(struct be_adapter *adapter)
if (num)
be_cq_notify(adapter, mcc_obj->cq.id, mcc_obj->rearm_cq, num);

spin_unlock(&adapter->mcc_cq_lock);
spin_unlock_bh(&adapter->mcc_cq_lock);
return status;
}

Expand All @@ -581,9 +581,7 @@ static int be_mcc_wait_compl(struct be_adapter *adapter)
if (be_check_error(adapter, BE_ERROR_ANY))
return -EIO;

local_bh_disable();
status = be_process_mcc(adapter);
local_bh_enable();

if (atomic_read(&mcc_obj->q.used) == 0)
break;
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5630,9 +5630,7 @@ static void be_worker(struct work_struct *work)
* mcc completions
*/
if (!netif_running(adapter->netdev)) {
local_bh_disable();
be_process_mcc(adapter);
local_bh_enable();
goto reschedule;
}

Expand Down

0 comments on commit d0d006a

Please sign in to comment.