]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc3: gadget: Avoid duplicate requests to enable Run/Stop
authorWesley Cheng <quic_wcheng@quicinc.com>
Thu, 28 Jul 2022 02:06:47 +0000 (19:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:04:00 +0000 (11:04 +0200)
commit8e83dc2774dd97f32da5c821b945a8841918a628
treecd3b06a519a1b24f329cea2005008f22701f8a2c
parent7ba078ee0cf31968119b8652fa824f764a207f01
usb: dwc3: gadget: Avoid duplicate requests to enable Run/Stop

[ Upstream commit 0de388795d22892c9c3581ed4c79cd6e1ed1b5b3 ]

Relocate the pullups_connected check until after it is ensured that there
are no runtime PM transitions.  If another context triggered the DWC3
core's runtime resume, it may have already enabled the Run/Stop.  Do not
re-run the entire pullup sequence again, as it may issue a core soft
reset while Run/Stop is already set.

This patch depends on
  commit 085d4d9094fd ("usb: dwc3: gadget: Prevent repeat pullup()")

Fixes: 2cf53105b1a8 ("usb: dwc3: gadget: Allow runtime suspend if UDC unbinded")
Cc: stable <stable@kernel.org>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220728020647.9377-1-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc3/gadget.c