Received: by 10.223.185.116 with SMTP id b49csp4686215wrg; Tue, 6 Mar 2018 22:15:22 -0800 (PST) X-Google-Smtp-Source: AG47ELu2WnlMGleybItRhv6zJa5b+AUd2FNd0m3nbmX1r2/D2OGkR5NxbxqceVwDBGaS/wfQw7Zj X-Received: by 10.98.141.205 with SMTP id p74mr21445159pfk.211.1520403321998; Tue, 06 Mar 2018 22:15:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520403321; cv=none; d=google.com; s=arc-20160816; b=MdZpU3h53ysfBReFO5opeOsocsekawvESo2RDpnLhcHbGoQhWEqZdVOeR6twsGLVLR ppBtQm2y8eOhpJhlgrMF+3j06S34h9LGbuItDp3PRnlBJBV1C1giyoOAIFL1+nV4wiMy tiitVwgHJYDvM9hsBfUt7AXS76LcBZfHR0982MP02VtKuo27jUqnrkysLbF7tKAMDSD+ BJeIMsEznzO4ZIoBixrd30xi3H9NY+ZBItIDdLE+HfNaetYsCy1xYBRQ2v29JYwwCcn+ RwUQBNUmTLe9t3ooUyeRqP2ec/Ju3RwwAHC/ZYtXo3dsMuZjviIjUn6Z736jxmJKsS/9 UKXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dmarc-filter:arc-authentication-results; bh=pCPFsKERsjfys7DjeNsKV8j/hC+1NGwM5QeZjHn2c9g=; b=cTX3/ay/Go2KUMD7YlpIlQUWHf9WasFwucVFoZiSnILAk9C7Jw+mnMckHl7DWz4Uwm sdKWIyn/N0REOXREvcSgo6myRww/lsikk9ECb7SibfBfwhmAz+HRTdZNjyYPdVobblQ/ G2xpJbuWnGcyMbtflnNdNPQaQGxqtXnHxAqL6v1ZDfZRm1J9CYTXJqHfbGKHwe1zu/zW +ovOV1MHCm/i06b1/8rhmaOXYlF6d6cpPxzBnwTS80jEHR/vWyXQLrjymCGWAVLnIRlN VRTGmXYnTvmTm2M6Y9YDd7yAW/GRh+4orxbJ12HAtU8nvZBHl80uQVAvQxeEKkfq+/Ud isdQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x15si10965074pgc.316.2018.03.06.22.15.07; Tue, 06 Mar 2018 22:15:21 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751206AbeCGGNx (ORCPT + 99 others); Wed, 7 Mar 2018 01:13:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:42518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbeCGGNr (ORCPT ); Wed, 7 Mar 2018 01:13:47 -0500 Received: from localhost (unknown [50.35.13.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0EF1F2178C; Wed, 7 Mar 2018 06:13:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0EF1F2178C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Subject: [PATCH v1 4/9] PCI/portdrv: Disable port driver in compat mode From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Keith Busch , Sinan Kaya , Lukas Wunner Date: Wed, 07 Mar 2018 00:13:45 -0600 Message-ID: <152040322576.240786.3375466676254382935.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <152040297576.240786.1532465558381209070.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <152040297576.240786.1532465558381209070.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Helgaas The "pcie_ports=compat" kernel parameter sets pcie_ports_disabled, which is intended to disable the PCIe port driver. But even when it was disabled, we registered pcie_portdriver so we could work around a BIOS PME issue (see fe31e69740ed ("PCI/PCIe: Clear Root PME Status bits early during system resume")). Registering the driver meant that the pcie_portdrv_probe() path called pci_enable_device(), pci_save_state(), pm_runtime_set_autosuspend_delay(), pm_runtime_use_autosuspend(), etc., even when the driver was disabled. We've since moved the BIOS PME workaround from the port driver to the core, so stop registering the PCIe port driver in compat mode. This means "pcie_ports=compat" will now be basically the same as turning off CONFIG_PCIEPORTBUS completely. Signed-off-by: Bjorn Helgaas --- drivers/pci/pcie/portdrv_core.c | 3 --- drivers/pci/pcie/portdrv_pci.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index ef3bad4ad010..9db77c683732 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -212,9 +212,6 @@ static int get_port_device_capability(struct pci_dev *dev) int services = 0; int cap_mask = 0; - if (pcie_ports_disabled) - return 0; - cap_mask = PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP | PCIE_PORT_SERVICE_VC; if (pci_aer_available()) diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index f91afd09e356..c08ebd237242 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c @@ -262,7 +262,7 @@ static int __init pcie_portdrv_init(void) int retval; if (pcie_ports_disabled) - return pci_register_driver(&pcie_portdriver); + return -EACCES; dmi_check_system(pcie_portdrv_dmi_table);