Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3802639imw; Mon, 11 Jul 2022 16:32:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uyIEpGp4I3BDkLpWci6vP04DJUFlBvWsLkLBhTBZuhpwAt1o9FoBwyIOuv8cFPhI1kMR/I X-Received: by 2002:a05:6402:c47:b0:437:ce2d:c30d with SMTP id cs7-20020a0564020c4700b00437ce2dc30dmr27876189edb.395.1657582373188; Mon, 11 Jul 2022 16:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657582373; cv=none; d=google.com; s=arc-20160816; b=SgHgXtqQ7piV4bSJEWrbwrM2TJeLk8xDHxt+J6dQLU+osyMWIupY4AdD48iNmZqMAu HlHbkw/RsWdI3szlFp+jh1uQsn6uvsfbtajjY+DhJ6AUbATOO6tv2q989gY7N66Iu+3T iuqWeJqXYpnaeCO6GFrE7zaGnHXIU8G6vtL0URZ9IlVyfi+Z/ehAf44OUk8Ydq5gvN7C rOA6b77JBJHae9VtHNFmidNbWd3Aol1XQEi/G/ysY+NHnuadVBm/nDoYaUMp1bkfG8ak X56WsmqZVWCfOx3cR8oQ2fuVEQq1CZpoIvfoIoxe8Zm68gMHd1WI4qjoy1zwa/Q8ITT4 x5Ww== 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 :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zQXYkIpLa/jRv8ngkizdneaBLdDBpj/gCgWHugoncaE=; b=Wdew0640SQMdNZp86Ktkn8XAPM3ypkz4JDCzKvLEVBZj2AoyTFrlZzjcZKWU2UAvE0 r3skZU4KZqNOXc+wpr2VQ3aA+bh9yHoeZl/wGQ4+Td/72pgpB6M2N+d8RUhQBDWg2ong xBabu0C2Mmyj2dHDYXopWjH8NrcKVZAWzTgQhp+OJrIk8w09mpfEWFm1mgtZzCyeqYrx deeb4EqJ2pgM+N80pDHYE5ko9czLdBAoOd4XhDZGgnFHXhmignH+zER63aO8DWe3qUXW 1D5azF4tVNLD6WGbDoflEDu4jr8Kw7507VFjcGj+Z2swsPPSQFq23HlgfzBmTcIgvkuA LBcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@purestorage.com header.s=google header.b="X/5PcPYq"; 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=REJECT sp=REJECT dis=NONE) header.from=purestorage.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id zo6-20020a170906ff4600b00712e4774584si11038041ejb.690.2022.07.11.16.32.28; Mon, 11 Jul 2022 16:32:53 -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=@purestorage.com header.s=google header.b="X/5PcPYq"; 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=REJECT sp=REJECT dis=NONE) header.from=purestorage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231466AbiGKXCT (ORCPT + 99 others); Mon, 11 Jul 2022 19:02:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231511AbiGKXCR (ORCPT ); Mon, 11 Jul 2022 19:02:17 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA0A08050C for ; Mon, 11 Jul 2022 16:02:13 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id y9so5969519pff.12 for ; Mon, 11 Jul 2022 16:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zQXYkIpLa/jRv8ngkizdneaBLdDBpj/gCgWHugoncaE=; b=X/5PcPYqGqKuus1jat1z2VDjmGnFRlWFHPH2K9MAZocdY+pZKAu34y993HN6SNVKmS cDtn7l1Vyb7XKJpemTGBWS9vphxKWpKMdthKiM0nSLVjl9DPUQq7HKuRKW3b3nLFnjU8 SBP0182OirwDB7BgZls6GFj1KXOhaFARIykUI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zQXYkIpLa/jRv8ngkizdneaBLdDBpj/gCgWHugoncaE=; b=3Hl/1IQkgowKgOBe9euQchUFJtKAU6DdFcDoXXBdy1OmQgXC5zKRTR1gq/Fq49yQvV TqE/76fpB4SqTn88yULCpPyIcB7VM+75HgkDZwgMUuy77ZIPWqyKlsJWcy5yzLOPspNj 18l7yqYBxq7kZsZsyKwdvdLqZzUfp1h9+1u7eh9RwY5mmXUhEwaWNaOx7yaDzMhSWQsf 9e4zgsBANBBgRYea7E/+PJNbkNg2Zvwohyno8ad/+JxgzQoUUADiR2gzHFMt1/xbvy/i IyrzbF46O4zP7YQ+N2VYFwIpkqmH5S4YaA6ZSmtZkOC+Qkxe0bcXo/2dlxnfPSGgktaR LO3g== X-Gm-Message-State: AJIora/PhEmAFp+azsJXE0UPRWNuWLTYl3IjQSinTa6QJCXR7w5u4++W hBBLui1fFnOLGzAq0G01QLP4TQ== X-Received: by 2002:a65:49c5:0:b0:412:6e3e:bd91 with SMTP id t5-20020a6549c5000000b004126e3ebd91mr18068217pgs.221.1657580533320; Mon, 11 Jul 2022 16:02:13 -0700 (PDT) Received: from medusa.lab.kspace.sh (c-98-207-191-243.hsd1.ca.comcast.net. [98.207.191.243]) by smtp.googlemail.com with ESMTPSA id y15-20020a655b0f000000b0040d75537824sm4735325pgq.86.2022.07.11.16.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 16:02:12 -0700 (PDT) Date: Mon, 11 Jul 2022 16:02:11 -0700 From: Mohamed Khalfella To: Bjorn Helgaas Cc: stable@vger.kernel.org, Meeta Saggi , Eric Badger , Russell Currey , Oliver O'Halloran , Bjorn Helgaas , "open list:PCI ENHANCED ERROR HANDLING (EEH) FOR POWERPC" , "open list:PCI SUBSYSTEM" , open list Subject: Re: [PATCH] PCI/AER: Iterate over error counters instead of error strings Message-ID: <20220711230211.GD3182270@medusa> References: <20220509181441.31884-1-mkhalfella@purestorage.com> <20220711225437.GA703490@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220711225437.GA703490@bhelgaas> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 2022-07-11 17:54:37 -0500, Bjorn Helgaas wrote: > On Mon, May 09, 2022 at 06:14:41PM +0000, Mohamed Khalfella wrote: > > PCI AER stats counters sysfs attributes need to iterate over > > stats counters instead of stats names. Also, added a build > > time check to make sure all counters have entries in strings > > array. > > > > Fixes: 0678e3109a3c ("PCI/AER: Simplify __aer_print_error()") > > Cc: stable@vger.kernel.org > > Reported-by: Meeta Saggi > > Signed-off-by: Mohamed Khalfella > > Reviewed-by: Meeta Saggi > > Reviewed-by: Eric Badger > > I added some info about why we need this to the commit log and applied > to pci/err for v5.20. Thank you! That is good news! Thank you for helping out. > > > --- > > drivers/pci/pcie/aer.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > > index 9fa1f97e5b27..ce99a6d44786 100644 > > --- a/drivers/pci/pcie/aer.c > > +++ b/drivers/pci/pcie/aer.c > > @@ -533,7 +533,7 @@ static const char *aer_agent_string[] = { > > u64 *stats = pdev->aer_stats->stats_array; \ > > size_t len = 0; \ > > \ > > - for (i = 0; i < ARRAY_SIZE(strings_array); i++) { \ > > + for (i = 0; i < ARRAY_SIZE(pdev->aer_stats->stats_array); i++) {\ > > if (strings_array[i]) \ > > len += sysfs_emit_at(buf, len, "%s %llu\n", \ > > strings_array[i], \ > > @@ -1342,6 +1342,11 @@ static int aer_probe(struct pcie_device *dev) > > struct device *device = &dev->device; > > struct pci_dev *port = dev->port; > > > > + BUILD_BUG_ON(ARRAY_SIZE(aer_correctable_error_string) < > > + AER_MAX_TYPEOF_COR_ERRS); > > + BUILD_BUG_ON(ARRAY_SIZE(aer_uncorrectable_error_string) < > > + AER_MAX_TYPEOF_UNCOR_ERRS); > > + > > /* Limit to Root Ports or Root Complex Event Collectors */ > > if ((pci_pcie_type(port) != PCI_EXP_TYPE_RC_EC) && > > (pci_pcie_type(port) != PCI_EXP_TYPE_ROOT_PORT)) > > -- > > 2.29.0 > >