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

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

usb: gadget: cdev: Requeue the request outside spinlock



'Commit I87015f00267af ("usb: gadget: cdev: Requeue the request in
cser_resume if start_rx fails")' is requeuing the request in if
start_rx fails as dut is in suspend mode. This needs to done outside
of spinlock as usb_cser_start_rx will again acquire the port_lock to
queue the request causing a deadlock condition.

Fix this by requeuing the request outside the spinlock.

Change-Id: Ifa1cdb338d6a7e6a2d98ced55c4dbca9caf6ba0e
Signed-off-by: default avatarPratham Pratap <quic_ppratap@quicinc.com>
parent d5088814
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -573,7 +573,9 @@ static void usb_cser_resume(struct usb_function *f)
	if (port->setup_pending) {
		pr_info("%s: start_rx called due to rx_out error.\n", __func__);
		port->setup_pending = false;
		spin_unlock_irqrestore(&port->port_lock, flags);
		usb_cser_start_rx(port);
		spin_lock_irqsave(&port->port_lock, flags);
	}
	in = port->port_usb.in;
	/* process any pending requests */