From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753274AbdL1Lec (ORCPT ); Thu, 28 Dec 2017 06:34:32 -0500 Received: from terminus.zytor.com ([65.50.211.136]:48821 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751382AbdL1Lea (ORCPT ); Thu, 28 Dec 2017 06:34:30 -0500 Date: Thu, 28 Dec 2017 03:31:27 -0800 From: tip-bot for Guenter Roeck Message-ID: Cc: mingo@kernel.org, linux@roeck-us.net, joe@perches.com, andriy.shevchenko@linux.intel.com, dtor@chromium.org, linux-kernel@vger.kernel.org, mika.westerberg@linux.intel.com, tglx@linutronix.de, hpa@zytor.com Reply-To: mika.westerberg@linux.intel.com, tglx@linutronix.de, hpa@zytor.com, dtor@chromium.org, linux-kernel@vger.kernel.org, joe@perches.com, andriy.shevchenko@linux.intel.com, mingo@kernel.org, linux@roeck-us.net In-Reply-To: <1512234784-21038-1-git-send-email-linux@roeck-us.net> References: <1512234784-21038-1-git-send-email-linux@roeck-us.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/urgent] genirq: Guard handle_bad_irq log messages Git-Commit-ID: 11bca0a83f83f6093d816295668e74ef24595944 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 11bca0a83f83f6093d816295668e74ef24595944 Gitweb: https://git.kernel.org/tip/11bca0a83f83f6093d816295668e74ef24595944 Author: Guenter Roeck AuthorDate: Sat, 2 Dec 2017 09:13:04 -0800 Committer: Thomas Gleixner CommitDate: Thu, 28 Dec 2017 12:28:29 +0100 genirq: Guard handle_bad_irq log messages An interrupt storm on a bad interrupt will cause the kernel log to be clogged. [ 60.089234] ->handle_irq(): ffffffffbe2f803f, [ 60.090455] 0xffffffffbf2af380 [ 60.090510] handle_bad_irq+0x0/0x2e5 [ 60.090522] ->irq_data.chip(): ffffffffbf2af380, [ 60.090553] IRQ_NOPROBE set [ 60.090584] ->handle_irq(): ffffffffbe2f803f, [ 60.090590] handle_bad_irq+0x0/0x2e5 [ 60.090596] ->irq_data.chip(): ffffffffbf2af380, [ 60.090602] 0xffffffffbf2af380 [ 60.090608] ->action(): (null) [ 60.090779] handle_bad_irq+0x0/0x2e5 This was seen when running an upstream kernel on Acer Chromebook R11. The system was unstable as result. Guard the log message with __printk_ratelimit to reduce the impact. This won't prevent the interrupt storm from happening, but at least the system remains stable. Signed-off-by: Guenter Roeck Signed-off-by: Thomas Gleixner Cc: Dmitry Torokhov Cc: Joe Perches Cc: Andy Shevchenko Cc: Mika Westerberg Link: https://bugzilla.kernel.org/show_bug.cgi?id=197953 Link: https://lkml.kernel.org/r/1512234784-21038-1-git-send-email-linux@roeck-us.net --- kernel/irq/debug.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/irq/debug.h b/kernel/irq/debug.h index 17f05ef..e4d3819 100644 --- a/kernel/irq/debug.h +++ b/kernel/irq/debug.h @@ -12,6 +12,11 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc) { + static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5); + + if (!__ratelimit(&ratelimit)) + return; + printk("irq %d, desc: %p, depth: %d, count: %d, unhandled: %d\n", irq, desc, desc->depth, desc->irq_count, desc->irqs_unhandled); printk("->handle_irq(): %p, ", desc->handle_irq);