Skip to contentSkip to conversation

infiniband:qplib_fp:move spin_lock_bh to spin_lock in tasklet

PATCH In review Jeff Xie 2 participants 3 messages Mar 19, 2019 – Mar 20, 2019

Subsystems (2)
lore
Share & tools
lore

Jeff Xie

author
#0 lore raw

PATCH 1/1 infiniband:qplib_fp:move spin_lock_bh to spin_lock in tasklet

It is unnecessary to call spin_lock_bh in a tasklet.

---
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +2 -2
index 71c34d5..e2541c9 100644
@@ -273,14 +273,14 @@ static void bnxt_qplib_service_nq(unsigned long data)
 						     << 32;
 			cq = (struct bnxt_qplib_cq *)(unsigned long)q_handle;
 			bnxt_qplib_arm_cq_enable(cq);
-			spin_lock_bh(&cq->compl_lock);
+			spin_lock(&cq->compl_lock);
 			atomic_set(&cq->arm_state, 0);
 			if (!nq->cqn_handler(nq, (cq)))
 				num_cqne_processed++;
 			else
 				dev_warn(&nq->pdev->dev,
 					 "cqn - type 0x%x not handled\n", type);
-			spin_unlock_bh(&cq->compl_lock);
+			spin_unlock(&cq->compl_lock);
 			break;
 		}
 		case NQ_BASE_TYPE_SRQ_EVENT:
Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · Jeff Xie

It is unnecessary to call spin_lock_bh in a tasklet.

---
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I'm curious, how did you prove this was always in a tasklet?

Jason

author
#2 lore raw

It was only called in the tasklet context.

root@jeff:~/git/linux-next# git grep -in  bnxt_qplib_service_nq
drivers/infiniband/hw/bnxt_re/qplib_fp.c:236:static void
bnxt_qplib_service_nq(unsigned long data)
drivers/infiniband/hw/bnxt_re/qplib_fp.c:390:
tasklet_init(&nq->worker, bnxt_qplib_service_nq,

thanks.

Quoted 12 lines · Jason Gunthorpe <[email protected]> 于2019年3月20日周三 上午3:22写道:
Quoted 6 lines · Jeff Xie

It is unnecessary to call spin_lock_bh in a tasklet.

---
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I'm curious, how did you prove this was always in a tasklet?

Jason

Signature · 1 line
jeff