Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02c2e621 authored by Sujeev Dias's avatar Sujeev Dias Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarSujeev Dias <sdias@codeaurora.org>
parent b8a075a8
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -493,13 +493,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);