From patchwork Mon Jul 13 12:42:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 6779151 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AE96F9F2E8 for ; Mon, 13 Jul 2015 12:46:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A073A20551 for ; Mon, 13 Jul 2015 12:46:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 89D6C2051C for ; Mon, 13 Jul 2015 12:46:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZEd5x-0004Pf-OA; Mon, 13 Jul 2015 12:44:29 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZEd58-0001ae-8b for linux-arm-kernel@lists.infradead.org; Mon, 13 Jul 2015 12:43:40 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t6DCgvJl015003; Mon, 13 Jul 2015 07:42:57 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t6DCgumL009756; Mon, 13 Jul 2015 07:42:57 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Mon, 13 Jul 2015 07:42:35 -0500 Received: from rockdesk.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t6DCgsp8023972; Mon, 13 Jul 2015 07:42:54 -0500 From: Roger Quadros To: Subject: [PATCH] ARM: edma: Clear IRQ if we get interrupted by a unknown event Date: Mon, 13 Jul 2015 15:42:52 +0300 Message-ID: <1436791372-14879-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150713_054338_440786_27AA2EFD X-CRM114-Status: GOOD ( 10.65 ) X-Spam-Score: -8.3 (--------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arnd@arndb.de, nsekhar@ti.com, linux-kernel@vger.kernel.org, olof@lixom.net, linux-arm-kernel@lists.infradead.org, Roger Quadros Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It looks like we can get an interrupt even when none of the events that we're expecting occur. This can typically happen due to incorrect usage of the dma engine by the clients. If we don't Ack this interrupt then we get a flood of them and then it gets disabled by the IRQ core. (e.g. see backtrace below on am437x-sk-evm) Ack such an interrupt and print an error message so that developers can identify the problem. The following error was seen at boot on am437x-sk-evm [ 7.395763] irq 46: nobody cared (try booting with the "irqpoll" option) [ 7.402499] CPU: 0 PID: 861 Comm: mmcqd/0 Not tainted 3.14.37-00337-g1b4e893 #1116 [ 7.410099] Backtrace: [ 7.412588] [] (dump_backtrace) from [] (show_stack+0x18/0x1c) [ 7.420189] r6:0000002e r5:00000000 r4:00000000 r3:00000000 [ 7.425910] [] (show_stack) from [] (dump_stack+0x78/0x94) [ 7.433178] [] (dump_stack) from [] (__report_bad_irq+0x28/0xc8) [ 7.440950] r4:ec806500 r3:c088f358 [ 7.444558] [] (__report_bad_irq) from [] (note_interrupt+0x25c/0x2b8) [ 7.452854] r6:0000002e r5:00000000 r4:ec806500 r3:0001863c [ 7.458569] [] (note_interrupt) from [] (handle_irq_event_percpu+0xb0/0x1a0) [ 7.467389] r10:ec806500 r9:c08cb03b r8:0000002e r7:00000000 r6:00000000 r5:00000000 [ 7.475285] r4:00000000 r3:00000000 [ 7.478892] [] (handle_irq_event_percpu) from [] (handle_irq_event+0x4c/0x6c) [ 7.487797] r10:00000006 r9:600f0113 r8:600f0113 r7:fa240100 r6:ecc3dcc0 r5:ec80655c [ 7.495694] r4:ec806500 [ 7.498247] [] (handle_irq_event) from [] (handle_fasteoi_irq+0x84/0x150) [ 7.506804] r6:ecc3dcc0 r5:0000002e r4:ec806500 r3:00000000 [ 7.512518] [] (handle_fasteoi_irq) from [] (generic_handle_irq+0x28/0x38) [ 7.521162] r4:0000002e r3:c007c35c [ 7.524769] [] (generic_handle_irq) from [] (handle_IRQ+0x40/0x9c) [ 7.532716] r4:c0865ea8 r3:000001a0 [ 7.536321] [] (handle_IRQ) from [] (gic_handle_irq+0x30/0x64) [ 7.543920] r6:ecc3dbd8 r5:c08709a0 r4:fa24010c r3:00000100 [ 7.549640] [] (gic_handle_irq) from [] (__irq_svc+0x40/0x50) [ 7.557154] Exception stack(0xecc3dbd8 to 0xecc3dc20) [ 7.562226] dbc0: c08cccc0 00000000 [ 7.570439] dbe0: 0000000a 00000000 00000040 0000002c 00000000 ecc3c000 600f0113 600f0113 [ 7.578652] dc00: 00000006 ecc3dc64 ecc3dc20 ecc3dc20 c0040630 c00406a8 200f0113 ffffffff [ 7.586860] r7:ecc3dc0c r6:ffffffff r5:200f0113 r4:c00406a8 [ 7.592581] [] (__do_softirq) from [] (irq_exit+0xa8/0xf8) [ 7.599829] r10:00000006 r9:600f0113 r8:600f0113 r7:fa240100 r6:00000000 r5:0000002c [ 7.607724] r4:ecc3c000 [ 7.610276] [] (irq_exit) from [] (handle_IRQ+0x44/0x9c) [ 7.617351] r4:c0865ea8 r3:000001a0 [ 7.620955] [] (handle_IRQ) from [] (gic_handle_irq+0x30/0x64) [ 7.628552] r6:ecc3dcc0 r5:c08709a0 r4:fa24010c r3:00000100 [ 7.634265] [] (gic_handle_irq) from [] (__irq_svc+0x40/0x50) [ 7.641777] Exception stack(0xecc3dcc0 to 0xecc3dd08) [ 7.646850] dcc0: c08cf288 600f0193 c088f358 c088f358 c08cf288 00000001 00000027 c088f34c [ 7.655062] dce0: 600f0113 600f0113 00000006 ecc3dd6c ecc3dcc0 ecc3dd08 c0076bac c00771f0 [ 7.663272] dd00: 600f0113 ffffffff [ 7.666771] r7:ecc3dcf4 r6:ffffffff r5:600f0113 r4:c00771f0 [ 7.672485] [] (vprintk_emit) from [] (printk+0x3c/0x44) [ 7.679560] r10:00001ffe r9:00001000 r8:00000010 r7:00002000 r6:c08a5b00 r5:c08a5b2c [ 7.687455] r4:c08a5a60 [ 7.690011] [] (printk) from [] (credit_entropy_bits+0x238/0x260) [ 7.697870] r3:00000002 r2:00000008 r1:c078cfa0 r0:c078cec4 [ 7.703583] [] (credit_entropy_bits) from [] (add_timer_randomness+0xd4/0xe4) [ 7.712489] r10:ecc24008 r9:ecc24c00 r8:ecc1fb08 r7:00000000 r6:00000000 r5:c08a5b00 [ 7.720386] r4:ecc0b440 [ 7.722938] [] (add_timer_randomness) from [] (add_disk_randomness+0x2c/0x30) [ 7.731844] r5:00000000 r4:ecc1fb08 [ 7.735451] [] (add_disk_randomness) from [] (blk_update_bidi_request+0x50/0x74) [ 7.744625] [] (blk_update_bidi_request) from [] (blk_end_bidi_request+0x1c/0x58) [ 7.753879] r6:00000000 r5:ecc28c00 r4:ecc1fb08 r3:00000000 [ 7.759592] [] (blk_end_bidi_request) from [] (blk_end_request+0x14/0x18) [ 7.768149] r8:ecc1fb08 r7:00000000 r6:ecc24000 r5:00000000 r4:ecc24250 r3:00000000 [ 7.775973] [] (blk_end_request) from [] (mmc_blk_issue_rw_rq+0x8c4/0xbd8) [ 7.784625] [] (mmc_blk_issue_rw_rq) from [] (mmc_blk_issue_rq+0x1cc/0x4b8) [ 7.793358] r10:00000001 r9:00000000 r8:ecc24000 r7:ecbfc29c r6:00000000 r5:ecc24008 [ 7.801255] r4:ecc24c00 [ 7.803807] [] (mmc_blk_issue_rq) from [] (mmc_queue_thread+0xb8/0x14c) [ 7.812191] r10:00000001 r9:ecc24010 r8:00000000 r7:00000000 r6:ecc3c000 r5:ecc28c00 [ 7.820087] r4:ecc24008 [ 7.822648] [] (mmc_queue_thread) from [] (kthread+0xcc/0xe8) [ 7.830159] r10:00000000 r9:00000000 r8:00000000 r7:c04cc440 r6:ecc24008 r5:ecc0b300 [ 7.838056] r4:00000000 r3:ecb1db40 [ 7.841663] [] (kthread) from [] (ret_from_fork+0x14/0x3c) [ 7.848911] r7:00000000 r6:00000000 r5:c00581fc r4:ecc0b300 [ 7.854618] handlers: [ 7.856905] [] dma_ccerr_handler [ 7.861020] Disabling IRQ #46 Acked-by: Peter Ujfalusi Signed-off-by: Roger Quadros --- arch/arm/common/edma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c index 873dbfc..356281d 100644 --- a/arch/arm/common/edma.c +++ b/arch/arm/common/edma.c @@ -435,8 +435,11 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data) if ((edma_read_array(ctlr, EDMA_EMR, 0) == 0) && (edma_read_array(ctlr, EDMA_EMR, 1) == 0) && (edma_read(ctlr, EDMA_QEMR) == 0) && - (edma_read(ctlr, EDMA_CCERR) == 0)) + (edma_read(ctlr, EDMA_CCERR) == 0)) { + dev_err(data, "%s: unmanaged event occured\n", __func__); + edma_write(ctlr, EDMA_EEVAL, 1); return IRQ_NONE; + } while (1) { int j = -1;