* [PATCH] PCI/ASPM: Suppress common clock mode setting failure
@ 2018-01-22 17:28 Sinan Kaya
2018-01-22 19:13 ` Sinan Kaya
0 siblings, 1 reply; 2+ messages in thread
From: Sinan Kaya @ 2018-01-22 17:28 UTC (permalink / raw)
To: linux-pci, timur
Cc: Kees Cook, Ard Biesheuvel, linux-arm-msm, open list, Vidya Sagar,
Sinan Kaya, Bjorn Helgaas, Thomas Gleixner, Rajat Jain,
Yinghai Lu, linux-arm-kernel
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
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
drivers/pci/pcie/aspm.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 9783e10..072178a 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -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, ®16);
+
+ /* 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;
--
1.9.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI/ASPM: Suppress common clock mode setting failure
2018-01-22 17:28 [PATCH] PCI/ASPM: Suppress common clock mode setting failure Sinan Kaya
@ 2018-01-22 19:13 ` Sinan Kaya
0 siblings, 0 replies; 2+ messages in thread
From: Sinan Kaya @ 2018-01-22 19:13 UTC (permalink / raw)
To: linux-pci, timur
Cc: Kees Cook, Ard Biesheuvel, linux-arm-msm, open list, Vidya Sagar,
Bjorn Helgaas, Thomas Gleixner, Rajat Jain, Yinghai Lu,
linux-arm-kernel
On 1/22/2018 12:28 PM, Sinan Kaya wrote:
> +++ b/drivers/pci/pcie/aspm.c
> @@ -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, ®16);
> +
> + /* 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.
--
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.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-22 19:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-22 17:28 [PATCH] PCI/ASPM: Suppress common clock mode setting failure Sinan Kaya
2018-01-22 19:13 ` Sinan Kaya
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox