From fcdc5358066e9db785c0c3f03598f8db18070503 Mon Sep 17 00:00:00 2001 From: Gauri Joshi Date: Fri, 28 Aug 2020 12:31:40 +0530 Subject: [PATCH] msm: ep_pcie: Update PERST status when BME is not set During customer testing, when host is in BIOS stage during critical battery level device boots up till AMSS. We get a BME IRQ fired, but BME is no set as host has bailed out enumeration process due to critical battery level. This is followed by a PERST assert, in disable_endpoint we bail out as the PERST is in de-asserted state according to the status variable, though the actual line status is assert. The host then continuosly tries to do PERST assert/de-assert but we never end up doing link training as from device perspective the link is already initialized state. Adding change to update PERST status in case of BME not getting set. This helps in disable_endpoint to happen followed by successful link training. Change-Id: Idd576f4cb0ab649b5aa86e6b1d2cdea204218878 Signed-off-by: Subramanian Ananthanarayanan Signed-off-by: Gauri Joshi --- drivers/platform/msm/ep_pcie/ep_pcie_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/msm/ep_pcie/ep_pcie_core.c b/drivers/platform/msm/ep_pcie/ep_pcie_core.c index 658a8eda9ff5..0a8d82ef822e 100644 --- a/drivers/platform/msm/ep_pcie/ep_pcie_core.c +++ b/drivers/platform/msm/ep_pcie/ep_pcie_core.c @@ -2329,6 +2329,7 @@ static irqreturn_t ep_pcie_handle_perst_irq(int irq, void *data) EP_PCIE_DBG(dev, "PCIe V%d: PCIe is not enumerated yet; PERST is %sasserted\n", dev->rev, perst ? "de" : ""); + atomic_set(&dev->perst_deast, perst ? 1 : 0); if (perst) { /* * Hold a wakelock to avoid delay during