From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53DF4C4740A for ; Tue, 10 Sep 2019 11:10:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2688F207FC for ; Tue, 10 Sep 2019 11:10:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="YCiqv1qG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390960AbfIJLKY (ORCPT ); Tue, 10 Sep 2019 07:10:24 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:35286 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727816AbfIJLKY (ORCPT ); Tue, 10 Sep 2019 07:10:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1568113823; x=1599649823; h=from:subject:to:cc:references:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=fgDPTEsn7ZWHjFND/LI/Wp/mhnZ31/D6nGDRthZQawY=; b=YCiqv1qGPMOtqnBojWNk9JFLwymPYXGNXvIS4PEOHbUyeceA33oYpyU+ s0dXRe3EDCvga4KIJtqxPHwJyvzhUm//l49b/yyqqXpUv6Gh1G0xsJ0Ub AcWt4iNO2KEjT4m+kK4TZ9UIjczM6SGPWhqN3G7KIheLEyGMu4j45wTKZ c=; X-IronPort-AV: E=Sophos;i="5.64,489,1559520000"; d="scan'208";a="784192521" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2b-55156cd4.us-west-2.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 10 Sep 2019 11:10:20 +0000 Received: from EX13MTAUWA001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2b-55156cd4.us-west-2.amazon.com (Postfix) with ESMTPS id CEDFAA1D54; Tue, 10 Sep 2019 11:10:19 +0000 (UTC) Received: from EX13D21UWA003.ant.amazon.com (10.43.160.184) by EX13MTAUWA001.ant.amazon.com (10.43.160.58) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 10 Sep 2019 11:10:19 +0000 Received: from EX13MTAUWA001.ant.amazon.com (10.43.160.58) by EX13D21UWA003.ant.amazon.com (10.43.160.184) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 10 Sep 2019 11:10:19 +0000 Received: from [10.125.238.37] (10.125.238.37) by mail-relay.amazon.com (10.43.160.118) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 10 Sep 2019 11:10:16 +0000 From: "Hawa, Hanna" Subject: Re: [PATCH 1/1] edac: Add an API for edac device to report for multiple errors To: Borislav Petkov CC: Robert Richter , "mchehab@kernel.org" , "james.morse@arm.com" , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "dwmw@amazon.co.uk" , "benh@amazon.com" , "ronenk@amazon.com" , "talel@amazon.com" , "jonnyc@amazon.com" , "hanochu@amazon.com" References: <20190905083745.6899-1-hhhawa@amazon.com> <20190905095642.ohqkcllm7wufx6sc@rric.localdomain> <50f5bc27-98da-ee3e-59dd-7252c3ed7a0a@amazon.com> <20190908081602.GC16220@zn.tnic> <20190908083535.GD16220@zn.tnic> Message-ID: <488b07a8-ce39-d3fe-4e73-5e6f19176f1b@amazon.com> Date: Tue, 10 Sep 2019 14:10:13 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20190908083535.GD16220@zn.tnic> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On 9/8/2019 11:35 AM, Borislav Petkov wrote: > On Sun, Sep 08, 2019 at 10:16:02AM +0200, Borislav Petkov wrote: >> On Sun, Sep 08, 2019 at 10:58:31AM +0300, Hawa, Hanna wrote: >>>> Better use WARN_ON_ONCE() to avoid flooding. >>> >>> In case of two drivers using this function with wrong error count, only the >>> first WARN_ON_ONCE will catch in this case, and other will miss other wrong >>> usage of other edac device drivers. >> >> The idea is to catch any driver using a 0 error count and fix it, not to >> flood dmesg. You want _ONCE. > > ... and you want to return early too, i.e., > > if (WARN_ON_ONCE(!error_count)) > return; > > Frankly, I'd even remove all the warning functionality and simply do > > if (!error_count) > return; I'll keep it simple as you suggest and remove the warning functionality. > > but let's see how much it screams first. > Thanks, Hanna