]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
PCI: dwc: Fix PORT_LINK_CONTROL update when CDM check enabled
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Fri, 10 Mar 2023 12:34:58 +0000 (21:34 +0900)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Wed, 17 May 2023 11:33:46 +0000 (13:33 +0200)
commit0ac84dc8b23b485d3bcfcfa89ca0881dc2333a07
tree0b9d91e2a7393016edc189f3023ae509b8ed5cee
parentfefb7e0701d8f6ce638f0c83e167fc433b3a4728
PCI: dwc: Fix PORT_LINK_CONTROL update when CDM check enabled

BugLink: https://bugs.launchpad.net/bugs/2016878
[ Upstream commit cdce67099117ece371582f706c6eff7d3a65326d ]

If CDM_CHECK is enabled (by the DT "snps,enable-cdm-check" property), 'val'
is overwritten by PCIE_PL_CHK_REG_CONTROL_STATUS initialization.  Commit
ec7b952f453c ("PCI: dwc: Always enable CDM check if "snps,enable-cdm-check"
exists") did not account for further usage of 'val', so we wrote improper
values to PCIE_PORT_LINK_CONTROL when the CDM check is enabled.

Move the PCIE_PORT_LINK_CONTROL update to be completely after the
PCIE_PL_CHK_REG_CONTROL_STATUS register initialization.

[bhelgaas: commit log adapted from Serge's version]
Fixes: ec7b952f453c ("PCI: dwc: Always enable CDM check if "snps,enable-cdm-check" exists")
Link: https://lore.kernel.org/r/20230310123510.675685-2-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/pci/controller/dwc/pcie-designware.c