linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: tegra: Make lockdep class file-scoped
@ 2016-06-06 16:56 Thierry Reding
  2016-06-07  6:04 ` Laxman Dewangan
  2016-06-08 11:41 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Thierry Reding @ 2016-06-06 16:56 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: Stephen Warren, Laxman Dewangan, linux-gpio, linux-tegra

From: Thierry Reding <treding@nvidia.com>

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 <treding@nvidia.com>
---
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);
 	}
-- 
2.8.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: tegra: Make lockdep class file-scoped
  2016-06-06 16:56 [PATCH] gpio: tegra: Make lockdep class file-scoped Thierry Reding
@ 2016-06-07  6:04 ` Laxman Dewangan
  2016-06-08 11:41 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Laxman Dewangan @ 2016-06-07  6:04 UTC (permalink / raw)
  To: Thierry Reding, Linus Walleij, Alexandre Courbot
  Cc: Stephen Warren, linux-gpio, linux-tegra


On Monday 06 June 2016 10:26 PM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> 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.
>

When I tested on T210, I did not get this issue. Want to know that how 
did you get this issue so that I can add that part on my testing.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: tegra: Make lockdep class file-scoped
  2016-06-06 16:56 [PATCH] gpio: tegra: Make lockdep class file-scoped Thierry Reding
  2016-06-07  6:04 ` Laxman Dewangan
@ 2016-06-08 11:41 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2016-06-08 11:41 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Alexandre Courbot, Stephen Warren, Laxman Dewangan,
	linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org

On Mon, Jun 6, 2016 at 6:56 PM, Thierry Reding <thierry.reding@gmail.com> wrote:

> From: Thierry Reding <treding@nvidia.com>
>
> 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 <treding@nvidia.com>

Patch applied for fixes.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-08 11:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-06 16:56 [PATCH] gpio: tegra: Make lockdep class file-scoped Thierry Reding
2016-06-07  6:04 ` Laxman Dewangan
2016-06-08 11:41 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).