Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce29d72c authored by Hoang-Nam Nguyen's avatar Hoang-Nam Nguyen Committed by Roland Dreier
Browse files

IB/ehca: Fix improper use of yield() with spinlock held

parent a20f3a6d
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -344,8 +344,11 @@ int ehca_destroy_cq(struct ib_cq *cq)
	unsigned long flags;
	unsigned long flags;


	spin_lock_irqsave(&ehca_cq_idr_lock, flags);
	spin_lock_irqsave(&ehca_cq_idr_lock, flags);
	while (my_cq->nr_callbacks)
	while (my_cq->nr_callbacks) {
		spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
		yield();
		yield();
		spin_lock_irqsave(&ehca_cq_idr_lock, flags);
	}


	idr_remove(&ehca_cq_idr, my_cq->token);
	idr_remove(&ehca_cq_idr, my_cq->token);
	spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
	spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);