Patch "PCI: mediatek-gen3: Assert resets to ensure expected init state" has been added to the 5.18-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    PCI: mediatek-gen3: Assert resets to ensure expected init state

to the 5.18-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pci-mediatek-gen3-assert-resets-to-ensure-expected-i.patch
and it can be found in the queue-5.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 69fd93afa849c2af2451c824b180683e3ff76d07
Author: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
Date:   Mon Apr 4 16:48:58 2022 +0200

    PCI: mediatek-gen3: Assert resets to ensure expected init state
    
    [ Upstream commit 1d565935e3b9ccc682631e0bc6e415a7f48295d9 ]
    
    The controller may have been left out of reset by the bootloader,
    in which case, before the powerup sequence, the controller will be
    found preconfigured with values that were set before booting the
    kernel: this produces a controller failure, with the result of
    a failure during the mtk_pcie_startup_port() sequence as the PCIe
    link never gets up.
    
    To ensure that we get a clean start in an expected state, assert
    both the PHY and MAC resets before executing the controller
    power-up sequence.
    
    Link: https://lore.kernel.org/r/20220404144858.92390-1-angelogioacchino.delregno@xxxxxxxxxxxxx
    Fixes: d3bf75b579b9 ("PCI: mediatek-gen3: Add MediaTek Gen3 driver for MT8192")
    Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c
index 3e8d70bfabc6..5d9fd36b02d1 100644
--- a/drivers/pci/controller/pcie-mediatek-gen3.c
+++ b/drivers/pci/controller/pcie-mediatek-gen3.c
@@ -838,6 +838,14 @@ static int mtk_pcie_setup(struct mtk_gen3_pcie *pcie)
 	if (err)
 		return err;
 
+	/*
+	 * The controller may have been left out of reset by the bootloader
+	 * so make sure that we get a clean start by asserting resets here.
+	 */
+	reset_control_assert(pcie->phy_reset);
+	reset_control_assert(pcie->mac_reset);
+	usleep_range(10, 20);
+
 	/* Don't touch the hardware registers before power up */
 	err = mtk_pcie_power_up(pcie);
 	if (err)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux