Skip to contentSkip to conversation

PCI/ASPM: Suppress common clock mode setting failure

PATCH Superseded Sinan Kaya 1 participant 2 messages Jan 22, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sinan Kaya

author
#0 lore raw

PATCH 1/1 PCI/ASPM: Suppress common clock mode setting failure

Code is emitting warnings when it tries to set the common clock mode for ASPM and ASPM is already configured to common clock mode by the UEFI BIOS. Let's bail out silently in such a case.

pci 0004:00:00.0: ASPM: Could not configure common clock

---
 drivers/pci/pcie/aspm.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/pci/pcie/aspm.c +5 -0
index 9783e10..072178a 100644
@@ -253,6 +253,11 @@ static void pcie_aspm_configure_common_clock(struct pcie_link_state *link)
 
 	/* Configure upstream component */
 	pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &reg16);
+
+	/* Port might be already in common clock mode */
+	if ((same_clock) && (reg16 & PCI_EXP_LNKCTL_CCC))
+		return;
+
 	parent_reg = reg16;
 	if (same_clock)
 		reg16 |= PCI_EXP_LNKCTL_CCC;
Signature · 1 line
1.9.1
author
#1 lore raw

drivers/pci/pcie/aspm.c static void pcie_aspm_configure_common_clock(struct pcie_link_state *link) · line 260

Quoted 10 lines · Sinan Kaya

+++ b/drivers/pci/pcie/aspm.c

drivers/pci/pcie/aspm.c +5 -0
@@ -253,6 +253,11 @@ static void pcie_aspm_configure_common_clock(struct pcie_link_state *link)
 
 	/* Configure upstream component */
 	pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &reg16);
+
+	/* Port might be already in common clock mode */
+	if ((same_clock) && (reg16 & PCI_EXP_LNKCTL_CCC))
+		return;
+

I think the placement of this statement is too late. I'll move it a couple of lines and post V2.

Signature · 3 lines
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.