Skip to content

Commit 90d4e46

Browse files
LorenzoBianconikwilczynski
authored andcommitted
PCI: mediatek-gen3: Move reset delay in mtk_pcie_en7581_power_up()
Airoha EN7581 has a hw bug asserting/releasing PCIE_PE_RSTB signal causing occasional PCIe link down issues. In order to overcome the problem, PCIe block is reset using REG_PCI_CONTROL (0x88) and REG_RESET_CONTROL (0x834) registers available in the clock module running clk_bulk_prepare_enable() in mtk_pcie_en7581_power_up(). In order to make the code more readable, move the wait for the time needed to complete the PCIe reset from en7581_pci_enable() to mtk_pcie_en7581_power_up(). Reduce reset timeout from 250ms to the standard PCIE_T_PVPERL_MS value (100ms) since it has no impact on the driver behavior. Link: https://lore.kernel.org/r/20250108-pcie-en7581-fixes-v6-4-21ac939a3b9b@kernel.org Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Acked-by: Stephen Boyd <sboyd@kernel.org>
1 parent 0c9d2d2 commit 90d4e46

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/clk/clk-en7523.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ static int en7581_pci_enable(struct clk_hw *hw)
477477
REG_PCI_CONTROL_PERSTOUT;
478478
val = readl(np_base + REG_PCI_CONTROL);
479479
writel(val | mask, np_base + REG_PCI_CONTROL);
480-
msleep(250);
481480

482481
return 0;
483482
}

drivers/pci/controller/pcie-mediatek-gen3.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,13 @@ static int mtk_pcie_en7581_power_up(struct mtk_gen3_pcie *pcie)
974974
goto err_clk_prepare_enable;
975975
}
976976

977+
/*
978+
* Airoha EN7581 performs PCIe reset via clk callbacks since it has a
979+
* hw issue with PCIE_PE_RSTB signal. Add wait for the time needed to
980+
* complete the PCIe reset.
981+
*/
982+
msleep(PCIE_T_PVPERL_MS);
983+
977984
return 0;
978985

979986
err_clk_prepare_enable:

0 commit comments

Comments
 (0)