From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sinan Kaya Subject: [PATCH] PCI/ASPM: Suppress common clock mode setting failure Date: Mon, 22 Jan 2018 12:28:00 -0500 Message-ID: <1516642093-15633-1-git-send-email-okaya@codeaurora.org> Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:52628 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751028AbeAVR20 (ORCPT ); Mon, 22 Jan 2018 12:28:26 -0500 Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: linux-pci@vger.kernel.org, timur@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Bjorn Helgaas , Rajat Jain , Vidya Sagar , Thomas Gleixner , Kees Cook , Ard Biesheuvel , Yinghai Lu , open list 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 --- 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