]> git.itanic.dy.fi Git - linux-stable/commit
usb: dwc3: fix gadget mode suspend interrupt handler issue
authorLinyu Yuan <quic_linyyuan@quicinc.com>
Fri, 12 May 2023 00:45:24 +0000 (08:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 12:55:29 +0000 (13:55 +0100)
commitf19171155305332c57ec3ee020996a31384d9bcd
tree1ffb459fd1c1b5f3cd156c65015debb83ef5ea21
parent7919af1dcb8eae143d8e787086e1ab4f2083e1fd
usb: dwc3: fix gadget mode suspend interrupt handler issue

[ Upstream commit 4e8ef34e36f2839ef8c8da521ab7035956436818 ]

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: 799e9dc82968 ("usb: dwc3: gadget: conditionally disable Link State change events")
Cc: stable <stable@kernel.org>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
Link: https://lore.kernel.org/r/20230512004524.31950-1-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/gadget.c