Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1355504imm; Tue, 3 Jul 2018 09:41:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK6fXxmpJ+C/A3Zfqgs+ZhqfWfxE3ebAGKCliIFg3ZZ4wnzAovgfpYVLWJoOX+SzORkHD11 X-Received: by 2002:a17:902:201:: with SMTP id 1-v6mr31389820plc.310.1530636060795; Tue, 03 Jul 2018 09:41:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530636060; cv=none; d=google.com; s=arc-20160816; b=NP/rtlKeQJd0GsmzoF2lpPvmVNkEhv5ax4CZDKVBSF9Bi1zfe+dJKnpmrfDr5sA1Xl yrIDiHnmGpa9GsGQJRNWVNMY6dWt9W84SIJVMdhLt/b75k5ffP9bo63aSLH1W9sVMe1c YrwSfuRlwmWfk1Uwo1TJp21JmjVwwh1BAIYEd2e5wtQZzV5mTWG1r1DDJ7fkkOpAQPIs AQPySuO5FMvzofH/OUHF+rj8LdTLg+fDralGjgzx0bhsyRsYoIywOnuSRY5GLqXIW7Nx R/JWd1e3nP+FNdb58MoL4CC0TscS9AdiakCf418Hc+BoL3z1/7VmNP9QqulhyoahA4rh v0hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Dmp2VF/uwIRpkhRHwhNUqrg85fGn3gjFkD/tuuT5+ww=; b=fkoNTAy7oldxA+lszMzZEbaC9el94Q3I2tCDmIJeO+OTepQh23ah58CJ7MOUS/fmke c4w5oYCN3d/SsU1u5S16OE0p2+EHhlvA6R2L3oSiB3S79WAd3PedLO6hKwiqYLfVkcC3 aKuWcSfKdjZplu7bUt85e9e51+rVxy8m/PnzXSnnRdk20PlQY4a/VPLcSQOxqXCe8Cbw 5mRuAQkbN5ZRqDBHwVJFYpTtfoepc4+/1G958srEOcu0pmxzNOYNigZYN1pJMP9Rfcw0 2HcLqeZmdLf+TjN/SMLigFR6nTCvCkuRZCuvGnKGiOyEzImeSn457Mnb1vRp2ayB9K5G kQDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yrW3eV6s; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l190-v6si1275906pgd.626.2018.07.03.09.40.45; Tue, 03 Jul 2018 09:41:00 -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=@kernel.org header.s=default header.b=yrW3eV6s; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933982AbeGCQi7 (ORCPT + 99 others); Tue, 3 Jul 2018 12:38:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:37148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934036AbeGCQi5 (ORCPT ); Tue, 3 Jul 2018 12:38:57 -0400 Received: from localhost (12.sub-174-217-46.myvzw.com [174.217.46.12]) (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 41AD121EF7; Tue, 3 Jul 2018 16:38:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1530635936; bh=5Z9tJ64KJn34racWZCN+Peh1gYkUkSRMIOQdTB0x6lc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yrW3eV6sk7qo8cFM18cBNO/J50WFJ/oBly+3zKV5xBThsZsnxRWKAjytcnxm1zqCX d1Dgwq5eNh1wXBKUTWFdwWR8uZV5SYk0jh25smsO/NtqbxXNo/k6Bdq8Qm9ZGVoL8S VtpEGZ5zFpJsl4+N8sjRP5indP+WuMc8yZUkbL9E= Date: Tue, 3 Jul 2018 11:38:54 -0500 From: Bjorn Helgaas To: Alexandru Gagniuc Cc: bhelgaas@google.com, keith.busch@intel.com, alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, Frederick Lawler , Oza Pawandeep , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] PCI/AER: Fix aerdrv loading with "pcie_ports=native" parameter Message-ID: <20180703163854.GA61685@bhelgaas-glaptop.roam.corp.google.com> References: <20180702131923.GB15983@bhelgaas-glaptop.roam.corp.google.com> <20180702161611.2048-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180702161611.2048-1-mr.nuke.me@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 02, 2018 at 11:16:01AM -0500, Alexandru Gagniuc wrote: > 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 | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > index a2e88386af28..db2c01056dc7 100644 > --- a/drivers/pci/pcie/aer.c > +++ b/drivers/pci/pcie/aer.c > @@ -283,13 +283,14 @@ static int aer_hest_parse(struct acpi_hest_header *hest_hdr, void *data) > > static void aer_set_firmware_first(struct pci_dev *pci_dev) > { > - int rc; > + int rc = 0; > struct aer_hest_parse_info info = { > .pci_dev = pci_dev, > .firmware_first = 0, > }; > > - rc = apei_hest_parse(aer_hest_parse, &info); > + if (!pcie_ports_native) > + rc = apei_hest_parse(aer_hest_parse, &info); > > if (rc) > pci_dev->__aer_firmware_first = 0; > @@ -324,7 +325,9 @@ bool aer_acpi_firmware_first(void) > }; > > if (!parsed) { > - apei_hest_parse(aer_hest_parse, &info); > + if (!pcie_ports_native) > + apei_hest_parse(aer_hest_parse, &info); > + > aer_firmware_first = info.firmware_first; > parsed = true; > } I was thinking something along the lines of the patch below, so we don't have to work through the settings of "rc" and "info". But maybe I'm missing something subtle? One subtle thing that I didn't look into is the pcie_aer_get_firmware_first() stub for the non-CONFIG_ACPI_APEI case. diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index b24f2d252180..5ccbd7635f33 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -342,6 +342,9 @@ int pcie_aer_get_firmware_first(struct pci_dev *dev) if (!pci_is_pcie(dev)) return 0; + if (pcie_ports_native) + return 0; + if (!dev->__aer_firmware_first_valid) aer_set_firmware_first(dev); return dev->__aer_firmware_first; @@ -362,6 +365,9 @@ bool aer_acpi_firmware_first(void) .firmware_first = 0, }; + if (pcie_ports_native) + return false; + if (!parsed) { apei_hest_parse(aer_hest_parse, &info); aer_firmware_first = info.firmware_first;