Received: by 10.192.165.148 with SMTP id m20csp4857297imm; Tue, 8 May 2018 16:03:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp8rYIorVbeEoFlU8d6HcSMuNOLcLCFQxDuOdBdaLLUBsX1g5VxpBMhBsq9Q1uCeXdqgiX+ X-Received: by 10.98.60.209 with SMTP id b78mr40888697pfk.44.1525820614327; Tue, 08 May 2018 16:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525820614; cv=none; d=google.com; s=arc-20160816; b=ITyvrUWB3lsmJtOpFxuM4elt9f0/+Dq0nTNS6CkULLhfo6yMFCrphF3bV3+Ce1XemX jyfGZKJh0DiKpEKzQWMwV3/Wm4LJrO3yUxpKXLRBPiMbYkC72NPKHRZIqPSHsMqsUGLx +IQdTHeCaJkfsNuSxDw+vEYzsge0mRD3zyGcWWbNEl+3iHrElOUvbihFI36CrmwVK7gd 9NmgaGL6ujfi7L1d6Z6d3MlZBa2WghLAXJq/MzZjnDckHDQDF85DoZjs/CXDnZNlA1we KmEo3LakkJZpz08LZfFcx+fQk+37zOfDI/7JRAw7+3LBI+U6NOA8JrIunlPd7xafve7t daRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=f5osucQpVOlUHkcnnT3GWWs+SLge529Fob18j5n+Qok=; b=Yz2t91CekFyzwlvMTT827XJ8rvb3YqhF7xf1AV0CGflhHj24M6fjbqbZHHTWPYaEn5 tym93GwWH3Msr0go8yTLkA/CbzbezBhXyfMJROwNDjK3A5RB568eAwFE6bFI50YiOMCm o1lXeGztuXvpp/B8Utl/VkKcAOT66vZKrAIUuZ4fLtG1KprgaPZo+UDn/J8MpaIpsp5p toz9viCIsoByYNJLHqZAdrflgm5kxwN3uv1/o/w0k3BlS1UA5Lyfm4sJ3iBC9JB0qmos vr3Vx6HTj6wFrULJV9NI3SWH36Ths+KUfghPV5IO1w5LB2GcRiHxPDfbJ0IIMmvNTxZ5 xJGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=M1kL05zA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 8-v6si25298557plc.342.2018.05.08.16.03.19; Tue, 08 May 2018 16:03:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=M1kL05zA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932778AbeEHXCB (ORCPT + 99 others); Tue, 8 May 2018 19:02:01 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:39083 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755620AbeEHXB7 (ORCPT ); Tue, 8 May 2018 19:01:59 -0400 Received: by mail-pl0-f66.google.com with SMTP id c19-v6so288096pls.6 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=fWGPYY7ti363XU0BhKk/wwB4FgoJXJzdXbwg8K7pISPFEQACKH5uUoAKSvO4xfSpgf 2J8RkRGwY8mhhzsYu8u3XExMkO8zMjRVfeNTQa8NgRsdEWCa6p0Wz7397BROuBkuN8yl 31kXLCWBYN7KyPm6CSjGiBbAqURFZj/rAc9f7z1cqJH9KYkG2xPfb9jHeHv9rWp5ABgO F1TnucvWjXDMrglAKUpnsfwbeP3uKlO1eXgoO2anuLWvj6xd5pnu40EQYwauYvt089KM QZDHE3S87tVxesWFtGLosoMeJw0DcCc7xKsBkZ41KYldH2J7/IVAOLGQQo5d0JviAtEG Nr7A== X-Gm-Message-State: ALQs6tDBbzOrx+oqOOczl4IM5OnVL27V3q4ciR9ny2TW3H9xnunqUGV3 W9gJzX9Cvzc3q/cK1by1GXQL3w== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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) { -- 2.17.0.441.gb46fe60e1d-goog