From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752653AbcELJwj (ORCPT ); Thu, 12 May 2016 05:52:39 -0400 Received: from arroyo.ext.ti.com ([198.47.19.12]:50694 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751713AbcELJwh (ORCPT ); Thu, 12 May 2016 05:52:37 -0400 From: Roger Quadros To: CC: , , , Roger Quadros Subject: [PATCH] mtd: nand: ratelimit ecc error message Date: Thu, 12 May 2016 12:52:03 +0300 Message-ID: <1463046723-12950-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If NAND has gone bad or filesystem gets corrupted then the console can get flooded with ecc error messages. Ratelimit the error message. Reported-by: Nishanth Menon Signed-off-by: Roger Quadros --- drivers/mtd/nand/nand_bch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/nand_bch.c b/drivers/mtd/nand/nand_bch.c index b585bae..321dc0d 100644 --- a/drivers/mtd/nand/nand_bch.c +++ b/drivers/mtd/nand/nand_bch.c @@ -97,7 +97,7 @@ int nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf, errloc[i]); } } else if (count < 0) { - printk(KERN_ERR "ecc unrecoverable error\n"); + pr_err_ratelimited("ecc unrecoverable error\n"); count = -EBADMSG; } return count; -- 2.7.4