]> www.infradead.org Git - users/hch/xfs.git/commit
PCI: rockchip-ep: Refactor endpoint link training enable
authorDamien Le Moal <dlemoal@kernel.org>
Thu, 17 Oct 2024 01:58:45 +0000 (10:58 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 25 Nov 2024 19:18:36 +0000 (13:18 -0600)
commit091022f5f94513e5f11aa9e2f1cd9fdb4d00f83c
treeab94eb15c4d7817f0b293f610833596d1e545eb5
parent8efda8aebeed59bab984489407a94008f65f4d1e
PCI: rockchip-ep: Refactor endpoint link training enable

The function rockchip_pcie_init_port() enables link training for a
controller configured in EP mode. Enabling link training is again done
in rockchip_pcie_ep_probe() after that function executed
rockchip_pcie_init_port(). Enabling link training only needs to be done
once, and doing so at the probe stage before the controller is actually
started by the user serves no purpose.

Refactor this by removing the link training enablement from both
rockchip_pcie_init_port() and rockchip_pcie_ep_probe() and moving it to
the endpoint start operation defined with rockchip_pcie_ep_start().
Enabling the controller configuration using the PCIE_CLIENT_CONF_ENABLE
bit in the same PCIE_CLIENT_CONFIG register is also moved to
rockchip_pcie_ep_start() and both the controller configuration and link
training enable bits are set with a single call to
rockchip_pcie_write().

Link: https://lore.kernel.org/r/20241017015849.190271-11-dlemoal@kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/controller/pcie-rockchip-ep.c
drivers/pci/controller/pcie-rockchip.c