Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp900187pxb; Tue, 19 Oct 2021 15:46:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBeCBooQO9WqYXWEOuNwMG6YYB+X0vLFdM0nDhQ8Csu2Jotg1XhPgO5b0FwS/cWh1fhztT X-Received: by 2002:a17:902:ed8c:b0:13f:136f:efb1 with SMTP id e12-20020a170902ed8c00b0013f136fefb1mr35558334plj.56.1634683565490; Tue, 19 Oct 2021 15:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634683565; cv=none; d=google.com; s=arc-20160816; b=P23eDp2WiQb50pQnl54XdUyY655ntvuqGoLZofekaLNyOLwu08HBPxC0QxLivfKetY WV6yOhFOak1l77bpx+eTYtejVgSNcUimBx3/VZbayQdvrKSSieAz0NWrwBtAvY0k5XMR RCK6q/5D/jKLxhEUZopcAJe80Y4Dyr0h31f8AOeEB7GwLX00wfFGgaBAwRR7pVGZ+6ng e4Zu+HGsGqcD4ts6ksZOhjjR0LnxiJDEZcqIhR+M8XXKiQ1cFDUnBKtexrvMHWYQ+7c3 Ba2f9OEF8WHugfRdZByZeAEm2cWiAkoNs2noxIloPXrop1b2/Ez18eXdu7GlxkFCg5N3 V7/g== 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=Nh8WBZyU2kWIUgWx5prTzCb9Q2BYtGbWaMQRKMh/2LY=; b=LWwqCHQNCoxdG8NYv2hIqZ0yJiim48Jy/Y3MLnnpLEfNdMZIXrpdHuItthF5DfwaVm CXzP575h6VhKVg72Jl+TG2//h50d1Qvy+rfT7lVHBQ1gnrhnx6dqxv+H7ManJzXjk2/z kaR7hMyB3az8fhILXcJEl1IC+QnuNuG2JWJDD0k/CE2rqXyha9pcWU+1zcPZdZJG1XaP I8S0SIb1CNLZFycn8jUmP8my3svtTxpQtNJY6GPNGMykbNEJRsxKX0iNiT/Kn2PYRlFD eP1upBZt/9luavWcuu+lERQsuTM48kAhQbWEKtAwV1ioXcwzIG7hrO+I9u0kjBaggYKQ /UyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=taEdq55I; 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 ij21si298499pjb.136.2021.10.19.15.45.51; Tue, 19 Oct 2021 15:46:05 -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=taEdq55I; 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 S229910AbhJSWqW (ORCPT + 99 others); Tue, 19 Oct 2021 18:46:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:49092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229899AbhJSWqV (ORCPT ); Tue, 19 Oct 2021 18:46:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3854361154; Tue, 19 Oct 2021 22:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634683448; bh=/g+wgF+JF3O4Y6H7+V152kAnH9oMhD3tFztz/AZaDXg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=taEdq55I88noCQArDJFBVRb0y+GQm4nLIF+JwfjphkxyTiBMTKaqaVO1LMP9l6ipk 4xcojsdBrhqBwSlCLOoC0rFkNH5do224KYikvGw/YgXbOOUG/LlgwrLUAOxjU2648E FByVYoLxGsqr66Oyr72t+89CrEGLH7+J62Xy8LLgTjjBeQS8te+R29y0rTaJBjOqp5 CUMVsVLQb8lX/+nf714wjxSPC226yspKH3RO87A9Oj9n/TSyaJKuNbeUez6meaXdTM /io3xit3dWXLz/TUpP3Ut6yydOTJ9rHukCFP10z1FZeJqbn5tgrojmQW2aynd9qglr lUXhh4/tVJqyw== Date: Tue, 19 Oct 2021 17:44:06 -0500 From: Bjorn Helgaas To: Naveen Naidu Cc: bhelgaas@google.com, tsbogend@alpha.franken.de, ruscur@russell.cc, oohall@gmail.com, linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH 1/6] PCI/AER: Enable COR/UNCOR error reporting in set_device_error_reporting() Message-ID: <20211019224406.GA2414443@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 04, 2021 at 11:29:27PM +0530, Naveen Naidu wrote: > The (PCIe r5.0, sec 7.6.4.3, Table 7-101) and (PCIe r5.0, sec 7.8.4.6, > Table 7-104) s/7.6.4.3/7.8.4.3/ Cite it like this: Per PCIe r5.0, sec 7.8.4.3 and sec 7.8.4.6, the default values ... > states that the default values for the Uncorrectable Error > Mask and Correctable Error Mask should be 0b. But the current code does > not set the default value of these registers when the PCIe bus loads the > AER service driver. The defaults specified here are for hardware designers -- this is what the registers must contain after power-up or reset. This section of the spec isn't telling us what the OS is required to write. If we want to clear these masks, I think we have to: 1) Analyze every other place that writes the masks to make sure we don't break any of them. There aren't very many, and most of them are in drivers, which would be after the aer_probe() path. There might be a conflict with program_hpx_type2(), though. 2) Make it dependent on pcie_aer_is_native(). Ownership of the AER capability can be retained by the platform, in which case the OS shouldn't touch it. > Enable reporting of all correctable and uncorrectable errors during > aer_probe() > > Signed-off-by: Naveen Naidu > --- > drivers/pci/pcie/aer.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > index 9784fdcf3006..88c4ca6098fb 100644 > --- a/drivers/pci/pcie/aer.c > +++ b/drivers/pci/pcie/aer.c > @@ -1212,6 +1212,7 @@ static int set_device_error_reporting(struct pci_dev *dev, void *data) > { > bool enable = *((bool *)data); > int type = pci_pcie_type(dev); > + int aer = dev->aer_cap; > > if ((type == PCI_EXP_TYPE_ROOT_PORT) || > (type == PCI_EXP_TYPE_RC_EC) || > @@ -1223,8 +1224,18 @@ static int set_device_error_reporting(struct pci_dev *dev, void *data) > pci_disable_pcie_error_reporting(dev); > } > > - if (enable) > + if (enable) { > + > + /* Enable reporting of all uncorrectable errors */ > + /* Uncorrectable Error Mask - turned on bits disable errors */ > + pci_write_config_dword(dev, aer + PCI_ERR_UNCOR_MASK, 0); > + > + /* Enable reporting of all correctable errors */ > + /* Correctable Error Mask - turned on bits disable errors */ > + pci_write_config_dword(dev, aer + PCI_ERR_COR_MASK, 0); > + > pcie_set_ecrc_checking(dev); > + } > > return 0; > } > -- > 2.25.1 > > _______________________________________________ > Linux-kernel-mentees mailing list > Linux-kernel-mentees@lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees