From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF043C433DF for ; Tue, 16 Jun 2020 17:47:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83542207C4 for ; Tue, 16 Jun 2020 17:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592329654; bh=nAI/EXqUGCFU6KYEC9NHmbC/B5dpZ6ul/4PG6MVXr+A=; h=Date:From:To:Cc:Subject:In-Reply-To:List-ID:From; b=zS9Y2WudDE6jBtPxLtupicPN6+IOJOHKMxrQq3YvVysTGgilk6NmpoX0X2XOb6jfu X8Uj7cXwWOP6d2Kb4lTQujnlf/wkAcSybPbul0Fs3nvD1CZrFMq4j81RV1wCIcMVNL SbnOGYON+SNcS8i1uCEi1N/1Y4KBBhfpYsCdNkwE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730563AbgFPRre (ORCPT ); Tue, 16 Jun 2020 13:47:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:54216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbgFPRrd (ORCPT ); Tue, 16 Jun 2020 13:47:33 -0400 Received: from localhost (mobile-166-170-222-206.mycingular.net [166.170.222.206]) (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 E2DC62078D; Tue, 16 Jun 2020 17:47:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592329653; bh=nAI/EXqUGCFU6KYEC9NHmbC/B5dpZ6ul/4PG6MVXr+A=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Erm+poYvqcyDFKX5SnKcWjQucTKB8JxI7kkm62RnbC2A35qML7xh0SzVAf0/6GwE8 pRgkAwwhXV+eVzaN+sM5yi6qqJMMri+iHaN6SroYp7ydmKeHqmC3Nb8BWGVxqgmUYB RMhMl8DGZyOmYDZ7qEKwT5oRTsO6t52w7DiOU+C0= Date: Tue, 16 Jun 2020 12:47:31 -0500 From: Bjorn Helgaas To: Jonathan Cameron Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linuxarm@huawei.com, Lorenzo Pieralisi , Kuppuswamy Sathyanarayanan Subject: Re: [PATCH 1/2] PCI/AER: Do not reset the device status if doing firmware first handling. Message-ID: <20200616174731.GA1969609@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521173134.2456773-2-Jonathan.Cameron@huawei.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org [+cc Sathy] On Fri, May 22, 2020 at 01:31:33AM +0800, Jonathan Cameron wrote: > pci_aer_clear_device_status() currently resets the device status even when > firmware first handling is going on. In particular it resets it on the > root port. > > This has been discussed previously > https://lore.kernel.org/patchwork/patch/427375/. I don't think this reference is really pertinent, is it? That patch to b2c8881da764 changes pci_cleanup_aer_uncorrect_error_status() so it doesn't clear PCI_ERR_UNCOR_STATUS in "firmware-first" mode. But your patch only affects PCI_EXP_DEVSTA, not PCI_ERR_UNCOR_STATUS. > Signed-off-by: Jonathan Cameron > --- > drivers/pci/pcie/aer.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > index f4274d301235..43e78b97ace6 100644 > --- a/drivers/pci/pcie/aer.c > +++ b/drivers/pci/pcie/aer.c > @@ -373,6 +373,9 @@ void pci_aer_clear_device_status(struct pci_dev *dev) > { > u16 sta; > > + if (pcie_aer_get_firmware_first(dev)) > + return; This needs to be adjusted because pcie_aer_get_firmware_first() no longer exists after 708b20003624 ("PCI/AER: Remove HEST/FIRMWARE_FIRST parsing for AER ownership"). This will use the _OSC AER ownership bit to gate clearing of the status bits in the PCIe capability (not the AER capability). I think that's the right thing to do, but it's certainly not obvious from the _OSC description in the PCI Firmware Spec r3.2. I think we need a pointer to the ECN that clarifies this, i.e., sec 4.5.1 of: System Firmware Intermediary (SFI) _OSC and DPC Updates ECN, Feb 24, 2020, affecting PCI Firmware Specification, Rev. 3.2 https://members.pcisig.com/wg/PCI-SIG/document/14076 > pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &sta); > pcie_capability_write_word(dev, PCI_EXP_DEVSTA, sta); > } > -- > 2.19.1 >