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

Commit bc91401c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cnss: Set D3hot state only after saving config space"

parents de79845d f4c64019
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3046,6 +3046,10 @@ int cnss_auto_suspend(void)
	if (penv->pcie_link_state) {
		pci_save_state(pdev);
		penv->saved_state = pci_store_saved_state(pdev);
		pci_disable_device(pdev);
		ret = pci_set_power_state(pdev, PCI_D3hot);
		if (ret)
			pr_err("%s: Set D3Hot failed: %d\n", __func__, ret);
		if (msm_pcie_pm_control(MSM_PCIE_SUSPEND,
			cnss_get_pci_dev_bus_number(pdev),
			pdev, NULL, PM_OPTIONS)) {
@@ -3081,6 +3085,9 @@ int cnss_auto_resume(void)
			ret = -EAGAIN;
			goto out;
		}
		ret = pci_enable_device(pdev);
		if (ret)
			pr_err("%s: enable device failed: %d\n", __func__, ret);
		penv->pcie_link_state = PCIE_LINK_UP;
	}

@@ -3089,6 +3096,7 @@ int cnss_auto_resume(void)
			&penv->saved_state);

	pci_restore_state(pdev);
	pci_set_master(pdev);

	atomic_set(&penv->auto_suspended, 0);
out: