From patchwork Thu Apr 13 22:27:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Baker X-Patchwork-Id: 9680405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 43AA8601C3 for ; Thu, 13 Apr 2017 22:30:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 252DA2867A for ; Thu, 13 Apr 2017 22:30:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 165102866E; Thu, 13 Apr 2017 22:30:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DA7CF28606 for ; Thu, 13 Apr 2017 22:30:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=u5dnyFmZSoKS4W7ilXBAzuNejct/qhWj6fBfSlbWFNk=; b=iDp o3UsGRVrhbz7lgxXYco9KzgTF8TJm6FXFMJZ4ZivhGgwXCOSRA5Iqk2YQPJVRXUy4FWjUUObK9Nnv Ckhd4AHYL+aoJKZT5FBw5kuOpIaD2ejqdCgG2oCY9fR5z8UNx6t3jPV6XCcknfpZbP2kBNUK4Irxz zsPrrgIaOK8a7vMvBIzpZqJSwSHO8K3zi+P2O0DLb/Hv6sO43E4rmGUiQ31oBLt9uknDJs2C8xqW7 bLP4Cv57e43eMp8zTh4dznJQW0ltvGR6DErHc2rXk7SNJdNy6nianWJKX+6zDqQkiky+2XrbH1P3R b6dyUdhjnkWW+YOb5LhEokXEpjpjdMg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cynFX-0005gn-Ll; Thu, 13 Apr 2017 22:29:59 +0000 Received: from mail-pg0-x230.google.com ([2607:f8b0:400e:c05::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cynFT-0005fB-GE for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2017 22:29:57 +0000 Received: by mail-pg0-x230.google.com with SMTP id 21so36475055pgg.1 for ; Thu, 13 Apr 2017 15:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=ObV4JK7nlXODcCmXyef4KJQzK6Av49ZxI06Xc+5HfIw=; b=kKBvWD8Lke/S77SPlgfys2YNLCRa14L48rsayur4u8Yal60qHAoIT1JdFvOgAv5aFm ydiEPO8anNpZVoho+SNZ8venJyCo76t6+sccwNQdr0lZv/Um/JxZM/pD/seqUIn5z5wA lOiHLGanddPEjssLAZtMIzVblu1CmiUjCGg/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ObV4JK7nlXODcCmXyef4KJQzK6Av49ZxI06Xc+5HfIw=; b=cB7gMnQfH+qu17h/fW3Q8RZnw+mw4X9nhBe9XZrJT93RevgGRJf62+piLVvpf9MwYB FbuJWmRvdAlDryOmat/f75iCU9Gs68ZpsfGjT3J9dsY02/GPLlqbrEMb5M4thWXE+3z+ FgEb8U5KLPVa1kYT4/jbHUoRE4A72dUEZYCP63fcPFY/OyNaZ3CJKdf6ceyf32VhjK/q 9efa5gb0PqMKcSbue2+1B7sVLcFHsstotUvu5Uk+jL/kanQfCNKs9FKjlQI82mVHrNGm mgNT90ayKF3wJG+J5tm7Acvo2CD1dkrTXlsVXuFLfemeves7id6VuoKrGcMn5dnZUhVd LRQA== X-Gm-Message-State: AN3rC/7gUi+6ncSaOXUaa3r6A/YJHWGMpV9VJOqzkTJqNy0QcyoDgunN bRV74xPjPJcs1RP9 X-Received: by 10.84.135.34 with SMTP id 31mr5336633pli.99.1492122574579; Thu, 13 Apr 2017 15:29:34 -0700 (PDT) Received: from localhost.localdomain ([173.14.250.228]) by smtp.gmail.com with ESMTPSA id e207sm47584pfh.121.2017.04.13.15.29.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Apr 2017 15:29:34 -0700 (PDT) From: Tyler Baker To: linux-kernel@vger.kernel.org, marc.zyngier@arm.com, jason@lakedaemon.net, tglx@linutronix.de Subject: [PATCH] irqchip/irq-imx-gpcv2: fix spinlock initialization Date: Thu, 13 Apr 2017 15:27:31 -0700 Message-Id: <20170413222731.5917-1-tyler.baker@linaro.org> X-Mailer: git-send-email 2.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170413_152955_568191_DF8B27A6 X-CRM114-Status: GOOD ( 11.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andrew.smirnov@gmail.com, shawnguo@kernel.org, festevam@gmail.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Call raw_spin_lock_init() before the spinlocks are used to prevent a lockdep splat. Fixes the following trace: INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. Hardware name: Freescale i.MX7 Dual (Device Tree) Backtrace: [] (dump_backtrace) from [] (show_stack+0x18/0x1c) r7:00000000 r6:600000d3 r5:00000000 r4:c0e273dc [] (show_stack) from [] (dump_stack+0xb4/0xe8) [] (dump_stack) from [] (register_lock_class+0x208/0x5ec) r9:ef00d010 r8:ef00d010 r7:c1606448 r6:00000000 r5:00000000 r4:ffffe000 [] (register_lock_class) from [] (__lock_acquire+0x7c/0x18d0) r10:c0e0af40 r9:ef00d010 r8:c0e274cc r7:00000001 r6:600000d3 r5:c1606448 r4:ffffe000 [] (__lock_acquire) from [] (lock_acquire+0x70/0x90) r10:00000000 r9:ef007e38 r8:00000001 r7:00000001 r6:600000d3 r5:00000000 r4:ffffe000 [] (lock_acquire) from [] (_raw_spin_lock+0x30/0x40) r8:600000d3 r7:ef007e10 r6:00000001 r5:ef007e10 r4:ef00d000 [] (_raw_spin_lock) from [] (imx_gpcv2_irq_unmask+0x1c/0x5c) r4:ef00d000 [] (imx_gpcv2_irq_unmask) from [] (irq_enable+0x38/0x4c) r5:00000000 r4:ef007e00 [] (irq_enable) from [] (irq_startup+0x84/0x88) r5:00000000 r4:ef007e00 [] (irq_startup) from [] (__setup_irq+0x538/0x5f4) r7:ef007e60 r6:00000015 r5:ef007e00 r4:ef007d00 [] (__setup_irq) from [] (setup_irq+0x60/0xd0) r10:c0d5fa48 r9:efffcbc0 r8:ef007d00 r7:00000015 r6:ef007e10 r5:00000000 r4:ef007e00 [] (setup_irq) from [] (_mxc_timer_init+0x1f8/0x248) r9:efffcbc0 r8:00000003 r7:016e3600 r6:c0c69bbc r5:ef007c40 r4:ef007c00 [] (_mxc_timer_init) from [] (mxc_timer_init_dt+0xb0/0xf8) r7:00000000 r6:c1669e48 r5:ef7ebf7c r4:ef007c00 [] (mxc_timer_init_dt) from [] (imx6dl_timer_init_dt+0x14/0x18) r9:efffcbc0 r8:c0e7b000 r7:c0c695c0 r6:c0d6fe18 r5:00000001 r4:ef7ebf7c [] (imx6dl_timer_init_dt) from [] (clocksource_probe+0x54/0xb0) [] (clocksource_probe) from [] (time_init+0x30/0x38) r7:c0e07900 r6:c0e7b000 r5:ffffffff r4:00000000 [] (time_init) from [] (start_kernel+0x220/0x3a0) [] (start_kernel) from [<8000807c>] (0x8000807c) r10:00000000 r9:410fc075 r8:8000406a r7:c0e0c958 r6:c0d5fa44 r5:c0e07918 r4:c0e7b294 Verified the fix on a imx7d-cl-som with CONFIG_IMX_GPCV2 set. Signed-off-by: Tyler Baker Reported-by: Tyler Baker Reviewed-by: Fabio Estevam Acked-by: Marc Zyngier --- Issue reported in this thread: https://lkml.org/lkml/2017/4/13/646 drivers/irqchip/irq-imx-gpcv2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/irqchip/irq-imx-gpcv2.c b/drivers/irqchip/irq-imx-gpcv2.c index e13236f..9463f35 100644 --- a/drivers/irqchip/irq-imx-gpcv2.c +++ b/drivers/irqchip/irq-imx-gpcv2.c @@ -230,6 +230,8 @@ static int __init imx_gpcv2_irqchip_init(struct device_node *node, return -ENOMEM; } + raw_spin_lock_init(&cd->rlock); + cd->gpc_base = of_iomap(node, 0); if (!cd->gpc_base) { pr_err("fsl-gpcv2: unable to map gpc registers\n");