<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/include/linux/gpio/driver.h, branch linux-4.5.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>gpio: generic: make bgpio_pdata always visible</title>
<updated>2016-01-13T15:00:32+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-01-09T21:16:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c474e348778bdf5b453a2cdff4b2b1f9e000f343'/>
<id>c474e348778bdf5b453a2cdff4b2b1f9e000f343</id>
<content type='text'>
Board files that define their own bgpio_pdata are broken when
CONFIG_GPIO_GENERIC is disabled and the bgpio_pdata structure
definition is hidden by the #ifdef:

arch/arm/mach-clps711x/board-autcpu12.c:148:15: error: variable 'autcpu12_mmgpio_pdata' has initializer but incomplete type
 static struct bgpio_pdata autcpu12_mmgpio_pdata __initdata = {
arch/arm/mach-clps711x/board-autcpu12.c:149:2: error: unknown field 'base' specified in initializer
  .base = AUTCPU12_MMGPIO_BASE,

Since the board files should generally not care what drivers are
enabled, this makes the structure definition visible again.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 0f4630f3720e ("gpio: generic: factor into gpio_chip struct")
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Board files that define their own bgpio_pdata are broken when
CONFIG_GPIO_GENERIC is disabled and the bgpio_pdata structure
definition is hidden by the #ifdef:

arch/arm/mach-clps711x/board-autcpu12.c:148:15: error: variable 'autcpu12_mmgpio_pdata' has initializer but incomplete type
 static struct bgpio_pdata autcpu12_mmgpio_pdata __initdata = {
arch/arm/mach-clps711x/board-autcpu12.c:149:2: error: unknown field 'base' specified in initializer
  .base = AUTCPU12_MMGPIO_BASE,

Since the board files should generally not care what drivers are
enabled, this makes the structure definition visible again.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 0f4630f3720e ("gpio: generic: factor into gpio_chip struct")
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: generic: factor into gpio_chip struct</title>
<updated>2016-01-05T10:21:00+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2015-12-04T13:02:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0f4630f3720e7e6e921bf525c8357fea7ef3dbab'/>
<id>0f4630f3720e7e6e921bf525c8357fea7ef3dbab</id>
<content type='text'>
The separate struct bgpio_chip has been a pain to handle, both
by being confusingly similar in name to struct gpio_chip and
for being contained inside a struct so that struct gpio_chip
is contained in a struct contained in a struct, making several
steps of dereferencing necessary.

Make things simpler: include the fields directly into
&lt;linux/gpio/driver.h&gt;, #ifdef:ed for CONFIG_GENERIC_GPIO, and
get rid of the &lt;linux/basic_mmio_gpio.h&gt; altogether. Prefix
some of the member variables with bgpio_* and add proper
kerneldoc while we're at it.

Modify all users to handle the change and use a struct
gpio_chip directly. And while we're at it: replace all
container_of() dereferencing by gpiochip_get_data() and
registering the gpio_chip with gpiochip_add_data().

Cc: arm@kernel.org
Cc: Alexander Shiyan &lt;shc_work@mail.ru&gt;
Cc: Shawn Guo &lt;shawnguo@kernel.org&gt;
Cc: Sascha Hauer &lt;kernel@pengutronix.de&gt;
Cc: Kukjin Kim &lt;kgene@kernel.org&gt;
Cc: Alexandre Courbot &lt;gnurou@gmail.com&gt;
Cc: Brian Norris &lt;computersforpeace@gmail.com&gt;
Cc: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Cc: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Cc: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
Cc: Nicolas Pitre &lt;nicolas.pitre@linaro.org&gt;
Cc: Olof Johansson &lt;olof@lixom.net&gt;
Cc: Vladimir Zapolskiy &lt;vladimir_zapolskiy@mentor.com&gt;
Cc: Rabin Vincent &lt;rabin@rab.in&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com
Acked-by: Gregory Fong &lt;gregory.0xf0@gmail.com&gt;
Acked-by: Liviu Dudau &lt;Liviu.Dudau@arm.com&gt;
Acked-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Acked-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Acked-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The separate struct bgpio_chip has been a pain to handle, both
by being confusingly similar in name to struct gpio_chip and
for being contained inside a struct so that struct gpio_chip
is contained in a struct contained in a struct, making several
steps of dereferencing necessary.

Make things simpler: include the fields directly into
&lt;linux/gpio/driver.h&gt;, #ifdef:ed for CONFIG_GENERIC_GPIO, and
get rid of the &lt;linux/basic_mmio_gpio.h&gt; altogether. Prefix
some of the member variables with bgpio_* and add proper
kerneldoc while we're at it.

Modify all users to handle the change and use a struct
gpio_chip directly. And while we're at it: replace all
container_of() dereferencing by gpiochip_get_data() and
registering the gpio_chip with gpiochip_add_data().

Cc: arm@kernel.org
Cc: Alexander Shiyan &lt;shc_work@mail.ru&gt;
Cc: Shawn Guo &lt;shawnguo@kernel.org&gt;
Cc: Sascha Hauer &lt;kernel@pengutronix.de&gt;
Cc: Kukjin Kim &lt;kgene@kernel.org&gt;
Cc: Alexandre Courbot &lt;gnurou@gmail.com&gt;
Cc: Brian Norris &lt;computersforpeace@gmail.com&gt;
Cc: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Cc: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Cc: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
Cc: Nicolas Pitre &lt;nicolas.pitre@linaro.org&gt;
Cc: Olof Johansson &lt;olof@lixom.net&gt;
Cc: Vladimir Zapolskiy &lt;vladimir_zapolskiy@mentor.com&gt;
Cc: Rabin Vincent &lt;rabin@rab.in&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com
Acked-by: Gregory Fong &lt;gregory.0xf0@gmail.com&gt;
Acked-by: Liviu Dudau &lt;Liviu.Dudau@arm.com&gt;
Acked-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Acked-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Acked-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: add a data pointer to gpio_chip</title>
<updated>2016-01-05T10:20:12+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2015-12-03T14:14:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b08ea35a3296ee25c4cb53a977b752266dafa2c2'/>
<id>b08ea35a3296ee25c4cb53a977b752266dafa2c2</id>
<content type='text'>
This adds a void * pointer to gpio_chip so that driver can
assign and retrieve some states. This is done to get rid of
container_of() calls for gpio_chips embedded inside state
containers, so we can remove the need to have the gpio_chip
or later (planned) struct gpio_device be dynamically allocated
at registration time, so that its struct device can be properly
reference counted and not bound to its parent device (e.g.
a platform_device) but instead live on after unregistration
if it is opened by e.g. a char device or sysfs.

The data is added with the new function gpiochip_add_data()
and for compatibility we add static inline wrapper function
gpiochip_add() that will call gpiochip_add_data() with
NULL as argument. The latter will be removed once we have
exorcised gpiochip_add() from the kernel.

gpiochip_get_data() is added as a static inline accessor
for drivers to quickly get their data out.

Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds a void * pointer to gpio_chip so that driver can
assign and retrieve some states. This is done to get rid of
container_of() calls for gpio_chips embedded inside state
containers, so we can remove the need to have the gpio_chip
or later (planned) struct gpio_device be dynamically allocated
at registration time, so that its struct device can be properly
reference counted and not bound to its parent device (e.g.
a platform_device) but instead live on after unregistration
if it is opened by e.g. a char device or sysfs.

The data is added with the new function gpiochip_add_data()
and for compatibility we add static inline wrapper function
gpiochip_add() that will call gpiochip_add_data() with
NULL as argument. The latter will be removed once we have
exorcised gpiochip_add() from the kernel.

gpiochip_get_data() is added as a static inline accessor
for drivers to quickly get their data out.

Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: update gpiochip .get() callback description</title>
<updated>2015-12-26T21:28:43+00:00</updated>
<author>
<name>Vladimir Zapolskiy</name>
<email>vladimir_zapolskiy@mentor.com</email>
</author>
<published>2015-12-22T14:37:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=60befd2ea1c2061775838ea7bac5cc2b1353afd0'/>
<id>60befd2ea1c2061775838ea7bac5cc2b1353afd0</id>
<content type='text'>
Since gpiochip .get() callback may return a negative error value, it
strictly limits the range of possible non-error returned values to
a subset of [30:0] bitmask, however on practice on success all
gpiochip drivers return either 0 for low signal or 1 for high signal,
this is assured by "gpio: *: Be sure to clamp return value" series of
changes. To avoid any confusion, misinterpretation and potential
errors while developing gpiochip drivers in future convert this
implicit assumption to a mandatory rule.

For output signals with unknown output signal state gpiochip drivers
should return a negative error instead of 0.

Signed-off-by: Vladimir Zapolskiy &lt;vladimir_zapolskiy@mentor.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since gpiochip .get() callback may return a negative error value, it
strictly limits the range of possible non-error returned values to
a subset of [30:0] bitmask, however on practice on success all
gpiochip drivers return either 0 for low signal or 1 for high signal,
this is assured by "gpio: *: Be sure to clamp return value" series of
changes. To avoid any confusion, misinterpretation and potential
errors while developing gpiochip drivers in future convert this
implicit assumption to a mandatory rule.

For output signals with unknown output signal state gpiochip drivers
should return a negative error instead of 0.

Signed-off-by: Vladimir Zapolskiy &lt;vladimir_zapolskiy@mentor.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: change member .dev to .parent</title>
<updated>2015-11-19T08:24:35+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2015-11-04T08:56:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=58383c78425e4ee1c077253cf297b641c861c02e'/>
<id>58383c78425e4ee1c077253cf297b641c861c02e</id>
<content type='text'>
The name .dev in a struct is normally reserved for a struct device
that is let us say a superclass to the thing described by the struct.
struct gpio_chip stands out by confusingly using a struct device *dev
to point to the parent device (such as a platform_device) that
represents the hardware. As we want to give gpio_chip:s real devices,
this is not working. We need to rename this member to parent.

This was done by two coccinelle scripts, I guess it is possible to
combine them into one, but I don't know such stuff. They look like
this:

@@
struct gpio_chip *var;
@@
-var-&gt;dev
+var-&gt;parent

and:

@@
struct gpio_chip var;
@@
-var.dev
+var.parent

and:

@@
struct bgpio_chip *var;
@@
-var-&gt;gc.dev
+var-&gt;gc.parent

Plus a few instances of bgpio that I couldn't figure out how
to teach Coccinelle to rewrite.

This patch hits all over the place, but I *strongly* prefer this
solution to any piecemal approaches that just exercise patch
mechanics all over the place. It mainly hits drivers/gpio and
drivers/pinctrl which is my own backyard anyway.

Cc: Haavard Skinnemoen &lt;hskinnemoen@gmail.com&gt;
Cc: Rafał Miłecki &lt;zajec5@gmail.com&gt;
Cc: Richard Purdie &lt;rpurdie@rpsys.net&gt;
Cc: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
Cc: Alek Du &lt;alek.du@intel.com&gt;
Cc: Jaroslav Kysela &lt;perex@perex.cz&gt;
Cc: Takashi Iwai &lt;tiwai@suse.com&gt;
Acked-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Acked-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Acked-by: Hans-Christian Egtvedt &lt;egtvedt@samfundet.no&gt;
Acked-by: Jacek Anaszewski &lt;j.anaszewski@samsung.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The name .dev in a struct is normally reserved for a struct device
that is let us say a superclass to the thing described by the struct.
struct gpio_chip stands out by confusingly using a struct device *dev
to point to the parent device (such as a platform_device) that
represents the hardware. As we want to give gpio_chip:s real devices,
this is not working. We need to rename this member to parent.

This was done by two coccinelle scripts, I guess it is possible to
combine them into one, but I don't know such stuff. They look like
this:

@@
struct gpio_chip *var;
@@
-var-&gt;dev
+var-&gt;parent

and:

@@
struct gpio_chip var;
@@
-var.dev
+var.parent

and:

@@
struct bgpio_chip *var;
@@
-var-&gt;gc.dev
+var-&gt;gc.parent

Plus a few instances of bgpio that I couldn't figure out how
to teach Coccinelle to rewrite.

This patch hits all over the place, but I *strongly* prefer this
solution to any piecemal approaches that just exercise patch
mechanics all over the place. It mainly hits drivers/gpio and
drivers/pinctrl which is my own backyard anyway.

Cc: Haavard Skinnemoen &lt;hskinnemoen@gmail.com&gt;
Cc: Rafał Miłecki &lt;zajec5@gmail.com&gt;
Cc: Richard Purdie &lt;rpurdie@rpsys.net&gt;
Cc: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
Cc: Alek Du &lt;alek.du@intel.com&gt;
Cc: Jaroslav Kysela &lt;perex@perex.cz&gt;
Cc: Takashi Iwai &lt;tiwai@suse.com&gt;
Acked-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Acked-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Acked-by: Hans-Christian Egtvedt &lt;egtvedt@samfundet.no&gt;
Acked-by: Jacek Anaszewski &lt;j.anaszewski@samsung.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpiolib: provide generic request/free implementations</title>
<updated>2015-10-16T20:11:16+00:00</updated>
<author>
<name>Jonas Gorski</name>
<email>jogo@openwrt.org</email>
</author>
<published>2015-10-11T15:34:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c771c2f484857f3b1fc81d180485e96b7cb67c17'/>
<id>c771c2f484857f3b1fc81d180485e96b7cb67c17</id>
<content type='text'>
Provide generic request/free implementations that pinctrl aware gpio
drivers can use instead of open coding if they use a 1:1 pin to gpio
signal mapping.

Signed-off-by: Jonas Gorski &lt;jogo@openwrt.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Provide generic request/free implementations that pinctrl aware gpio
drivers can use instead of open coding if they use a 1:1 pin to gpio
signal mapping.

Signed-off-by: Jonas Gorski &lt;jogo@openwrt.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpiolib: add description for gpio irqchip fields in struct gpio_chip</title>
<updated>2015-08-26T07:29:50+00:00</updated>
<author>
<name>Grygorii Strashko</name>
<email>grygorii.strashko@ti.com</email>
</author>
<published>2015-08-17T12:35:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=41d6bb4c890c8db01248b1bdd512a18e7bd29ca3'/>
<id>41d6bb4c890c8db01248b1bdd512a18e7bd29ca3</id>
<content type='text'>
Add missed description for GPIO irqchip fields in struct gpio_chip.

Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add missed description for GPIO irqchip fields in struct gpio_chip.

Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpiolib: irqchip: use different lockdep class for each gpio irqchip</title>
<updated>2015-08-17T13:32:03+00:00</updated>
<author>
<name>Grygorii Strashko</name>
<email>grygorii.strashko@ti.com</email>
</author>
<published>2015-08-17T12:35:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a0a8bcf4670c2c696e6e83742539a5e0dd7a62d6'/>
<id>a0a8bcf4670c2c696e6e83742539a5e0dd7a62d6</id>
<content type='text'>
Since IRQ chip helpers were introduced drivers lose ability to
register separate lockdep classes for each registered GPIO IRQ
chip and the gpiolib now is using shared lockdep class for
all GPIO IRQ chips (gpiochip_irq_lock_class).
As result, lockdep will produce warning when there are min two
stacked GPIO chips and all of them are interrupt controllers.

HW configuration which generates lockdep warning (TI dra7-evm):

[SOC GPIO bankA.gpioX]
  &lt;- irq - [pcf875x.gpioY]
            &lt;- irq - DevZ.enable_irq_wake(pcf_gpioY_irq);
The issue was reported in [1] and discussed [2].

=============================================
[ INFO: possible recursive locking detected ]
4.2.0-rc6-00013-g5d050ed-dirty #55 Not tainted
---------------------------------------------
sh/63 is trying to acquire lock:
 (class){......}, at: [&lt;c009b91c&gt;] __irq_get_desc_lock+0x50/0x94

but task is already holding lock:
 (class){......}, at: [&lt;c009b91c&gt;] __irq_get_desc_lock+0x50/0x94

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(class);
  lock(class);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

7 locks held by sh/63:
 #0:  (sb_writers#4){.+.+.+}, at: [&lt;c016bbb8&gt;] vfs_write+0x13c/0x164
 #1:  (&amp;of-&gt;mutex){+.+.+.}, at: [&lt;c01debf4&gt;] kernfs_fop_write+0x4c/0x1a0
 #2:  (s_active#36){.+.+.+}, at: [&lt;c01debfc&gt;] kernfs_fop_write+0x54/0x1a0
 #3:  (pm_mutex){+.+.+.}, at: [&lt;c009758c&gt;] pm_suspend+0xec/0x4c4
 #4:  (&amp;dev-&gt;mutex){......}, at: [&lt;c03f77f8&gt;] __device_suspend+0xd4/0x398
 #5:  (&amp;gpio-&gt;lock){+.+.+.}, at: [&lt;c009b940&gt;] __irq_get_desc_lock+0x74/0x94
 #6:  (class){......}, at: [&lt;c009b91c&gt;] __irq_get_desc_lock+0x50/0x94

stack backtrace:
CPU: 0 PID: 63 Comm: sh Not tainted 4.2.0-rc6-00013-g5d050ed-dirty #55
Hardware name: Generic DRA74X (Flattened Device Tree)
[&lt;c0016e24&gt;] (unwind_backtrace) from [&lt;c0013338&gt;] (show_stack+0x10/0x14)
[&lt;c0013338&gt;] (show_stack) from [&lt;c05f6b24&gt;] (dump_stack+0x84/0x9c)
[&lt;c05f6b24&gt;] (dump_stack) from [&lt;c00903f4&gt;] (__lock_acquire+0x19c0/0x1e20)
[&lt;c00903f4&gt;] (__lock_acquire) from [&lt;c0091098&gt;] (lock_acquire+0xa8/0x128)
[&lt;c0091098&gt;] (lock_acquire) from [&lt;c05fd61c&gt;] (_raw_spin_lock_irqsave+0x38/0x4c)
[&lt;c05fd61c&gt;] (_raw_spin_lock_irqsave) from [&lt;c009b91c&gt;] (__irq_get_desc_lock+0x50/0x94)
[&lt;c009b91c&gt;] (__irq_get_desc_lock) from [&lt;c009c4f4&gt;] (irq_set_irq_wake+0x20/0xfc)
[&lt;c009c4f4&gt;] (irq_set_irq_wake) from [&lt;c0393ac4&gt;] (pcf857x_irq_set_wake+0x24/0x54)
[&lt;c0393ac4&gt;] (pcf857x_irq_set_wake) from [&lt;c009c560&gt;] (irq_set_irq_wake+0x8c/0xfc)
[&lt;c009c560&gt;] (irq_set_irq_wake) from [&lt;c04a02ac&gt;] (gpio_keys_suspend+0x70/0xd4)
[&lt;c04a02ac&gt;] (gpio_keys_suspend) from [&lt;c03f6a00&gt;] (dpm_run_callback+0x50/0x124)
[&lt;c03f6a00&gt;] (dpm_run_callback) from [&lt;c03f7830&gt;] (__device_suspend+0x10c/0x398)
[&lt;c03f7830&gt;] (__device_suspend) from [&lt;c03f90f0&gt;] (dpm_suspend+0x134/0x2f4)
[&lt;c03f90f0&gt;] (dpm_suspend) from [&lt;c0096e20&gt;] (suspend_devices_and_enter+0xa8/0x728)
[&lt;c0096e20&gt;] (suspend_devices_and_enter) from [&lt;c00977cc&gt;] (pm_suspend+0x32c/0x4c4)
[&lt;c00977cc&gt;] (pm_suspend) from [&lt;c0096060&gt;] (state_store+0x64/0xb8)
[&lt;c0096060&gt;] (state_store) from [&lt;c01dec64&gt;] (kernfs_fop_write+0xbc/0x1a0)
[&lt;c01dec64&gt;] (kernfs_fop_write) from [&lt;c016b280&gt;] (__vfs_write+0x20/0xd8)
[&lt;c016b280&gt;] (__vfs_write) from [&lt;c016bb0c&gt;] (vfs_write+0x90/0x164)
[&lt;c016bb0c&gt;] (vfs_write) from [&lt;c016c330&gt;] (SyS_write+0x44/0x9c)
[&lt;c016c330&gt;] (SyS_write) from [&lt;c000f500&gt;] (ret_fast_syscall+0x0/0x54)

Lets fix it by using separate lockdep class for each registered GPIO
IRQ Chip. This is done by wrapping gpiochip_irqchip_add call into macros.

The implementation of this patch inspired by solution done by Nicolas
Boichat for regmap [3]

[1] http://www.spinics.net/lists/linux-gpio/msg05844.html
[2] http://www.spinics.net/lists/linux-gpio/msg06021.html
[3] http://www.spinics.net/lists/arm-kernel/msg429834.html

Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Roger Quadros &lt;rogerq@ti.com&gt;
Reported-by: Roger Quadros &lt;rogerq@ti.com&gt;
Tested-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since IRQ chip helpers were introduced drivers lose ability to
register separate lockdep classes for each registered GPIO IRQ
chip and the gpiolib now is using shared lockdep class for
all GPIO IRQ chips (gpiochip_irq_lock_class).
As result, lockdep will produce warning when there are min two
stacked GPIO chips and all of them are interrupt controllers.

HW configuration which generates lockdep warning (TI dra7-evm):

[SOC GPIO bankA.gpioX]
  &lt;- irq - [pcf875x.gpioY]
            &lt;- irq - DevZ.enable_irq_wake(pcf_gpioY_irq);
The issue was reported in [1] and discussed [2].

=============================================
[ INFO: possible recursive locking detected ]
4.2.0-rc6-00013-g5d050ed-dirty #55 Not tainted
---------------------------------------------
sh/63 is trying to acquire lock:
 (class){......}, at: [&lt;c009b91c&gt;] __irq_get_desc_lock+0x50/0x94

but task is already holding lock:
 (class){......}, at: [&lt;c009b91c&gt;] __irq_get_desc_lock+0x50/0x94

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(class);
  lock(class);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

7 locks held by sh/63:
 #0:  (sb_writers#4){.+.+.+}, at: [&lt;c016bbb8&gt;] vfs_write+0x13c/0x164
 #1:  (&amp;of-&gt;mutex){+.+.+.}, at: [&lt;c01debf4&gt;] kernfs_fop_write+0x4c/0x1a0
 #2:  (s_active#36){.+.+.+}, at: [&lt;c01debfc&gt;] kernfs_fop_write+0x54/0x1a0
 #3:  (pm_mutex){+.+.+.}, at: [&lt;c009758c&gt;] pm_suspend+0xec/0x4c4
 #4:  (&amp;dev-&gt;mutex){......}, at: [&lt;c03f77f8&gt;] __device_suspend+0xd4/0x398
 #5:  (&amp;gpio-&gt;lock){+.+.+.}, at: [&lt;c009b940&gt;] __irq_get_desc_lock+0x74/0x94
 #6:  (class){......}, at: [&lt;c009b91c&gt;] __irq_get_desc_lock+0x50/0x94

stack backtrace:
CPU: 0 PID: 63 Comm: sh Not tainted 4.2.0-rc6-00013-g5d050ed-dirty #55
Hardware name: Generic DRA74X (Flattened Device Tree)
[&lt;c0016e24&gt;] (unwind_backtrace) from [&lt;c0013338&gt;] (show_stack+0x10/0x14)
[&lt;c0013338&gt;] (show_stack) from [&lt;c05f6b24&gt;] (dump_stack+0x84/0x9c)
[&lt;c05f6b24&gt;] (dump_stack) from [&lt;c00903f4&gt;] (__lock_acquire+0x19c0/0x1e20)
[&lt;c00903f4&gt;] (__lock_acquire) from [&lt;c0091098&gt;] (lock_acquire+0xa8/0x128)
[&lt;c0091098&gt;] (lock_acquire) from [&lt;c05fd61c&gt;] (_raw_spin_lock_irqsave+0x38/0x4c)
[&lt;c05fd61c&gt;] (_raw_spin_lock_irqsave) from [&lt;c009b91c&gt;] (__irq_get_desc_lock+0x50/0x94)
[&lt;c009b91c&gt;] (__irq_get_desc_lock) from [&lt;c009c4f4&gt;] (irq_set_irq_wake+0x20/0xfc)
[&lt;c009c4f4&gt;] (irq_set_irq_wake) from [&lt;c0393ac4&gt;] (pcf857x_irq_set_wake+0x24/0x54)
[&lt;c0393ac4&gt;] (pcf857x_irq_set_wake) from [&lt;c009c560&gt;] (irq_set_irq_wake+0x8c/0xfc)
[&lt;c009c560&gt;] (irq_set_irq_wake) from [&lt;c04a02ac&gt;] (gpio_keys_suspend+0x70/0xd4)
[&lt;c04a02ac&gt;] (gpio_keys_suspend) from [&lt;c03f6a00&gt;] (dpm_run_callback+0x50/0x124)
[&lt;c03f6a00&gt;] (dpm_run_callback) from [&lt;c03f7830&gt;] (__device_suspend+0x10c/0x398)
[&lt;c03f7830&gt;] (__device_suspend) from [&lt;c03f90f0&gt;] (dpm_suspend+0x134/0x2f4)
[&lt;c03f90f0&gt;] (dpm_suspend) from [&lt;c0096e20&gt;] (suspend_devices_and_enter+0xa8/0x728)
[&lt;c0096e20&gt;] (suspend_devices_and_enter) from [&lt;c00977cc&gt;] (pm_suspend+0x32c/0x4c4)
[&lt;c00977cc&gt;] (pm_suspend) from [&lt;c0096060&gt;] (state_store+0x64/0xb8)
[&lt;c0096060&gt;] (state_store) from [&lt;c01dec64&gt;] (kernfs_fop_write+0xbc/0x1a0)
[&lt;c01dec64&gt;] (kernfs_fop_write) from [&lt;c016b280&gt;] (__vfs_write+0x20/0xd8)
[&lt;c016b280&gt;] (__vfs_write) from [&lt;c016bb0c&gt;] (vfs_write+0x90/0x164)
[&lt;c016bb0c&gt;] (vfs_write) from [&lt;c016c330&gt;] (SyS_write+0x44/0x9c)
[&lt;c016c330&gt;] (SyS_write) from [&lt;c000f500&gt;] (ret_fast_syscall+0x0/0x54)

Lets fix it by using separate lockdep class for each registered GPIO
IRQ Chip. This is done by wrapping gpiochip_irqchip_add call into macros.

The implementation of this patch inspired by solution done by Nicolas
Boichat for regmap [3]

[1] http://www.spinics.net/lists/linux-gpio/msg05844.html
[2] http://www.spinics.net/lists/linux-gpio/msg06021.html
[3] http://www.spinics.net/lists/arm-kernel/msg429834.html

Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Roger Quadros &lt;rogerq@ti.com&gt;
Reported-by: Roger Quadros &lt;rogerq@ti.com&gt;
Tested-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: Remove double "base" in comment</title>
<updated>2015-07-15T22:12:24+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2015-06-15T11:31:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=30bb6fb39e5c08b9db5bc592d6cbc9a5fc5e67a4'/>
<id>30bb6fb39e5c08b9db5bc592d6cbc9a5fc5e67a4</id>
<content type='text'>
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: discourage passing base to gpio_chip</title>
<updated>2015-05-14T10:19:48+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2015-05-13T11:03:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=af6c235d1a5c112964c3029eb0ed4b52c7aa33bf'/>
<id>af6c235d1a5c112964c3029eb0ed4b52c7aa33bf</id>
<content type='text'>
Passing a fixed base in struct gpio_chip is done for legacy
systems that cannot handle dynamic allocation. Discourage this
behaviour in the kerneldoc.

Acked-by: Alexandre Courbot &lt;acourbot@nvidia.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Passing a fixed base in struct gpio_chip is done for legacy
systems that cannot handle dynamic allocation. Discourage this
behaviour in the kerneldoc.

Acked-by: Alexandre Courbot &lt;acourbot@nvidia.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
