Skip to content
Snippets Groups Projects
Commit d4c63c31 authored by Myron Stowe's avatar Myron Stowe
Browse files

PCI: mediatek-gen3: Move reset delay in mtk_pcie_en7581_power_up()

JIRA: https://issues.redhat.com/browse/RHEL-83611
Upstream Status: 90d4e466c9ea2010f33880a36317a8486ccbe082

commit 90d4e466c9ea2010f33880a36317a8486ccbe082
Author: Lorenzo Bianconi <lorenzo@kernel.org>
Date:   Wed Jan 8 10:50:43 2025 +0100

    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: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarKrzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Acked-by: default avatarStephen Boyd <sboyd@kernel.org>

Signed-off-by: default avatarMyron Stowe <mstowe@redhat.com>
parent 1abff6be
No related branches found
No related tags found
No related merge requests found
......@@ -393,7 +393,6 @@ static int en7581_pci_enable(struct clk_hw *hw)
REG_PCI_CONTROL_PERSTOUT;
val = readl(np_base + REG_PCI_CONTROL);
writel(val | mask, np_base + REG_PCI_CONTROL);
msleep(250);
return 0;
}
......
......@@ -974,6 +974,13 @@ static int mtk_pcie_en7581_power_up(struct mtk_gen3_pcie *pcie)
goto err_clk_prepare_enable;
}
/*
* Airoha EN7581 performs PCIe reset via clk callbacks since it has a
* hw issue with PCIE_PE_RSTB signal. Add wait for the time needed to
* complete the PCIe reset.
*/
msleep(PCIE_T_PVPERL_MS);
return 0;
err_clk_prepare_enable:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment