usb: dwc3: dwc3-msm-core: Mark dwc3 core device as syscore device

During PM suspend, due to lack of proper prepare/complete PM
callbacks in the device chain, the direct_complete parameter used to
skip the PM suspend/resume callbacks for the DWC3 core device. During
hibernation, direct_complete parameter is set to false and hence
dwc3 PM resume is being called during thaw operation, while dwc3 msm
is not PM resumed. This results in accessing registers which leads
unclocked access. Fix it by marking dwc3 core device as syscore device
to skip dwc3 PM suspend/resume during hibernation entry/exit.

Change-Id: I8b8b8cd28f4a323b989745553ec3fce75209ecaf
Signed-off-by: Vijayavardhan Vennapusa <quic_vvreddy@quicinc.com>
This commit is contained in:
Vijayavardhan Vennapusa 2023-05-19 15:21:46 +05:30 committed by Sriram Dash
parent 2ec3a5a740
commit b590bfd39b

View File

@ -564,6 +564,7 @@ struct dwc3_msm {
#define PWR_EVENT_HS_WAKEUP BIT(1)
bool host_poweroff_in_pm_suspend;
bool disable_host_ssphy_powerdown;
bool hibernate_skip_thaw;
unsigned long lpm_flags;
unsigned int vbus_draw;
#define MDWC3_SS_PHY_SUSPEND BIT(0)
@ -5814,6 +5815,8 @@ static int dwc3_msm_core_init(struct dwc3_msm *mdwc)
goto depopulate;
dwc3_msm_override_pm_ops(dwc->dev, mdwc->dwc3_pm_ops, false);
if (mdwc->hibernate_skip_thaw)
dev_pm_syscore_device(dwc->dev, true);
mdwc->xhci_pm_ops = kzalloc(sizeof(struct dev_pm_ops), GFP_ATOMIC);
if (!mdwc->xhci_pm_ops)
@ -5997,6 +6000,9 @@ static int dwc3_msm_parse_params(struct dwc3_msm *mdwc, struct device_node *node
mdwc->disable_host_ssphy_powerdown = of_property_read_bool(node,
"qcom,disable-host-ssphy-powerdown");
mdwc->hibernate_skip_thaw = of_property_read_bool(node,
"qcom,hibernate-skip-thaw");
mdwc->dis_sending_cm_l1_quirk = of_property_read_bool(node,
"qcom,dis-sending-cm-l1-quirk");