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:
Manu Gautam <mgautam@codeaurora.org>
Loading
Please register or sign in to comment