Skip to content

Commit

Permalink
usb: dwc2: Prevent core suspend when port connection flag is 0
Browse files Browse the repository at this point in the history
commit 93f6728 upstream.

In host mode port connection status flag is "0" when loading
the driver. After loading the driver system asserts suspend
which is handled by "_dwc2_hcd_suspend()" function. Before
the system suspend the port connection status is "0". As
result need to check the "port_connect_status" if it is "0",
then skipping entering to suspend.

Cc: <stable@vger.kernel.org> # 5.2
Fixes: 6f6d705 ("usb: dwc2: bus suspend/resume for hosts with DWC2_POWER_DOWN_PARAM_NONE")
Signed-off-by: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>
Link: https://lore.kernel.org/r/20210326102510.BDEDEA005D@mailhost.synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Artur Petrosyan authored and gregkh committed Apr 7, 2021
1 parent 7be498b commit 79b09e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/dwc2/hcd.c
Expand Up @@ -4322,7 +4322,8 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
if (hsotg->op_state == OTG_STATE_B_PERIPHERAL)
goto unlock;

if (hsotg->params.power_down > DWC2_POWER_DOWN_PARAM_PARTIAL)
if (hsotg->params.power_down != DWC2_POWER_DOWN_PARAM_PARTIAL ||
hsotg->flags.b.port_connect_status == 0)
goto skip_power_saving;

/*
Expand Down

0 comments on commit 79b09e4

Please sign in to comment.