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

Commit f92af786 authored by Manu Gautam's avatar Manu Gautam Committed by Sriharsha Allenki
Browse files

usb: gadget: f_mbim: Fix extra decrement of notify_count on resume



If usb_request for notification was already queued before bus_suspend
then re-queuing the same on bus_resume fails with -EBUSY. Driver
currently decrements notify_count on error making it negative. This
causes driver to always hold one notification which is sent later
when host send next command. Fix this by not decrementing notify_count
if func_ep_queue failed with -EBUSY.

CRs-fixed: 1028997
Change-Id: I88b298c96f01b4fca7ddd86e081a30ba2ae1d38b
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent fb61632d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -707,6 +707,8 @@ static void mbim_do_notify(struct f_mbim *mbim)
				req, GFP_ATOMIC);
		spin_lock(&mbim->lock);
		if (status) {
			/* ignore if request already queued before bus_resume */
			if (status != -EBUSY)
				atomic_dec(&mbim->not_port.notify_count);
			pr_err("Queue notify request failed, err: %d\n",
					status);