Skip to content

Commit c3bd7dc

Browse files
paliLorenzo Pieralisi
authored andcommitted
PCI: mvebu: Fix reporting Data Link Layer Link Active on emulated bridge
Add support for reporting PCI_EXP_LNKSTA_DLLLA bit in Link Control register on emulated bridge via PCIE_STAT_OFF reg. Function mvebu_pcie_link_up() already parses this register and returns if Data Link is Active or not. Also correctly indicate DLLLA capability via PCI_EXP_LNKCAP_DLLLARC bit in Link Control Capability register which is required for reporting DLLLA bit. Link: https://lore.kernel.org/r/20220104153529.31647-12-pali@kernel.org Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Rob Herring <robh@kernel.org>
1 parent c94ea32 commit c3bd7dc

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

drivers/pci/controller/pci-mvebu.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,13 +548,18 @@ mvebu_pci_bridge_emul_pcie_conf_read(struct pci_bridge_emul *bridge,
548548
/*
549549
* PCIe requires that the Clock Power Management capability bit
550550
* is hard-wired to zero for downstream ports but HW returns 1.
551+
* Additionally enable Data Link Layer Link Active Reporting
552+
* Capable bit as DL_Active indication is provided too.
551553
*/
552-
*value = mvebu_readl(port, PCIE_CAP_PCIEXP + PCI_EXP_LNKCAP) &
553-
~PCI_EXP_LNKCAP_CLKPM;
554+
*value = (mvebu_readl(port, PCIE_CAP_PCIEXP + PCI_EXP_LNKCAP) &
555+
~PCI_EXP_LNKCAP_CLKPM) | PCI_EXP_LNKCAP_DLLLARC;
554556
break;
555557

556558
case PCI_EXP_LNKCTL:
557-
*value = mvebu_readl(port, PCIE_CAP_PCIEXP + PCI_EXP_LNKCTL);
559+
/* DL_Active indication is provided via PCIE_STAT_OFF */
560+
*value = mvebu_readl(port, PCIE_CAP_PCIEXP + PCI_EXP_LNKCTL) |
561+
(mvebu_pcie_link_up(port) ?
562+
(PCI_EXP_LNKSTA_DLLLA << 16) : 0);
558563
break;
559564

560565
case PCI_EXP_SLTCTL:

0 commit comments

Comments
 (0)