Received: by 10.223.176.5 with SMTP id f5csp780136wra; Sat, 3 Feb 2018 10:06:20 -0800 (PST) X-Google-Smtp-Source: AH8x2252bUspxuKqiwQBrs0TazLB7KHQ8X4VYQEgdV6/esdYTSUImZL5FyCQhOS9Q9hETmggB1LC X-Received: by 2002:a17:902:b43:: with SMTP id 61-v6mr39253989plq.127.1517681180429; Sat, 03 Feb 2018 10:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517681180; cv=none; d=google.com; s=arc-20160816; b=DFU2mJitOy0EJg+FhpCt0EqfVZQXL6c9OLPqN8YpKhKtwsgA8nIKFu1o+vRTZqX+Et lyoscytR1YgTVO1gLhfsh87nYdIEFeZ9Sjka1SXkt0B3PwuaLbbl8+q4dTKe3KU+UX8Q nEPzs88c7BfqxiKNTGP9BLAFeAmxL18QZCPCGqEdwyZHKJoTEYltY0cxUwUaLzDHh6L7 WcJjD0yBKhFkHZ3LG5SnZICU23pYl1kQ77QyKqaqYO7MHHKVlRNBNoLwFOib9C+ac1Wg UDFcJBPbaUCCRbDdJpMGexXY/zn11bkj7oxkwoOGJnK/gDGaZmoaQInssq2QiCxPY2sU hXAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=M91UX0U2DadGGaqAPUTF5W7Py21jhq7mghZxJI7fcG8=; b=yH1oELLpjqY6se3PHiWBy418pXP60LwwjBxUa2NOy5o5wMVzJyOchzejsJkwcTqIBQ d9Hu7+FvgmZUEmJ/K6h12oHIx+bn/rh8H3YOZa+6C/szmhywW/WGel2iMyEz8poMDAM5 bxqC6O01qmVPvImmVmH9g+n+suOk9g5OBG0eizUSNNafz2riYSJtpJUK9Ke0vMSHHFPq NRd46k9mRwB+IKK2Lj5UgUUeehbf5uf1qeK53bS0BjMeTnowGMgcY5hssq9NNdehqao6 oFuJ3CjBWPLZxQPcgLidVOZVy8gr8UlfXh+FWl9IegKcPnWp+Y5k5uB5iz+E3HvFGmdt pYqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jpvoSmGG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l91-v6si2061193plb.266.2018.02.03.10.06.04; Sat, 03 Feb 2018 10:06:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jpvoSmGG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753343AbeBCSFF (ORCPT + 99 others); Sat, 3 Feb 2018 13:05:05 -0500 Received: from mail-bl2nam02on0115.outbound.protection.outlook.com ([104.47.38.115]:21822 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753038AbeBCSCJ (ORCPT ); Sat, 3 Feb 2018 13:02:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=M91UX0U2DadGGaqAPUTF5W7Py21jhq7mghZxJI7fcG8=; b=jpvoSmGGoyT2oPsQZfoKTCAJKroiaKOkEBBqPMgdNn57ue4gMmbcZtOcp8zKfoIZWIpikDJmpWUiP8TjyIvC2bBXNmL1D8oSsxnkqtq/TUmjVM5pWcTNfmg/5NsJOj6x1fJtPQo99ooprhsGGSBKOML23C3ahu1OHDq5UBSuAqQ= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1041.namprd21.prod.outlook.com (52.132.23.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.506.3; Sat, 3 Feb 2018 18:02:05 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:02:05 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Guenter Roeck , Thomas Gleixner , Dmitry Torokhov , Joe Perches , Andy Shevchenko , Mika Westerberg , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 067/110] genirq: Guard handle_bad_irq log messages Thread-Topic: [PATCH AUTOSEL for 4.14 067/110] genirq: Guard handle_bad_irq log messages Thread-Index: AQHTnRjz3GDEVRhlgECezaLSKuHfBg== Date: Sat, 3 Feb 2018 18:01:00 +0000 Message-ID: <20180203180015.29073-67-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR2101MB1041;7:XJQ7R0dM1pD/em0B7rwWsGhILSyq3taEfLDS+5U1M3DsTibBYxndW+MpZM0Brj0dOQ26R3rodJYFsVDArWhqpb7n8N6q8KsbLyzosxQuX3Dhm1F9gAv5Jo/b0ZVpDCUvCan5S7bszboXlH6ZC7/3t1VJBDN9PHcqqrNfCjh9Z1UpkxU9uHUq8j8gSDVqt+AQ364+26SiP7FLPBm6sCDZi1rjzZAwrBY9kzZnLe7BgFi3xqHn3ry0Ush3duKSq6i6 x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: d9c63203-ae4b-4236-72ae-08d56b303c2b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1041; x-ms-traffictypediagnostic: BL0PR2101MB1041: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(42068640409301)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3231101)(2400082)(944501161)(93006095)(93001095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:BL0PR2101MB1041;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1041; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(396003)(366004)(39860400002)(376002)(346002)(189003)(199004)(2501003)(305945005)(3660700001)(15650500001)(5250100002)(81156014)(99286004)(81166006)(36756003)(7736002)(10290500003)(106356001)(53936002)(5660300001)(316002)(22452003)(8936002)(54906003)(110136005)(3280700002)(478600001)(72206003)(966005)(4326008)(25786009)(107886003)(102836004)(97736004)(76176011)(6666003)(66066001)(6506007)(2950100002)(2900100001)(68736007)(8676002)(6116002)(3846002)(186003)(1076002)(6346003)(105586002)(26005)(10090500001)(2906002)(6512007)(86612001)(14454004)(6306002)(575784001)(86362001)(6436002)(6486002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1041;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: TdLqpyTZBLxL7BdyU5KoJOsM8nwm/ObZL4JBQSIJygAjf4cISbKdV0J3qgGhIooBLfo6zUfYt/9Ahnbqw68y3A== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9c63203-ae4b-4236-72ae-08d56b303c2b X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:01:00.7534 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1041 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guenter Roeck [ Upstream commit 11bca0a83f83f6093d816295668e74ef24595944 ] 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=3D197953 Link: https://lkml.kernel.org/r/1512234784-21038-1-git-send-email-linux@roe= ck-us.net Signed-off-by: Sasha Levin --- kernel/irq/debug.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/irq/debug.h b/kernel/irq/debug.h index 17f05ef8f575..e4d3819a91cc 100644 --- a/kernel/irq/debug.h +++ b/kernel/irq/debug.h @@ -12,6 +12,11 @@ =20 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); --=20 2.11.0