From patchwork Fri Jan 18 16:07:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2003691 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 11EE1DF280 for ; Fri, 18 Jan 2013 16:08:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755606Ab3ARQIj (ORCPT ); Fri, 18 Jan 2013 11:08:39 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:33924 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755598Ab3ARQIf (ORCPT ); Fri, 18 Jan 2013 11:08:35 -0500 Received: by mail-pa0-f54.google.com with SMTP id bi5so2189592pad.13 for ; Fri, 18 Jan 2013 08:08:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=YabxyUqL/kPgY1Qfdby2xTiRD3ceKQ90+G9UCOAJ/pk=; b=kjJFyA/S5dn0/FjjlpOX07TtnYkMYfZHk3UHolpzG6EkxM1N9wjgGaLqYxM0eIz2Ix sXJs12tBewyWsxuoicoqa19QyikNmR+skL6YHSbURXjQZwNCA61f52AvP3Qbcz7tAD54 D77knXPOvBOGVeBnXNfZC/ON8LSm+/mWjGAvDIn16NgO9EqwSboUD+4yKzP1vii8FSAt ptd+8TmetI2dVodPxmiZxtIZLrAVXItBeX72eg8hJrULvvMv30Z3d0G4aHWhRIzQ0FlM 8rTyhUws5EaSMeMCwwHimxsrrsNGFOwxXiU0E/wVBntsC5GRRbnRZ+vEgN1qS5/NQtnx GTEw== X-Received: by 10.68.134.228 with SMTP id pn4mr6693556pbb.31.1358525315055; Fri, 18 Jan 2013 08:08:35 -0800 (PST) Received: from localhost.localdomain ([120.197.109.98]) by mx.google.com with ESMTPS id ux4sm3320742pbc.25.2013.01.18.08.08.30 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jan 2013 08:08:34 -0800 (PST) From: Jiang Liu To: "Rafael J . Wysocki" , Bjorn Helgaas Cc: Jiang Liu , Yinghai Lu , Kenji Kaneshige , Yijing Wang , Jiang Liu , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Greg Kroah-Hartman , ACPI Devel Maling List , Toshi Kani , Myron Stowe Subject: [RFC PATCH v5 8/8] PCI/PCIe: only claim PME from firmware when CONFIG_PCIE_PME is enabled Date: Sat, 19 Jan 2013 00:07:46 +0800 Message-Id: <1358525267-14268-9-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358525267-14268-1-git-send-email-jiang.liu@huawei.com> References: <1358525267-14268-1-git-send-email-jiang.liu@huawei.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org If CONFIG_PCIE_PME is not defined, system should avoid claiming PME from firmware so firmware could still manage PME events for those devices. Also don't create PCIe port device for PME service if CONFIG_PCIE_PME is not defined. Signed-off-by: Jiang Liu --- drivers/acpi/pci_root.c | 5 +++-- drivers/pci/pcie/portdrv_core.c | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index c37eedb..7f7e464 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -550,8 +550,9 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) if (!pcie_ports_disabled && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { - flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL - | OSC_PCI_EXPRESS_PME_CONTROL; + flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL; + if (IS_ENABLED(CONFIG_PCIE_PME)) + flags |= OSC_PCI_EXPRESS_PME_CONTROL; if (!pcie_native_hotplug_disabled) flags |= OSC_PCI_EXPRESS_NATIVE_HP_CONTROL; diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index e7e1679..7e6546f 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -263,7 +263,9 @@ static int get_port_device_capability(struct pci_dev *dev) err = pcie_port_platform_notify(dev, &cap_mask); if (!pcie_ports_auto) { - cap_mask = PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_VC; + cap_mask = PCIE_PORT_SERVICE_VC; + if (IS_ENABLED(CONFIG_PCIE_PME)) + cap_mask |= PCIE_PORT_SERVICE_PME; if (!pcie_native_hotplug_disabled) cap_mask |= PCIE_PORT_SERVICE_HP; if (pci_aer_available())