From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88E4CCA4A; Tue, 6 Feb 2024 17:23:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707240217; cv=none; b=W+NRZ+NbhvI6LkVxj25VuVzbT6bhH9pEyLGEyYuHKp8kyj0CisKCFo3AfoSS34wZtBlDHyTkollysPsYrt66B6rULPmCtx4BO2wsJ5XVIy8DiM9YRN34EW6q3ZiDFJqUG0njBOHACavmpRRg9whkJEW+vs5ebUcJ3iT9F5L3A1k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707240217; c=relaxed/simple; bh=po8vFxWrgnIMI30IcGK3wKjOx+diDmMTZZJBoYh+eQs=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=ptp/Ub1Vh+vRM3vexZNK4ipHEDE4MBnoiODARqM4nuUtT/wjZ76mPTUIrQIrF+NnmC6p2iZs6KhXvKQInMbbFWjvX9gXMgBQ/zzosX3e0m+o4wVJzj3LBZJ2llRSs9BwTTv91vEvUg1DrR7Ikdkklf/tDOvTariT/aj0KJcAzu0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VbH/xjJY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VbH/xjJY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C145DC433F1; Tue, 6 Feb 2024 17:23:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707240217; bh=po8vFxWrgnIMI30IcGK3wKjOx+diDmMTZZJBoYh+eQs=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=VbH/xjJYNUgcSHYX8q6R3XOgMBMYdLFz0wwh7u9in+aDxvfieDaQsfcKyvc8IJljm b4KjHmApQTFpV3dO3iDbgzIq452iChe4Hlh+NbWkOfvbUZAwcqMJKOmdrdWJDvx820 yGKAU6o3UzpUqJtxSEDdVVdgjfhrjOOzt539Zz72GbRfzqXZni2RnBmRWm0weRDqIa abarX5VsT/PfIoUpx71JSSklbKAA2HtBv69vFwRwxqV13L9xCWMblKCxtAmGpAIqwi 8sqKs24ZwA9C+e3TEvivW9S6Jps4z6qQAk8w70V+oieQDehciCMb6nvmk5plKPIwiL i1EveBd1FnZ6A== Date: Tue, 6 Feb 2024 11:23:35 -0600 From: Bjorn Helgaas To: "Wang, Qingshun" Cc: linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-acpi@vger.kernel.org, chao.p.peng@linux.intel.com, erwin.tsaur@intel.com, feiting.wanyan@intel.com, qingshun.wang@intel.com, "Rafael J. Wysocki" , Len Brown , James Morse , Tony Luck , Borislav Petkov , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Bjorn Helgaas , Mahesh J Salgaonkar , Oliver O'Halloran , Miaohe Lin , Shiju Jose , Adam Preble , Li Yang , Lukas Wunner , Kuppuswamy Sathyanarayanan , Smita Koralahalli , Robert Richter , linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, linux-edac@vger.kernel.org Subject: Re: [PATCH v2 1/4] PCI/AER: Store more information in aer_err_info Message-ID: <20240206172335.GA872811@bhelgaas> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2rfnevhnhylik4r6smr56uunsxweo7s5elo65sjhiztvxnr6bq@5fcyv22zxyyp> On Wed, Feb 07, 2024 at 12:41:41AM +0800, Wang, Qingshun wrote: > On Mon, Feb 05, 2024 at 05:12:31PM -0600, Bjorn Helgaas wrote: > > On Thu, Jan 25, 2024 at 02:27:59PM +0800, Wang, Qingshun wrote: > > > When Advisory Non-Fatal errors are raised, both correctable and > > > uncorrectable error statuses will be set. The current kernel code cannot > > > store both statuses at the same time, thus failing to handle ANFE properly. > > > In addition, to avoid clearing UEs that are not ANFE by accident, UE > > > severity and Device Status also need to be recorded: any fatal UE cannot > > > be ANFE, and if Fatal/Non-Fatal Error Detected is set in Device Status, do > > > not take any assumption and let UE handler to clear UE status. > > > > > > Store status and mask of both correctable and uncorrectable errors in > > > aer_err_info. The severity of UEs and the values of the Device Status > > > register are also recorded, which will be used to determine UEs that should > > > be handled by the ANFE handler. Refactor the rest of the code to use > > > cor/uncor_status and cor/uncor_mask fields instead of status and mask > > > fields. > > > > There's a lot going on in this patch. Could it possibly be split up a > > bit, e.g., first tease apart aer_err_info.status/.mask into > > .cor_status/mask and .uncor_status/mask, then add .uncor_severity, > > then add the device_status bit separately? If it could be split up, I > > think the ANFE case would be easier to see. > > Thanks for the feedback! Will split it up into two pacthes in the next > version. Or even three: 1) tease apart aer_err_info.status/.mask into .cor_status/mask and .uncor_status/mask 2) add .uncor_severity 3) add device_status Looking at this again, I'm a little confused about 2) and 3). I see the new read of PCI_ERR_UNCOR_SEVER into .uncor_severity, but there's no actual *use* of it. Same for 3), I see the new read of PCI_EXP_DEVSTA, but AFAICS there's no use of that value. We should have the addition of these new values in the same patch that *uses* them. Bjorn