From patchwork Tue Jun 19 19:58:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 10475365 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 916AD60383 for ; Tue, 19 Jun 2018 19:59:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81FA128AF1 for ; Tue, 19 Jun 2018 19:59:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7445F28B87; Tue, 19 Jun 2018 19:59:05 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 2335C28AF1 for ; Tue, 19 Jun 2018 19:59:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030812AbeFST6w (ORCPT ); Tue, 19 Jun 2018 15:58:52 -0400 Received: from mail-ot0-f195.google.com ([74.125.82.195]:42581 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030528AbeFST6s (ORCPT ); Tue, 19 Jun 2018 15:58:48 -0400 Received: by mail-ot0-f195.google.com with SMTP id 92-v6so1071732otw.9; Tue, 19 Jun 2018 12:58:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=3bB1M/YGqvLEtORVyClAmRwlLUSXyn2Qacu7CYP8XuA=; b=uELPYY5DSjUIawYwiH1+2zr9/bsvPUJum0YpAjpELsYvyX2R964yIC8PHpqCfJPsGu TDPVtzW4rgeg0UpsD9UskofAIdgyniD+qJMhcWT6DqaH9efH/hYqkl4QHOJtqQT5nbL1 AHtrWdJ5yW3SUYOjsqBYjHxVl8knkwJaIByEmAgmsXRpVe8R5biuGzWlc4yhW3jW4RNc Cd3CrOhILpJHw79B38S4ridsksw4RR5x+jzbPga36Ugue9RLTXoQmJoWC4IfDZV74m7L CFhp31ToU5rCUZ9IRkDlgx9keDl68YwJEboA+FvBbRnE6PBo5UHn8jKcMfVYjIJXbIVA WwAg== 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=3bB1M/YGqvLEtORVyClAmRwlLUSXyn2Qacu7CYP8XuA=; b=DpDS2CfXnRdvX8Ye9/ii5eZBTizGosInvvOcWxGThk5K9U6P8jSoiR7NqdmzzyRfAW wnBZ0tqMezk3HxAHMHJoecfgMW82dOQkLmCbBoH4PQPVHF+c3XgHWt1om79iLMXJlcfW UioyjybDtt/8dMj8mDBqf3rb9/ky05QdqueEu3cZvXW7/LUGS4pwWNNnKp1owYgm+93r NNcoifA8NLiyWsbJM7G1kahvAzM0bmodAz+Z5eWMt8B7EGraUdHIahXWeN9YIjYFFnWS RUYC5Si+tNj5izSxoiEG2qfb/c4foqO1xi8FDN3Jps5mN321qa0sts4rKYGNkEtr7l8j 1nXw== X-Gm-Message-State: APt69E3sR4w3gYV9gmkIYiWLLWR8awOnxbg0bjea5zLxE8PGhyYeuIVj NL4qwfL374ZqOcAuJhaIe3o= X-Google-Smtp-Source: ADUXVKJPiyVCNGbdfxyG+r0+gNfxmqnqmlVlpllMitoE9m1SYT0zp+cUCtDZuI4TIZ1uEXPKBh6Cdg== X-Received: by 2002:a9d:1f74:: with SMTP id x49-v6mr10545416otx.108.1529438327676; Tue, 19 Jun 2018 12:58:47 -0700 (PDT) Received: from nuclearis2_1.lan (c-98-201-114-184.hsd1.tx.comcast.net. [98.201.114.184]) by smtp.gmail.com with ESMTPSA id l17-v6sm520831ote.76.2018.06.19.12.58.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Jun 2018 12:58:47 -0700 (PDT) From: Alexandru Gagniuc To: bhelgaas@google.com, keith.busch@intel.com Cc: alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, Alexandru Gagniuc , Frederick Lawler , Greg Kroah-Hartman , Oza Pawandeep , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] PCI/AER: Fix aerdrv loading with "pcie_ports=native" parameter Date: Tue, 19 Jun 2018 14:58:20 -0500 Message-Id: <20180619195835.5423-1-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.14.3 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 According to the documentation, "pcie_ports=native", linux should use native AER and DPC services. While that is true for the _OSC method parsing, this is not the only place that is checked. Should the HEST table list PCIe ports as firmware-first, linux will not use native services. This happens because aer_acpi_firmware_first() doesn't take 'pcie_ports' into account. This is wrong. DPC uses the same logic when it decides whether to load or not, so fixing this also fixes DPC not loading. Signed-off-by: Alexandru Gagniuc --- drivers/pci/pcie/aer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Changes since v1: - Re-tested with latest and greatest (v4.18-rc1) -- works great diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index a2e88386af28..98ced0f7c850 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -291,7 +291,7 @@ static void aer_set_firmware_first(struct pci_dev *pci_dev) rc = apei_hest_parse(aer_hest_parse, &info); - if (rc) + if (rc || pcie_ports_native) pci_dev->__aer_firmware_first = 0; else pci_dev->__aer_firmware_first = info.firmware_first; @@ -327,6 +327,9 @@ bool aer_acpi_firmware_first(void) apei_hest_parse(aer_hest_parse, &info); aer_firmware_first = info.firmware_first; parsed = true; + if (pcie_ports_native) + aer_firmware_first = 0; + } return aer_firmware_first; }