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

Commit 3b8635c8 authored by Manu Gautam's avatar Manu Gautam
Browse files

USB: gadget: u_bam_data: Bail out from disconnect_w if connect pending



By the time disconnect_work started running if USB state changed
to connect then bail out to avoid following scenario:

1. bam_data_connect
	->ep_enable
2. 				connect_work started
					..
3. bam_data_disconnect			..
	->ep_disable			..
					..
4. bam_data_connect			..
	->ep_enable			..
					..
			  	 	->start_rx/tx (ep_queue) SUCCESS

5.				disconnect_work started/ended

6.				connect_work started
					->ep_queue 		 FAILS!!

This change avoids going through step-5 and 6 as USB<->IPA
connection is already setup and no need to tear it down and
only to realize late that ep_queue fails eventually on connect
as request was never dequeued. Also, data stall happens
as driver reconnects BAM pipes and IPA while usb-request
remains queued without restarting data transfers with controller/DBM.

Change-Id: I84a1b4833f3c0283d441766dba86f75c7ac93194
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent e701f80b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment