From patchwork Tue May 8 23:01:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 10387749 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AFBA46037F for ; Tue, 8 May 2018 23:02:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5DD729069 for ; Tue, 8 May 2018 23:02:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98E2929074; Tue, 8 May 2018 23:02:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13B8A29069 for ; Tue, 8 May 2018 23:02:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755716AbeEHXCA (ORCPT ); Tue, 8 May 2018 19:02:00 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:33692 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754148AbeEHXB7 (ORCPT ); Tue, 8 May 2018 19:01:59 -0400 Received: by mail-pl0-f65.google.com with SMTP id n10-v6so1264plp.0 for ; Tue, 08 May 2018 16:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=f5osucQpVOlUHkcnnT3GWWs+SLge529Fob18j5n+Qok=; b=M1kL05zAO3fPhOU2wn5Y2yyZK8thtvJRAJ7xPZFvSPQArYRcecAr2r1/gQfCpfNl2L GOONo/oZGePlkcksbLWVafQnBY8L7YEI7sfEKBni+m3lI0QqWXbcuVycjmOfmhKs/nPp AmAJjxC3v4UUyrqrwfYcKx592WD0FIfpjkGyLgACGX6Da3NXQw34p1WZfUDPhm5hKotf M1sbLWWM3F6w3hMUd5tDJMhnzThm57BLs9UyKNOvYzWkf1KedWt31J+pjNWyhgkhDkeA y+R6JvfwTtv/VwHSSPdRkppsfzoX5nxOWHs7AZ7tBQ28Pi+0gN4JXQmyObWM2FEyLDSl Xr8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=f5osucQpVOlUHkcnnT3GWWs+SLge529Fob18j5n+Qok=; b=KERZdAQNRjIPo5uHy/s+ANXU2yqbG9iJpeOqFvS0SjX+7N8AkXTQwZ/u0O7BxNr79E XPcWSHIrrFK9lE91x5CZtVjK5BgLHlngYMoIsXyPJFTvvqIpgvQowvPlz75PJkOjKmmb 4849Z2QKISuskwLEfYODcBLAmBcdPf6Z4GUZEQ6ZIA04WnOVRvmbiEx1DIIo9RbBWAHZ hCmXA9QwZibCflZgd5RG67ehIqvU227xCarzYQ+FBKkJ98slyB4oiK0SUG/UzUz2wABb TqiS4ntvIu/t0T21KiZSq5R/w8xJ3QfV1mKMmeMdZuTbVz52ITtAifDBIBM8zlYDuthh 0kOg== X-Gm-Message-State: ALQs6tAsUobleSY9D7BLazUpQg6EgBpIi2MuH4vrMo3YvPD2rtxSEEVm 8MouDZTbvLWsC7OjtN5kZIPXyg== X-Google-Smtp-Source: AB8JxZq29RDKCsiXMnwEcMUi/lrbT/pfGOOwiopPA5Udn47TSRHKlFawvPfUcRI7yKjbS+p4x9vcEA== X-Received: by 2002:a17:902:264:: with SMTP id 91-v6mr43003076plc.341.1525820519055; Tue, 08 May 2018 16:01:59 -0700 (PDT) Received: from rajat.mtv.corp.google.com ([2620:0:1000:1501:dc81:9a9e:fdee:decf]) by smtp.gmail.com with ESMTPSA id l9sm6789167pfg.146.2018.05.08.16.01.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 May 2018 16:01:58 -0700 (PDT) From: Rajat Jain To: Bjorn Helgaas , Rajat Jain , Keith Busch , Vidya Sagar , Philippe Ombredanne , Kees Cook , "Gustavo A. R. Silva" , Ard Biesheuvel , Sinan Kaya , Frederick Lawler , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mayurkumar.patel@intel.com Cc: rajatxjain@gmail.com Subject: [PATCH] pci/aspm: Remove CONFIG_PCIEASPM_DEBUG Date: Tue, 8 May 2018 16:01:48 -0700 Message-Id: <20180508230148.121852-1-rajatja@google.com> X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d-goog Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, the linux kernel disables ASPM when a device is removed from the kernel. But it is not enabled again when a new device is added on that slot even if it was originally enabled (by the BIOS) when the system booted up (assuming POLICY_DEFAULT). This was earlier discussed here: https://www.spinics.net/lists/linux-pci/msg60212.html And some suggestions from Bjorn here: https://www.spinics.net/lists/linux-pci/msg60541.html This patch picks up one of the suggestion, to remove the CONFIG_PCIEASPM_DEBUG and thus make the code always avilable. This provides control to userspace to control ASPM on a per slot / device basis using sysfs interface. Signed-off-by: Rajat Jain Reviewed-by: Sinan Kaya --- drivers/pci/pci.h | 5 ----- drivers/pci/pcie/Kconfig | 8 -------- drivers/pci/pcie/aspm.c | 2 -- 3 files changed, 15 deletions(-) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 023f7cf25bff..383d92a6b0fb 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -365,13 +365,8 @@ static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev) { } static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev) { } #endif -#ifdef CONFIG_PCIEASPM_DEBUG void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev); void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev); -#else -static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev) { } -static inline void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev) { } -#endif #ifdef CONFIG_PCIE_PTM void pci_ptm_init(struct pci_dev *dev); diff --git a/drivers/pci/pcie/Kconfig b/drivers/pci/pcie/Kconfig index b12e28b3d8f9..089b9f559d88 100644 --- a/drivers/pci/pcie/Kconfig +++ b/drivers/pci/pcie/Kconfig @@ -46,14 +46,6 @@ config PCIEASPM When in doubt, say Y. -config PCIEASPM_DEBUG - bool "Debug PCI Express ASPM" - depends on PCIEASPM - default n - help - This enables PCI Express ASPM debug support. It will add per-device - interface to control ASPM. - choice prompt "Default ASPM policy" default PCIEASPM_DEFAULT diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index c687c817b47d..8ffc13d42baa 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -1161,7 +1161,6 @@ static int pcie_aspm_get_policy(char *buffer, const struct kernel_param *kp) module_param_call(policy, pcie_aspm_set_policy, pcie_aspm_get_policy, NULL, 0644); -#ifdef CONFIG_PCIEASPM_DEBUG static ssize_t link_state_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -1264,7 +1263,6 @@ void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev) sysfs_remove_file_from_group(&pdev->dev.kobj, &dev_attr_clk_ctl.attr, power_group); } -#endif static int __init pcie_aspm_disable(char *str) {