Commit 04614302 authored by Prashanth K's avatar Prashanth K Committed by Todd Kjos
Browse files

UPSTREAM: usb: dwc3: fix gadget mode suspend interrupt handler issue



When work in gadget mode, currently driver doesn't update software level
link_state correctly as link state change event is not enabled for most
devices, in function dwc3_gadget_suspend_interrupt(), it will only pass
suspend event to UDC core when software level link state changes, so when
interrupt generated in sequences of suspend -> reset -> conndone ->
suspend, link state is not updated during reset and conndone, so second
suspend interrupt event will not pass to UDC core.

Remove link_state compare in dwc3_gadget_suspend_interrupt() and add a
suspended flag to replace the compare function.

Fixes: 799e9dc8 ("usb: dwc3: gadget: conditionally disable Link State change events")
Cc: stable <stable@kernel.org>
Acked-by: default avatarThinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: default avatarLinyu Yuan <quic_linyyuan@quicinc.com>
Link: https://lore.kernel.org/r/20230512004524.31950-1-quic_linyyuan@quicinc.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 283221152
(cherry picked from commit 4e8ef34e
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/

 usb-linus)

Signed-off-by: default avatarPrashanth K <quic_prashk@quicinc.com>
Change-Id: Iaaf34456136e873f1ce5a8fa573f40e22873f2c4
parent 8faa860f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment