usb: gadget: Fix mismatched function wake notification
When the device wants to wake up a function while the bus
is in U3, it requires that it wakes up the bus into U0
before sending the function wake notification.
Currently, our logic is as below...consider a 2 interface
composition as an example:
1. Interface#1 needs to send something to host after the
function was suspended (FUNC_SUSPEND(3))
2. Calls usb_func_wakeup() to attempt to notify function wake
3. Since bus is in U3, issue wakeup to transistion bus to U0
4. Once receiving link state change event into U0, we will
call composite_resume()
5. Composite_resume() will queue the function wake
for the FIRST interface as well that has function remote
wakeup enabled and function suspended(ie if both
interfaces#0 and #1 can wake up the function, then it will
ALWAYS send it for interface#0).
So even though interface#1 generated the function wakeup sequence, the
SW currently sends it for interface#0.
Fix this by using the func_wakeup_pending flag and initiate
the function wakeup only if function wakeup is pending
for that specific function.
CRs-Fixed: 2122935
Change-Id: I4776912fb9f8569d4d39007d68e1afafcb0dce43
Signed-off-by:
Sriharsha Allenki <sallenki@codeaurora.org>
Loading
Please register or sign in to comment