Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3828500imm; Mon, 2 Jul 2018 06:22:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK5D0WmNFKgQU40OuVHBedao4HhKNENyNVm+VhxYD5qf72HWYswsJB7oWjj2vkgyBk3JmQN X-Received: by 2002:a17:902:6b09:: with SMTP id o9-v6mr25448760plk.256.1530537723067; Mon, 02 Jul 2018 06:22:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530537723; cv=none; d=google.com; s=arc-20160816; b=SC+CYIuRc8QWf7VDXrtoVSZ8BzIh7MTd2T4K1aY/JKBE4N08mINcuBWEJ7ZJrEJz8U eOFpjsldRbQy7ie1F9uVVuq0uDOcA1HYAm2DGNl5rnMHzdE8oqs/nrJDdoBzracFUJnq GDUbnIfFYLELjC3y+YON6LV05y6u4qMu7x+JiiYvr9CDYiBqFmGwNLS+jMSogzN7vO7P LuRAqqcrC+rzGSrpCoIEiblkyzVgbT6tes0rYMOUBJ071s19dPmoLMFPVEhnvfLAucog qry+mytmt3kbb5Sdx9dvsRBPIHZEIEZsVxM/7elPZOrb8ybVgWOv/KTEkNpQNN464Vpy VVGA== 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=z/HhVeyCgyyrqpiBRg/3dT5E1CJxuyi0dt6MYihWtCU=; b=x8lEvqXflHmAatdShssV6bloXTMedbnE4OsK7hZ8sLgtyM2SyxE90c7SJgdXa0tPmN kL69FHTTzDJHKOPUS2VenvOPop66fknRaJZ1sdKcw8RHEiXaR7G18WlLuKLmYZ9kIyfa hA7G0QdDz9ejTTxj4yOy0a+4rmloVATaBPcOUD8LaE/ZFBk0qRx23JHN8e4A5lWbQE66 YgJ0BBojqeFfWDp4zoyHir481U55IvqY/1rqOKGNkF9OUQD6zfuawaLTIp/ZlNKaTof1 OxL0di1BtuwZ6OCacdEl7csQm6dsdXX1LYwrNezoI05kd4QEh+IGtGCS3z571FVFzggu Lm9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oXL9ENka; 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 z73-v6si14631179pgz.284.2018.07.02.06.21.33; Mon, 02 Jul 2018 06:22:03 -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=oXL9ENka; 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 S1752575AbeGBNT3 (ORCPT + 99 others); Mon, 2 Jul 2018 09:19:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:60814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751279AbeGBNTZ (ORCPT ); Mon, 2 Jul 2018 09:19:25 -0400 Received: from localhost (173-25-171-118.client.mchsi.com [173.25.171.118]) (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 AA2DB2154C; Mon, 2 Jul 2018 13:19:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1530537564; bh=GkXS6+YoD3lJWCoyDMzFG0WFb9c1x9rm7mnG+MQD1zc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oXL9ENkax/jE7XE0Y2rLt30S46KY3G0ixQQ8yGvMtZiaLDCLx+uCxr6Bh92Ygl2B2 9KU9394sD4A4DFZTDYxoEPxUQ247kwd/YdE0IYxVz4e/NJso6tasta1NhMVKP9a8+K BZp6UQ6UTs8zOkrpv9kgvBtZL0JW7r8oqNgPzgqk= Date: Mon, 2 Jul 2018 08:19:23 -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 , Greg Kroah-Hartman , Oza Pawandeep , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] PCI/AER: Fix aerdrv loading with "pcie_ports=native" parameter Message-ID: <20180702131923.GB15983@bhelgaas-glaptop.roam.corp.google.com> References: <20180619195835.5423-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180619195835.5423-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 Tue, Jun 19, 2018 at 02:58:20PM -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 | 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; Trivial comment for both of these hunks: if we test for pcie_ports_native *first*, we won't have to run apei_hest_parse(). It's fairly obvious that we ignore the result of apei_hest_parse() anyway, but I think it's a courtesy to the reader if we don't run it at all, so we don't have to worry about side effects. > + > } > return aer_firmware_first; > } > -- > 2.14.3 >