From 2b311be08a61793e26757d5239ad9b79222962e5 Mon Sep 17 00:00:00 2001 From: Stefan Eichenberger Date: Wed, 26 Apr 2023 09:27:51 +0200 Subject: ata: ahci-imx: Do not disable APB clock There is a clock dependency between the ahci-imx driver and the PCIe driver on i.MX8 which causes the PCIe link to never come up. It happens every 20-100 reboots when the SATA driver probes before PCIe. By never disabling the APB clock in the SATA driver this issue goes away. In BSP5 we compiled the SATA driver as a module and the SATA driver was probing after the PCIe driver, therefore we could not see the issue there. Upstream-Status: Inappropriate [other] This is an ugly workaround that should not land upstream. We try to get help from NXP regarding this issue to find a proper solution. Signed-off-by: Stefan Eichenberger --- drivers/ata/ahci_imx.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c index f038267c4068..c717fed2e532 100644 --- a/drivers/ata/ahci_imx.c +++ b/drivers/ata/ahci_imx.c @@ -614,7 +614,6 @@ disable_per_clk1: disable_per_clk0: clk_disable_unprepare(imxpriv->per_clk0); disable_phy_apbclk: - clk_disable_unprepare(imxpriv->phy_apbclk); disable_epcs_rx_clk: clk_disable_unprepare(imxpriv->epcs_rx_clk); disable_epcs_tx_clk: @@ -882,14 +881,12 @@ static int imx8_sata_enable(struct ahci_host_priv *hpriv) * To reduce the power consumption, gate off * the PHY clks */ - clk_disable_unprepare(imxpriv->phy_apbclk); clk_disable_unprepare(imxpriv->phy_pclk1); clk_disable_unprepare(imxpriv->phy_pclk0); return ret; } err_out: - clk_disable_unprepare(imxpriv->phy_apbclk); clk_disable_unprepare(imxpriv->phy_pclk1); clk_disable_unprepare(imxpriv->phy_pclk0); imx8_sata_clk_disable(imxpriv); -- cgit v1.2.3