From patchwork Sat Oct 26 17:23:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Murray X-Patchwork-Id: 3098551 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EAC129F431 for ; Sat, 26 Oct 2013 17:23:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F35A202A7 for ; Sat, 26 Oct 2013 17:23:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB36520295 for ; Sat, 26 Oct 2013 17:23:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752018Ab3JZRXW (ORCPT ); Sat, 26 Oct 2013 13:23:22 -0400 Received: from mail-we0-f176.google.com ([74.125.82.176]:63784 "EHLO mail-we0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751849Ab3JZRXV (ORCPT ); Sat, 26 Oct 2013 13:23:21 -0400 Received: by mail-we0-f176.google.com with SMTP id w62so4966292wes.7 for ; Sat, 26 Oct 2013 10:23:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=A995ETX0ldL2oFRZvUuXCs4udvZhrmXEflKqi/yKRbY=; b=Qd2yoF/SSbUHmtRXmVFXAGc98A88G+nQ5Z9HW4xQCG9yIoE+H4uc1kEcPB0QYEs/7R lRej9ORDdoPZV43LAoVtH9yWTypdwuNQXnfAQT7Oa0MjjsRryaaqmdzBJOu2MOa/5XGk sIEwv0BdabcrJFsLfEdPR46oOf+Uo02szFOeCogFL6+klp8wA3xfKyouhN5BGaQi0ywO 77H2P5dHkpxULP5IM4H4STE5rjaGRyo6/xG3cGXoDIHpd2f6Qpe2OLL76vgvQkbeU6ee Tf4DHKVTVvIjTGBvSOxNph0XB+1/1iCor/psydrAXC4cRb6AKvm+8ycLKOzV6VEVoQOy kFNA== X-Gm-Message-State: ALoCoQmIoQi08SXTy/KcI69w2XK7jV0MtGDpwcPGhbwCDN5d3SUCNej9VcS7fy7nCKBGzqQSBjvC X-Received: by 10.194.47.209 with SMTP id f17mr857405wjn.55.1382808200217; Sat, 26 Oct 2013 10:23:20 -0700 (PDT) Received: from localhost.localdomain (host-89-242-55-14.as13285.net. [89.242.55.14]) by mx.google.com with ESMTPSA id y20sm17890997wib.0.2013.10.26.10.23.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 26 Oct 2013 10:23:19 -0700 (PDT) From: Andrew Murray To: linux-pci@vger.kernel.org Cc: bhelgaas@google.com, m-karicheri2@ti.com, Andrew Murray Subject: [PATCH] pci: update pcie_ports 'auto' behavior for non-ACPI platforms Date: Sat, 26 Oct 2013 18:23:25 +0100 Message-Id: <1382808205-843-1-git-send-email-amurray@embedded-bits.co.uk> X-Mailer: git-send-email 1.8.1.2 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The pcie_ports parameter, which defaults to 'auto', allows a user to specify if PCIe port services are disabled ('compat'), always enabled ('native'), or only used when allowed by the BIOS ('auto'). Where CONFIG_ACPI isn't enabled, as is often the case for non x86/ia64 platforms, the 'auto' behavior results in that of 'compat'. Thus in order to use port services on these platforms 'pcie_ports=native' must be added to the kernel command line. This patch results in the 'native' behavior being followed where 'auto' is selected and ACPI is not enabled. Signed-off-by: Andrew Murray --- drivers/pci/pcie/portdrv_core.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 31063ac..08d131f 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -260,13 +260,14 @@ static int get_port_device_capability(struct pci_dev *dev) if (pcie_ports_disabled) return 0; - err = pcie_port_platform_notify(dev, &cap_mask); - if (!pcie_ports_auto) { - cap_mask = PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP - | PCIE_PORT_SERVICE_VC; - if (pci_aer_available()) - cap_mask |= PCIE_PORT_SERVICE_AER; - } else if (err) { + cap_mask = PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP + | PCIE_PORT_SERVICE_VC; + if (pci_aer_available()) + cap_mask |= PCIE_PORT_SERVICE_AER; + + if (pcie_ports_auto) { + err = pcie_port_platform_notify(dev, &cap_mask); + if (err) return 0; }