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

Commit 92afedd6 authored by Pratham Pratap's avatar Pratham Pratap Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: gsi: Avoid spinlock lockup



In this case gsi_ctrl_clear_cpkt_queues function is called
which is holding spinlock and in the meantime dwc3_interrupt
occurred which in turn is calling gsi_ctrl_clear_cpkt_queues
function and it is trying to acquire the same spinlock causing
lockup.

This change disables the interrupts when spinlock is acquired
in gsi_ctrl_clear_cpkt_queues function.

Change-Id: Ia87a0a283ca6b6298083dddb448e4d649a4f8e89
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent 845885a8
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1282,8 +1282,9 @@ static void gsi_ctrl_clear_cpkt_queues(struct f_gsi *gsi, bool skip_req_q)
{
	struct gsi_ctrl_pkt *cpkt = NULL;
	struct list_head *act, *tmp;
	unsigned long flags;

	spin_lock(&gsi->c_port.lock);
	spin_lock_irqsave(&gsi->c_port.lock, flags);
	if (skip_req_q)
		goto clean_resp_q;

@@ -1298,7 +1299,7 @@ clean_resp_q:
		list_del(&cpkt->list);
		gsi_ctrl_pkt_free(cpkt);
	}
	spin_unlock(&gsi->c_port.lock);
	spin_unlock_irqrestore(&gsi->c_port.lock, flags);
}

static int gsi_ctrl_send_cpkt_tomodem(struct f_gsi *gsi, void *buf, size_t len)