From patchwork Wed Sep 9 11:42:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 7145941 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@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 6D0CA9F32B for ; Wed, 9 Sep 2015 11:43:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E51C20979 for ; Wed, 9 Sep 2015 11:43:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 54AB2204D8 for ; Wed, 9 Sep 2015 11:43:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754918AbbIILnZ (ORCPT ); Wed, 9 Sep 2015 07:43:25 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:57514 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754661AbbIILmy (ORCPT ); Wed, 9 Sep 2015 07:42:54 -0400 Received: from ayla.of.borg ([84.195.106.123]) by xavier.telenet-ops.be with bizsmtp id Ezis1r00S2fm56U01zisGK; Wed, 09 Sep 2015 13:42:52 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1ZZdm8-00081I-BO; Wed, 09 Sep 2015 13:42:52 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1ZZdmD-0006hZ-6P; Wed, 09 Sep 2015 13:42:57 +0200 From: Geert Uytterhoeven To: Thomas Gleixner , Jason Cooper Cc: Grygorii Strashko , Magnus Damm , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/2] irqchip: renesas-intc-irqpin: Use a separate lockdep class Date: Wed, 9 Sep 2015 13:42:54 +0200 Message-Id: <1441798974-25716-3-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441798974-25716-1-git-send-email-geert+renesas@glider.be> References: <1441798974-25716-1-git-send-email-geert+renesas@glider.be> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The renesas-intc-irqpin interrupt controller is cascaded to the GIC. Hence when propagating wake-up settings to its parent interrupt controller, the following lockdep warning is printed: ============================================= [ INFO: possible recursive locking detected ] 4.2.0-armadillo-10725-g50fcd7643c034198 #781 Not tainted --------------------------------------------- s2ram/1179 is trying to acquire lock: (&irq_desc_lock_class){-.-...}, at: [] __irq_get_desc_lock+0x78/0x94 but task is already holding lock: (&irq_desc_lock_class){-.-...}, at: [] __irq_get_desc_lock+0x78/0x94 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&irq_desc_lock_class); lock(&irq_desc_lock_class); *** DEADLOCK *** May be due to missing lock nesting notation 7 locks held by s2ram/1179: #0: (sb_writers#7){.+.+.+}, at: [] __sb_start_write+0x64/0xb8 #1: (&of->mutex){+.+.+.}, at: [] kernfs_fop_write+0x78/0x1a0 #2: (s_active#23){.+.+.+}, at: [] kernfs_fop_write+0x80/0x1a0 #3: (autosleep_lock){+.+.+.}, at: [] pm_autosleep_lock+0x18/0x20 #4: (pm_mutex){+.+.+.}, at: [] pm_suspend+0x54/0x248 #5: (&dev->mutex){......}, at: [] __device_suspend+0xdc/0x240 #6: (&irq_desc_lock_class){-.-...}, at: [] __irq_get_desc_lock+0x78/0x94 stack backtrace: CPU: 0 PID: 1179 Comm: s2ram Not tainted 4.2.0-armadillo-10725-g50fcd7643c034198 Hardware name: Generic R8A7740 (Flattened Device Tree) [] (dump_backtrace) from [] (show_stack+0x18/0x1c) [] (show_stack) from [] (dump_stack+0x20/0x28) [] (dump_stack) from [] (__lock_acquire+0x67c/0x1b88) [] (__lock_acquire) from [] (lock_acquire+0x9c/0xbc) [] (lock_acquire) from [] (_raw_spin_lock_irqsave+0x44/0x58) [] (_raw_spin_lock_irqsave) from [] (__irq_get_desc_lock+0x78/0x94 [] (__irq_get_desc_lock) from [] (irq_set_irq_wake+0x28/0x100) [] (irq_set_irq_wake) from [] (intc_irqpin_irq_set_wake+0x24/0x4c) [] (intc_irqpin_irq_set_wake) from [] (set_irq_wake_real+0x3c/0x50 [] (set_irq_wake_real) from [] (irq_set_irq_wake+0x64/0x100) [] (irq_set_irq_wake) from [] (gpio_keys_suspend+0x60/0xa0) [] (gpio_keys_suspend) from [] (platform_pm_suspend+0x3c/0x5c) Avoid this false positive by using a separate lockdep class for INTC External IRQ Pin interrupts. Signed-off-by: Geert Uytterhoeven --- drivers/irqchip/irq-renesas-intc-irqpin.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c index 457d22c09e352d56..d3546a6f49787750 100644 --- a/drivers/irqchip/irq-renesas-intc-irqpin.c +++ b/drivers/irqchip/irq-renesas-intc-irqpin.c @@ -335,6 +335,12 @@ static irqreturn_t intc_irqpin_shared_irq_handler(int irq, void *dev_id) return status; } +/* + * This lock class tells lockdep that INTC External IRQ Pin irqs are in a + * different category than their parents, so it won't report false recursion. + */ +static struct lock_class_key intc_irqpin_irq_lock_class; + static int intc_irqpin_irq_domain_map(struct irq_domain *h, unsigned int virq, irq_hw_number_t hw) { @@ -345,6 +351,7 @@ static int intc_irqpin_irq_domain_map(struct irq_domain *h, unsigned int virq, intc_irqpin_dbg(&p->irq[hw], "map"); irq_set_chip_data(virq, h->host_data); + irq_set_lockdep_class(virq, &intc_irqpin_irq_lock_class); irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq); set_irq_flags(virq, IRQF_VALID); /* kill me now */ return 0;