]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: qcom: Set up rev 2.1.0 PARF_PHY before enabling clocks
authorChristian Marangi <ansuelsmth@gmail.com>
Fri, 8 Jul 2022 22:27:43 +0000 (00:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:51 +0000 (14:23 +0200)
commit7e6a5cfb86e322dd637387adbd09bf93771ca9d8
tree5f009f21e984c32f68aeb82677dc5a34ed29206c
parent966364e07f86aebe1f7844a869cf98d7ac07b37f
PCI: qcom: Set up rev 2.1.0 PARF_PHY before enabling clocks

[ Upstream commit aa4b62d427d9451ba5a5c306a40f8e20d7310660 ]

We currently enable clocks BEFORE we write to PARF_PHY_CTRL reg to enable
clocks and resets. This causes the driver to never set to a ready state
with the error 'Phy link never came up'.

This is caused by the PHY clock getting enabled before setting the required
bits in the PARF regs.

A workaround for this was set but with this new discovery we can drop
the workaround and use a proper solution to the problem by just enabling
the clock only AFTER the PARF_PHY_CTRL bit is set.

This correctly sets up the PCIe link and makes it usable even when a
bootloader leaves the PCIe link in an undefined state.

Fixes: d11a813ae6a6 ("PCI: qcom: Add Qualcomm PCIe controller driver")
Link: https://lore.kernel.org/r/20220708222743.27019-1-ansuelsmth@gmail.com
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/dwc/pcie-qcom.c