Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1366349rwl; Fri, 7 Apr 2023 14:56:22 -0700 (PDT) X-Google-Smtp-Source: AKy350b623QbiQN05evPSz0mo2Ob8yBgeuvSJ4XZ+RKYKr44PfEbeVTgpb3au9+dBe51Uu8iXWG/ X-Received: by 2002:aa7:c488:0:b0:4fc:e605:556a with SMTP id m8-20020aa7c488000000b004fce605556amr2503891edq.5.1680904582277; Fri, 07 Apr 2023 14:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680904582; cv=none; d=google.com; s=arc-20160816; b=HtsupQIcUOCUtp9Z2Fu0hbyHBaqKMEmNniCdZYmW6dsc95VtM4HNP86qBuwebqYLtX dN2pE/7b078yb4q6YAw0PlFvFSojw4sK/mX2sy1lUlHJ301qiDTGJV3O6rouBU0eh1uu nOWgI1gkyUQytqkGiUpOIv4GcorfGpqF+dkZDKLaZ8SuhqUUnBYOsvPxUXybbeRB/eNd gd48voj7QBHWO/9btDajcNHxINgD0mhPNWBYqolJYF9cd2MextxaYHPYcjoqHkkRsNs2 jZ8yTh/K2kqMV0BSu/8sn8RtsbH3sQ9fB4BbxvwElpv7OUBdUW+149x7suXCCBeMKg7D CeYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=BL/GAvsh0JwRBzm3U1kxXAMlNZg1zDcgbzWN6tx8JkE=; b=vLvYETN7hqjfpdBNLOc8Iuv6zLbZ4soD/kVj7ukv9RuobnuVvRfBSV2uXHy4XzGfJ4 kMojVvVB6syvI82BB2fxJo2r9pGbxVWuz4yuZPLowyaxEHW3gy3Srycr5I+x/x6hdtI1 i2DD5TFK0FL8HJCZ83ibRs7T+ERQGypwiXd7mHOlivvz7C63OaYCB6usyMU8k2v+vvex sCHuBtV32HqBJKUk+gY+ZwoBdh2NtvKm1VrAxgslviAGpwedZOK3eXCOOd4tWzLBBn0e JAsiwRrfVZQ4vauesk5MLl0ZZaMSiJIs5VLPQO5pFMBGpxQpklkLjMYkjSumLiG0Xu79 jbyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TmvDC25p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ba11-20020a0564021acb00b004ace62d6ea3si789586edb.519.2023.04.07.14.55.57; Fri, 07 Apr 2023 14:56:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TmvDC25p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230330AbjDGVvt (ORCPT + 99 others); Fri, 7 Apr 2023 17:51:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231271AbjDGVvr (ORCPT ); Fri, 7 Apr 2023 17:51:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AC54C679; Fri, 7 Apr 2023 14:51:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C7F0A64465; Fri, 7 Apr 2023 21:51:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2AEEC433D2; Fri, 7 Apr 2023 21:51:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680904304; bh=KKX2qukbqARKziXpZ5Z77M5yQRvkEtvdiQIqFTYCZsU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=TmvDC25psL77z4S32BHtlD52ALcXUQU7psLxZkr5GV0/1iiTvsnGI9O9E+ck5bgAh ktNAF0oGPXsSk0A880Ejp3W/uD9Fuq9TD3GYJkxNn2s3W2I0aWsdk3Kq4LxIqWCnNP SFV+MFsfr6DZYVwYftXClzshWRAbpW/1uS5paeq7GGJl7VcnmotJ0yvoQ38RJ0Yru2 eDrf0LizhpEHB6cZ2azrbbGPVGaKjILcGcn8lyshCvUHCrNExe2oABhOBqvraFfMPr caWL0GZdjaS3mrrGB2q4gI838qrdSBTkr7VN68Z321xRgAvPtRy+1DbJZ5QIDJkdUo xTC6ZbmhlnI/Q== Date: Fri, 7 Apr 2023 16:51:42 -0500 From: Bjorn Helgaas To: Kuppuswamy Sathyanarayanan Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Cameron , "Natu, Mahesh" Subject: Re: [PATCH v2] PCI/EDR: Clear PCIe Device Status errors after EDR error recovery Message-ID: <20230407215142.GA3825302@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230315235449.1279209-1-sathyanarayanan.kuppuswamy@linux.intel.com> X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEXHASH_WORD,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+cc Jonathan, Mahesh] On Wed, Mar 15, 2023 at 04:54:49PM -0700, Kuppuswamy Sathyanarayanan wrote: > Commit 068c29a248b6 ("PCI/ERR: Clear PCIe Device Status errors only if > OS owns AER") adds support to clear error status in the Device Status > Register(DEVSTA) only if OS owns the AER support. But this change > breaks the requirement of the EDR feature which requires OS to cleanup > the error registers even if firmware owns the control of AER support. > > More details about this requirement can be found in PCIe Firmware > specification v3.3, Table 4-6 Interpretation of the _OSC Control Field. > If the OS supports the Error Disconnect Recover (EDR) feature and > firmware sends the EDR event, then during the EDR recovery window, OS > is responsible for the device error recovery and holds the ownership of > the following error registers. > > • Device Status Register > • Uncorrectable Error Status Register > • Correctable Error Status Register > • Root Error Status Register > • RP PIO Status Register > > So call pcie_clear_device_status() in edr_handle_event() if the error > recovery is successful. > > Reported-by: Tsaur Erwin > Signed-off-by: Kuppuswamy Sathyanarayanan Sorry I spent so much time on this, but I finally applied it to pci/aer for v6.4. I added the "Fixes: 068c29a248b6" line. It's not that 068c29a248b6 is a bug, just that EDR relied on behavior that 068c29a248b6 legitimately removed, so this patch should go where 068c29a248b6 goes. I wordsmithed the commit log to add hints about things I stumbled over. I'll post a follow-up patch to add a couple comments there, too. Thanks for your patience in educating me through all this. > --- > > Changes since v1: > * Rebased on top of v6.3-rc1. > * Fixed a typo in pcie_clear_device_status(). > > drivers/pci/pcie/edr.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/pci/pcie/edr.c b/drivers/pci/pcie/edr.c > index a6b9b479b97a..87734e4c3c20 100644 > --- a/drivers/pci/pcie/edr.c > +++ b/drivers/pci/pcie/edr.c > @@ -193,6 +193,7 @@ static void edr_handle_event(acpi_handle handle, u32 event, void *data) > */ > if (estate == PCI_ERS_RESULT_RECOVERED) { > pci_dbg(edev, "DPC port successfully recovered\n"); > + pcie_clear_device_status(edev); > acpi_send_edr_status(pdev, edev, EDR_OST_SUCCESS); > } else { > pci_dbg(edev, "DPC port recovery failed\n"); > -- > 2.34.1 >