From patchwork Mon Jun 6 16:56:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 631037 X-Patchwork-Delegate: treding@nvidia.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rNgp957vkz9t45 for ; Tue, 7 Jun 2016 02:56:33 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Cmn7HNEs; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751208AbcFFQ4c (ORCPT ); Mon, 6 Jun 2016 12:56:32 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35270 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120AbcFFQ4b (ORCPT ); Mon, 6 Jun 2016 12:56:31 -0400 Received: by mail-wm0-f68.google.com with SMTP id k184so11577200wme.2; Mon, 06 Jun 2016 09:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=EVS8nbaZr5Z9Kb+eg35o4OBNl76xS6iwJfOgMFCEXmk=; b=Cmn7HNEsPhPc4QA9FZRi8GNVKYzMiI92YlgDURztbhv/RrBiCNAxcr2kWtFoleMqff snuu7WBCUjzjVY9D/UhuozSiqqkE8yMpifac+ysfQYZCtT3RhNttKTnNKT23/STN9xej xCAnrp4ZPocf7QnVbIhREkhtVJ2IujpCh2u0xoe56ZEBmvbmey3sMCzIGedxwoeTxbUA WkFFybQIIfoOsqt9TfxiEkRXKE85jWbuIWML1Y8QGO47hnoHCTDIDzXo+r00+Ib1b6Zz 5Yhqi30c+aMYN3CJGaQtho3AfbI931Ifj6MSAFoK/nRRjXoDuc6NbWmHPqAwGDo5yEQA CNBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EVS8nbaZr5Z9Kb+eg35o4OBNl76xS6iwJfOgMFCEXmk=; b=a+R5DgkKF+j7lzfnUF7n3hw8ULXH09SJxF9s+0Ph7gCyx+teQRIyoyrPxXHA/zeALS pkpsvoiMD2TbEVZ4qDwH2SKPAXRzxKu05r7x6yenfqkiznRwWkUPS6MGgqZIunaEELNd hbcIWscWz5++3yfiFeKNuMlkn34rr8zdfgf3e3v0HPWpSP6LuvbHGGCd6clTu627suLz DscHQSYFlejTK8FosJbNcP11+4oNBvECBk2PqJWaELeFEjY5NNk7KETRozvOoXLW3IwU n6g7clmCSagF9Zy6gxI5P3IGCG5EFWDaFBu6D7bpJ6n1+uS5rWlAJYDrEeZxKoa3W89t QsuA== X-Gm-Message-State: ALyK8tJ1hCDEdAFdw152DWvfFBwevjfhDcOdL1YI2CmYJhWvI4al6vhija+CeBChAoRz7w== X-Received: by 10.194.75.134 with SMTP id c6mr18253656wjw.103.1465232189461; Mon, 06 Jun 2016 09:56:29 -0700 (PDT) Received: from localhost (port-6551.pppoe.wtnet.de. [84.46.25.176]) by smtp.gmail.com with ESMTPSA id f1sm15122737wmf.22.2016.06.06.09.56.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jun 2016 09:56:27 -0700 (PDT) From: Thierry Reding To: Linus Walleij , Alexandre Courbot Cc: Stephen Warren , Laxman Dewangan , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH] gpio: tegra: Make lockdep class file-scoped Date: Mon, 6 Jun 2016 18:56:27 +0200 Message-Id: <20160606165627.32676-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.8.3 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Thierry Reding Commit b546be0db955 ("gpio: tegra: Get rid of all file scoped global variables") moved all file scoped variables into the driver-private structure to allow potentially multiple instances of the driver. The change also included turning the lockdep class into a driver-private field, which doesn't work and produces error messages such as this: [ 0.142310] BUG: key ffff8000fb3f7ab0 not in .data! Make the lockdep class file-scoped again to fix this issue. Signed-off-by: Thierry Reding --- Hi Linus, The commit that broke this went into v4.7-rc1, so it'd be good to get this merged within the v4.7 release cycle. drivers/gpio/gpio-tegra.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index ec891a27952f..661b0e34e067 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -98,7 +98,6 @@ struct tegra_gpio_info { const struct tegra_gpio_soc_config *soc; struct gpio_chip gc; struct irq_chip ic; - struct lock_class_key lock_class; u32 bank_count; }; @@ -547,6 +546,12 @@ static const struct dev_pm_ops tegra_gpio_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(tegra_gpio_suspend, tegra_gpio_resume) }; +/* + * This lock class tells lockdep that GPIO irqs are in a different category + * than their parents, so it won't report false recursion. + */ +static struct lock_class_key gpio_lock_class; + static int tegra_gpio_probe(struct platform_device *pdev) { const struct tegra_gpio_soc_config *config; @@ -660,7 +665,7 @@ static int tegra_gpio_probe(struct platform_device *pdev) bank = &tgi->bank_info[GPIO_BANK(gpio)]; - irq_set_lockdep_class(irq, &tgi->lock_class); + irq_set_lockdep_class(irq, &gpio_lock_class); irq_set_chip_data(irq, bank); irq_set_chip_and_handler(irq, &tgi->ic, handle_simple_irq); }