Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp822466pxb; Thu, 21 Oct 2021 10:07:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykTfmJx0iLgo7JR7AboH3den2zO9KeO7lNUkd9FfAMUWGkkoSHkYdlhuv6qF0gFDNzH+82 X-Received: by 2002:a17:907:7656:: with SMTP id kj22mr1454326ejc.191.1634836070258; Thu, 21 Oct 2021 10:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634836070; cv=none; d=google.com; s=arc-20160816; b=hWgWujQFAiZpvHAzBv+2EjOi0Zd6NBOIdFzyJyb6v707C0lfGaimOq0Pukir8sPYNK vS0xVFp39m30FNvMj/SqeQk4jMNrc0VcOnhXLrow0XrJwBFvzxBnA272axWK7PvJr3Wo zVnnCKTFNX2eSNo1T1R1OcZdOJhYv6ICF2jHqhdHYnawQmXWZHYjM6mDTMofVZyF9aQV 8Xy0wTEOTHBGN2ymmQBGOfs0R5cxqcgHfYQ+81VCqQmDeaWXd91F66gIKNe47tJGnMkl kuJ3ENklstTVuBuLvJ0vrDUk6DCVeP1JbB/5ZdFD5CoSm8hCyshaXpI2qtERwGnyvs1o oaig== 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-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=kD1FWUiznJaDYiwskDPRYi0lmsordQMUxVRp2YQLluU=; b=D3n8LmhIlukstDi6B9Tx52+xDAYOLCnvT89VSB/HlaVCc3s0E1GGYGjCcbRTVx8Ikv 7nO82L7b2mcB9FY912/gNBcp0n+lEWjpamVDd2D/GBoU+Cp+02acLfRDqIr94MOwLsTk pqo1cJQt5x7EdmXKLKW88FzFtjNEVdQyvU3jmTTP3HUhVWTyJdrAN9X1hgDhmlylQaHC 3zP3E16kV6UyLIcydKdvnzV+5q1Oduf5s8S/a0A9ejxg6P8X5V5uL+MQLZRKhHyj2Dsf mJaq43DV/7JGvP67goBfNXTglUcGeqV1QdrM0PoVGyu8GUKdffO50ke2D9I5Ws8whNfe jijw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LGWfVvzc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id eb9si11793323edb.13.2021.10.21.10.07.26; Thu, 21 Oct 2021 10:07:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LGWfVvzc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232206AbhJURHh (ORCPT + 99 others); Thu, 21 Oct 2021 13:07:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:37136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232209AbhJURHZ (ORCPT ); Thu, 21 Oct 2021 13:07:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 32DF2613B3; Thu, 21 Oct 2021 17:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634835909; bh=Mtct3V9y7jFFGgbR+ibjjD7+N+gDCqWxEZbjvas13mE=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=LGWfVvzcHqc8yQRJdodC7oDOcxJa32yTi9zRNrtDJvhOqGMa33dLI9a+bTB6H7xVF 3NIyDQY/V5AjyMn0KbJ6Y3vzJ4/3zT0mNXb7IUaA6ac7bA/biJYzZ8WisOIonkmIW2 pcIkW73ffcBFKh571ioLdytq1cKNVR50zmV2lqNVxI3bnDA57aHYZE4UxJxVHH+M0U Qgrp2YS3GjymAg2qWmq0xbWuyG4XvQVqlD36Xcx/4r6WIc45uQ9u+woEonta5J+uKD 40EcCk+7QaQXGDAg9yysbvDvVBEavfT+E5Zd0kdII6HLOAnfv2mC0CES5d+3dL0NAl X7mnuyXpi0mSw== Date: Thu, 21 Oct 2021 12:05:07 -0500 From: Bjorn Helgaas To: Naveen Naidu Cc: bhelgaas@google.com, ruscur@russell.cc, oohall@gmail.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH v4 4/8] PCI/DPC: Use pci_aer_clear_status() in dpc_process_error() Message-ID: <20211021170507.GA2701463@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211021163611.rsfmberxw6dqn5gx@theprophet> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 21, 2021 at 10:06:11PM +0530, Naveen Naidu wrote: > On 20/10, Bjorn Helgaas wrote: > > On Tue, Oct 05, 2021 at 10:48:11PM +0530, Naveen Naidu wrote: > > > dpc_process_error() clears both AER fatal and non fatal status > > > registers. Instead of clearing each status registers via a different > > > function call use pci_aer_clear_status(). > > > > > > This helps clean up the code a bit. > > > > > > Signed-off-by: Naveen Naidu > > > --- > > > drivers/pci/pcie/dpc.c | 3 +-- > > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > > > diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c > > > index df3f3a10f8bc..faf4a1e77fab 100644 > > > --- a/drivers/pci/pcie/dpc.c > > > +++ b/drivers/pci/pcie/dpc.c > > > @@ -288,8 +288,7 @@ void dpc_process_error(struct pci_dev *pdev) > > > dpc_get_aer_uncorrect_severity(pdev, &info) && > > > aer_get_device_error_info(pdev, &info)) { > > > aer_print_error(pdev, &info); > > > - pci_aer_clear_nonfatal_status(pdev); > > > - pci_aer_clear_fatal_status(pdev); > > > + pci_aer_clear_status(pdev); > > > > The commit log suggests that this is a simple cleanup that doesn't > > change any behavior, but that's not quite true: > > > > - The new code would clear PCI_ERR_ROOT_STATUS, but the old code > > does not. > > > > - The old code masks the status bits with the severity bits before > > clearing, but the new code does not. > > > > The commit log needs to show why these changes are what we want. > > > > Reading through the code again, I realize how wrong(stupid) I was when > making this patch. I was thinking that: > > pci_aer_clear_status() = pci_aer_clear_fatal_status() + pci_aer_clear_nonfatal_status() > > Now I understand, that it is not at all the case. I apologize for the > mistake. I'll make sure to be meticulous while reading functions and not > just assume their behaviour just from their function names. No problem, one could argue that the collection of pci_aer_clear_*() functions that do slightly different things is itself a defect.