Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E17AEC6FD1F for ; Wed, 15 Mar 2023 00:25:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbjCOAZP (ORCPT ); Tue, 14 Mar 2023 20:25:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbjCOAZK (ORCPT ); Tue, 14 Mar 2023 20:25:10 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21C076E8B for ; Tue, 14 Mar 2023 17:25:03 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id m18-20020a05600c3b1200b003ed2a3d635eso100159wms.4 for ; Tue, 14 Mar 2023 17:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1678839901; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=PBNqRKvFHgPqqskaybm027VBSueaOqeOTv7uwJBWtdQ=; b=ZiLxIon1u+rmZiqod8EddJ1NTtYuick9y4S5J3gIzNVwzhoPs8cNYgm0UcpTqZd4GC WXyLUpKm39+drChF4demvnBD117++Ok1xOZEphRRiTuqZJAZGaXrEFYLbNHbNkMZefuo ULsB9cCkVr8xwkt81Ow4eHlVoH0pkdxniF+lc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678839901; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PBNqRKvFHgPqqskaybm027VBSueaOqeOTv7uwJBWtdQ=; b=7TrQaNb7msbnrbhDg2FSNqbymG/jsEfVcgYRt+lKeO0Z8Bf2hI0AXMZuUgHgtsh+LX KLxpD/9ZP6LU2smAKSjkNrJIp8oVP2QwGcenGY6GuoUsCbV5fWbLbkOjzbYHKf6hICeO HsK0TpHMSDVWEBqK7zveztbw25+CA12lz4T0LkJCAFqqwyRzv3nWXPgeJh57LinOzIqm 7bkYaXzRQt3IuPxc6fosrJVi3pO+CSAf1cRswl9yBtgpwUd6YdxPobErPLveceOQYCA5 EuJ+1r6NbV0MfYugShg7U1AygRh9EEdsug4awzqX0qF4r5135bz4vccbjPCv7kECaDYc CxIg== X-Gm-Message-State: AO0yUKVVU709rmqCGCij75z7PEA+77zHToskOZdboROY84yYOuk5rcF6 Ievu+w7LdxrPIl7JcUh44r1JbD8mxNZ1isMImIZg2g== X-Google-Smtp-Source: AK7set/m4nESElQsgLmaw1biuRQY8j6mcZEJlWhUB+r9v2P1fMoQCuNEmhEy6d2bWp46oRQ6Y14VPSx4Kv3vqwW2Crw= X-Received: by 2002:a05:600c:512a:b0:3ed:26fa:6ee5 with SMTP id o42-20020a05600c512a00b003ed26fa6ee5mr2238902wms.4.1678839901419; Tue, 14 Mar 2023 17:25:01 -0700 (PDT) MIME-Version: 1.0 References: <20230301060453.4031503-1-grundler@chromium.org> <20230314193836.GA1667748@bhelgaas> In-Reply-To: <20230314193836.GA1667748@bhelgaas> From: Grant Grundler Date: Tue, 14 Mar 2023 17:24:49 -0700 Message-ID: Subject: Re: [PATCH] PCI/AER: correctable error message as KERN_INFO To: Bjorn Helgaas Cc: Grant Grundler , Mahesh J Salgaonkar , "Oliver O 'Halloran" , Bjorn Helgaas , Rajat Khandelwal , linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Rajat Jain Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 14, 2023 at 12:38=E2=80=AFPM Bjorn Helgaas = wrote: > > On Tue, Feb 28, 2023 at 10:04:53PM -0800, Grant Grundler wrote: > > Since correctable errors have been corrected (and counted), the dmesg o= utput > > should not be reported as a warning, but rather as "informational". > > > > Otherwise, using a certain well known vendor's PCIe parts in a USB4 doc= king > > station, the dmesg buffer can be spammed with correctable errors, 717 b= ytes > > per instance, potentially many MB per day. > > > > Given the "WARN" priority, these messages have already confused the typ= ical > > user that stumbles across them, support staff (triaging feedback report= s), > > and more than a few linux kernel devs. Changing to INFO will hide these > > messages from most audiences. > > > > Signed-off-by: Grant Grundler > > --- > > This patch will likely conflict with: > > https://lore.kernel.org/all/20230103165548.570377-1-rajat.khandelwal@= linux.intel.com/ > > > > which I'd also like to see upstream. Please let me know to resubmit > > mine if Rajat's patch lands first. Or feel free to fix up this one. > > Yes. I think it makes sense to separate this into two patches: > > 1) Log correctable errors as KERN_INFO instead of KERN_WARNING, and > 2) Rate-limit correctable error logging. I'm going to look into your comment below. I'll port Rajat's patch on top of mine to follow the order you've listed above. > > drivers/pci/pcie/aer.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > > index f6c24ded134c..e4cf3ec40d66 100644 > > --- a/drivers/pci/pcie/aer.c > > +++ b/drivers/pci/pcie/aer.c > > @@ -692,7 +692,7 @@ static void __aer_print_error(struct pci_dev *dev, > > > > if (info->severity =3D=3D AER_CORRECTABLE) { > > strings =3D aer_correctable_error_string; > > - level =3D KERN_WARNING; > > + level =3D KERN_INFO; > > } else { > > strings =3D aer_uncorrectable_error_string; > > level =3D KERN_ERR; > > @@ -724,7 +724,7 @@ void aer_print_error(struct pci_dev *dev, struct ae= r_err_info *info) > > layer =3D AER_GET_LAYER_ERROR(info->severity, info->status); > > agent =3D AER_GET_AGENT(info->severity, info->status); > > > > - level =3D (info->severity =3D=3D AER_CORRECTABLE) ? KERN_WARNING = : KERN_ERR; > > + level =3D (info->severity =3D=3D AER_CORRECTABLE) ? KERN_INFO : K= ERN_ERR; > > > > pci_printk(level, dev, "PCIe Bus Error: severity=3D%s, type=3D%s,= (%s)\n", > > aer_error_severity_string[info->severity], > > Shouldn't we do the same in the cper_print_aer() path? That path > currently uses pci_err() and then calls __aer_print_error(), so the > initial message will always be KERN_ERR, and the decoding done by > __aer_print_error() will be KERN_INFO (for correctable) or KERN_ERR. I was completely unaware of this since it's not causing me any immediate problems. But I agree the message priority should be consistent for correctable errors. > Seems like a shame to do the same test in three places, but would > require a little more refactoring to avoid that. I don't mind doing the same test in multiple places. If refactoring this isn't straight forward, I'll leave the refactoring for someone more ambitious. :D cheers, grant > > Bjorn