mhi: controller: always set link to D3Hot when powering off

Link must be in D3HOT prior to transitioning to D3Cold state,
otherwise endpoint device may transition into an error state.

CRs-Fixed: 2302001
Change-Id: I97da3be021bdf3232a1f791fb9813fec9e9d8ebd
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
This commit is contained in:
Sujeev Dias 2018-09-14 17:34:38 -07:00
parent 4595c0955b
commit da79c109fd

View File

@ -502,13 +502,15 @@ int mhi_arch_link_off(struct mhi_controller *mhi_cntrl, bool graceful)
arch_info->pcie_state = pci_store_saved_state(pci_dev);
pci_disable_device(pci_dev);
ret = pci_set_power_state(pci_dev, PCI_D3hot);
if (ret) {
MHI_ERR("Failed to set D3hot, ret:%d\n", ret);
return ret;
}
}
/*
* We will always attempt to put link into D3hot, however
* link down may have happened due to error fatal, so
* ignoring the return code
*/
pci_set_power_state(pci_dev, PCI_D3hot);
/* release the resources */
msm_pcie_pm_control(MSM_PCIE_SUSPEND, mhi_cntrl->bus, pci_dev, NULL, 0);
mhi_arch_set_bus_request(mhi_cntrl, 0);