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

Commit aefe18a0 authored by Yan He's avatar Yan He
Browse files

msm: pcie: notify PCIe client when PCIe link resume fails



The PCIe link training during system resume may fail because the
PCIe endpoint could have crashed. Thus, notify the client driver
not to access the endpoint.

CRs-fixed: 668393
Change-Id: I56b008fa0ff6acafb7a6b29f3369c77143851706
Signed-off-by: default avatarYan He <yanhe@codeaurora.org>
parent ba751078
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ enum msm_pcie_event {
	MSM_PCIE_EVENT_LINKUP = 0x2,
	MSM_PCIE_EVENT_WAKEUP = 0x4,
	MSM_PCIE_EVENT_WAKE_RECOVERY = 0x8,
	MSM_PCIE_EVENT_NO_ACCESS = 0x10,
};

enum msm_pcie_trigger {
+26 −0
Original line number Diff line number Diff line
@@ -1840,6 +1840,19 @@ void msm_pcie_fixup_resume(struct pci_dev *dev)
				"PCIe: wait for wake IRQ to recover the link for RC%d\n",
				pcie_dev->rc_idx);
		}

		if (pcie_dev->event_reg && pcie_dev->event_reg->callback &&
			(pcie_dev->event_reg->events &
				MSM_PCIE_EVENT_NO_ACCESS)) {
			struct msm_pcie_notify *notify =
					&pcie_dev->event_reg->notify;
			notify->event = MSM_PCIE_EVENT_NO_ACCESS;
			notify->user = pcie_dev->event_reg->user;
			PCIE_DBG(
				"PCIe: notify client not to access the EP of RC%d\n",
				pcie_dev->rc_idx);
			pcie_dev->event_reg->callback(notify);
		}
	}

	mutex_unlock(&pcie_dev->recovery_lock);
@@ -1878,6 +1891,19 @@ void msm_pcie_fixup_resume_early(struct pci_dev *dev)
				"PCIe: wait for wake IRQ to recover the link for RC%d\n",
				pcie_dev->rc_idx);
		}

		if (pcie_dev->event_reg && pcie_dev->event_reg->callback &&
			(pcie_dev->event_reg->events &
				MSM_PCIE_EVENT_NO_ACCESS)) {
			struct msm_pcie_notify *notify =
					&pcie_dev->event_reg->notify;
			notify->event = MSM_PCIE_EVENT_NO_ACCESS;
			notify->user = pcie_dev->event_reg->user;
			PCIE_DBG(
				"PCIe: notify client not to access the EP of RC%d\n",
				pcie_dev->rc_idx);
			pcie_dev->event_reg->callback(notify);
		}
	}
	mutex_unlock(&pcie_dev->recovery_lock);
}