Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5949910pxv; Thu, 29 Jul 2021 02:34:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU9on8ViWHx3AKJAsWI2Eik+LxSNIStvn1vO+VIx8qEVzdUkgKm3NMsE8yDth2yAj8tJvw X-Received: by 2002:aa7:d342:: with SMTP id m2mr5021259edr.40.1627551257365; Thu, 29 Jul 2021 02:34:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627551257; cv=none; d=google.com; s=arc-20160816; b=HBHGuD5uQJnnVGD5sbHWqdD+7Fe0aEjtifqxi3qlCmr1y42tcOotITmuryOS/u0MEf 74JwJEHko8tNkmK252jNHIJWFUKn+491LSjWyvZDsterard28QjC4lJC9yBRDNBbjnh9 xLmjW6uBM59ryLlrGVcAnbU3gANQWJnXm2CAIpn2E0QKEa3W1wDnZHrQ7ah8BW99++QT WkcAHiagBuLxJx4B7Ouo41JsVVRQKieOTdFA6K8Pt0dteKjaRzx6yrvv6I7rkNhJ9tWy oLzx5DAaCjOcdbObmNkGsQgWykIN1ySgJatph75Z4dupKxJ9BMwN0OBqgOgGjxfuv5NE opCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=E5D55/3+axnn3PMCMZlserLloCf99VdWg3BvD/5IZE8=; b=rq2fDm1nnsi0rJeNhv5tgDVA9zWmGahUEZtrGQknaaIURt+FFj1x9tFvEE/FNsyUK5 +O8RZKVkwpxNv3bdqnFF/gC6SwJDCQVITCEWsAptbp5WSj66vckHk/LaQNRGGeua+8nK x6C8MKgAuKF+lOvl+Sh6EkLE/v2lZmd8x1YPb3fZa5HstWOxJyyf9ZlxGVMBWVIfe4Vv /ACn+py+YxJzUM0cxP3fZyP0wrjokcsj0V7rniRWXdX3/r/M4uOhOlWmsdtrRB1Hia06 Z/y8QOOnwArpCiY9FDLGFMVyo6z65kx+ICiBoqu5d9CNRWuhNO5w7bHcgdOZyM3uI4fv KeDQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx1si2413562ejb.309.2021.07.29.02.33.54; Thu, 29 Jul 2021 02:34:17 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235607AbhG2Jcj (ORCPT + 99 others); Thu, 29 Jul 2021 05:32:39 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:38499 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235492AbhG2Jcj (ORCPT ); Thu, 29 Jul 2021 05:32:39 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=wenyang@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0UhKSVrp_1627551149; Received: from localhost(mailfrom:wenyang@linux.alibaba.com fp:SMTPD_---0UhKSVrp_1627551149) by smtp.aliyun-inc.com(127.0.0.1); Thu, 29 Jul 2021 17:32:34 +0800 From: Wen Yang To: Corey Minyard Cc: Wen Yang , Baoyou Xie , openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] ipmi: rate limit ipmi smi_event failure message Date: Thu, 29 Jul 2021 17:32:28 +0800 Message-Id: <20210729093228.77098-1-wenyang@linux.alibaba.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sometimes we can't get a valid si_sm_data, and we print an error message accordingly. But the ipmi module seem to like retrying a lot, in which case we flood the kernel log with a lot of messages, eg: [46318019.164726] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318020.109700] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318021.158677] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318022.212598] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318023.258564] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318024.210455] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318025.260473] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318026.308445] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318027.356389] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318028.298288] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. [46318029.363302] ipmi_si IPI0001:00: Could not set the global enables: 0xc1. Signed-off-by: Wen Yang Cc: Baoyou Xie Cc: Corey Minyard Cc: openipmi-developer@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org --- drivers/char/ipmi/ipmi_si_intf.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 62929a3..f64c3ac 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -591,7 +591,7 @@ static void handle_transaction_done(struct smi_info *smi_info) smi_info->handlers->get_result(smi_info->si_sm, msg, 3); if (msg[2] != 0) { /* Error clearing flags */ - dev_warn(smi_info->io.dev, + dev_warn_ratelimited(smi_info->io.dev, "Error clearing flags: %2.2x\n", msg[2]); } smi_info->si_state = SI_NORMAL; @@ -683,10 +683,11 @@ static void handle_transaction_done(struct smi_info *smi_info) /* We got the flags from the SMI, now handle them. */ smi_info->handlers->get_result(smi_info->si_sm, msg, 4); if (msg[2] != 0) { - dev_warn(smi_info->io.dev, - "Couldn't get irq info: %x.\n", msg[2]); - dev_warn(smi_info->io.dev, - "Maybe ok, but ipmi might run very slowly.\n"); +#define IPMI_WARN_CHECKING_ENABLES "Maybe ok, but ipmi might run very slowly." + + dev_warn_ratelimited(smi_info->io.dev, + "Couldn't get irq info: %x, %s\n", + msg[2], IPMI_WARN_CHECKING_ENABLES); smi_info->si_state = SI_NORMAL; break; } @@ -721,7 +722,7 @@ static void handle_transaction_done(struct smi_info *smi_info) smi_info->handlers->get_result(smi_info->si_sm, msg, 4); if (msg[2] != 0) - dev_warn(smi_info->io.dev, + dev_warn_ratelimited(smi_info->io.dev, "Could not set the global enables: 0x%x.\n", msg[2]); @@ -1343,7 +1344,7 @@ static int try_get_dev_id(struct smi_info *smi_info) if (cc != IPMI_CC_NO_ERROR && ++retry_count <= GET_DEVICE_ID_MAX_RETRY) { - dev_warn(smi_info->io.dev, + dev_warn_ratelimited(smi_info->io.dev, "BMC returned 0x%2.2x, retry get bmc device id\n", cc); goto retry; -- 1.8.3.1