From 393f77ff380a7880cdf35b96143b0a7c947bc7d1 Mon Sep 17 00:00:00 2001 From: Oleksandr Suvorov Date: Wed, 23 Dec 2020 11:55:42 +0200 Subject: pci: pci-imx6: fix kernel hanging on imx6q The resume from a suspend state on SoC i.MX6Q leads to a kernel hanging. Adding a 10ms delay after clearing the bit TEST_POWERDOWN of IOMUXC_GPR1 regiater fixes this issue. There is not enough information about the testing "powerdown" mode on i.MX6Q, but we can do some assumption. According to "49.6.1.2 Power-On Reset" section of the "i.MX6D/6Q APRM", the time between bringing up the PHY power supplies and the reference clock is up and stable is (< 10ms) + (> 10mks) ~= 10ms. So using this value seems reasonable. Related-to: ELB-3012 Signed-off-by: Oleksandr Suvorov --- drivers/pci/controller/dwc/pci-imx6.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index ac2b1e740caa..1fd06bb5840e 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -2431,6 +2431,7 @@ static int imx6_pcie_resume_noirq(struct device *dev) */ regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, IMX6Q_GPR1_PCIE_TEST_PD, 0); + msleep(10); } else { imx6_pcie_assert_core_reset(imx6_pcie); imx6_pcie_init_phy(imx6_pcie); -- cgit v1.2.3