* [PATCH] gpio: pca953x: fix irq_domain_add_simple usage
@ 2013-04-03 17:40 Alexandre Belloni
2013-04-09 21:34 ` Alexandre Belloni
2013-04-10 20:54 ` Linus Walleij
0 siblings, 2 replies; 4+ messages in thread
From: Alexandre Belloni @ 2013-04-03 17:40 UTC (permalink / raw)
To: Linus Walleij
Cc: Grant Likely, jimwall, brian, Maxime Ripard, linux-kernel,
Alexandre Belloni
We actually have to pass chip as the host_data parameter of
irq_domain_add_simple() as later on, it is used to initialize chip_data
in pca953x_gpio_irq_map(). Failing to do so is leading to a NULL pointer
dereference after calling irq_data_get_irq_chip_data() in
pca953x_irq_mask(), pca953x_irq_unmask(), pca953x_irq_bus_lock(),
pca953x_irq_bus_sync_unlock() and pca953x_irq_set_type().
Fixes regression introduced by commit
0e8f2fdacf1d44651aa7e57063c76142d1f4988b (gpio: pca953x: use simple
irqdomain)
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
This would probably be good to introduce that patch in the next 3.9 rc as the
regression leads to a lot of breakage (and cursing).
drivers/gpio/gpio-pca953x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index e2dcac5..ea26e59 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -575,7 +575,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
chip->gpio_chip.ngpio,
irq_base,
&pca953x_irq_simple_ops,
- NULL);
+ chip);
if (!chip->domain)
return -ENODEV;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio: pca953x: fix irq_domain_add_simple usage
2013-04-03 17:40 [PATCH] gpio: pca953x: fix irq_domain_add_simple usage Alexandre Belloni
@ 2013-04-09 21:34 ` Alexandre Belloni
2013-04-10 20:54 ` Linus Walleij
1 sibling, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2013-04-09 21:34 UTC (permalink / raw)
To: Alexandre Belloni, Linus Walleij, Grant Likely; +Cc: linux-kernel
Linus, Grant,
I take the liberty to ping you on that one as it is a regression and it
may be worth to include it in 3.9 if it is still time to do so.
Best regards,
On 03/04/2013 19:40, Alexandre Belloni wrote:
> We actually have to pass chip as the host_data parameter of
> irq_domain_add_simple() as later on, it is used to initialize chip_data
> in pca953x_gpio_irq_map(). Failing to do so is leading to a NULL pointer
> dereference after calling irq_data_get_irq_chip_data() in
> pca953x_irq_mask(), pca953x_irq_unmask(), pca953x_irq_bus_lock(),
> pca953x_irq_bus_sync_unlock() and pca953x_irq_set_type().
>
> Fixes regression introduced by commit
> 0e8f2fdacf1d44651aa7e57063c76142d1f4988b (gpio: pca953x: use simple
> irqdomain)
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>
> This would probably be good to introduce that patch in the next 3.9 rc as the
> regression leads to a lot of breakage (and cursing).
>
> drivers/gpio/gpio-pca953x.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> index e2dcac5..ea26e59 100644
> --- a/drivers/gpio/gpio-pca953x.c
> +++ b/drivers/gpio/gpio-pca953x.c
> @@ -575,7 +575,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
> chip->gpio_chip.ngpio,
> irq_base,
> &pca953x_irq_simple_ops,
> - NULL);
> + chip);
> if (!chip->domain)
> return -ENODEV;
>
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio: pca953x: fix irq_domain_add_simple usage
2013-04-03 17:40 [PATCH] gpio: pca953x: fix irq_domain_add_simple usage Alexandre Belloni
2013-04-09 21:34 ` Alexandre Belloni
@ 2013-04-10 20:54 ` Linus Walleij
2013-04-11 7:50 ` Maxime Ripard
1 sibling, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2013-04-10 20:54 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Grant Likely, jimwall, brian, Maxime Ripard, linux-kernel
On Wed, Apr 3, 2013 at 7:40 PM, Alexandre Belloni
<alexandre.belloni@free-electrons.com> wrote:
> We actually have to pass chip as the host_data parameter of
> irq_domain_add_simple() as later on, it is used to initialize chip_data
> in pca953x_gpio_irq_map(). Failing to do so is leading to a NULL pointer
> dereference after calling irq_data_get_irq_chip_data() in
> pca953x_irq_mask(), pca953x_irq_unmask(), pca953x_irq_bus_lock(),
> pca953x_irq_bus_sync_unlock() and pca953x_irq_set_type().
>
> Fixes regression introduced by commit
> 0e8f2fdacf1d44651aa7e57063c76142d1f4988b (gpio: pca953x: use simple
> irqdomain)
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>
> This would probably be good to introduce that patch in the next 3.9 rc as the
> regression leads to a lot of breakage (and cursing).
OK patch applied let's see if I get it to Torvalds in time.
Can I have some ACK from Maxime?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio: pca953x: fix irq_domain_add_simple usage
2013-04-10 20:54 ` Linus Walleij
@ 2013-04-11 7:50 ` Maxime Ripard
0 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2013-04-11 7:50 UTC (permalink / raw)
To: Linus Walleij
Cc: Alexandre Belloni, Grant Likely, jimwall, brian, linux-kernel
Hi Linus,
Le 10/04/2013 22:54, Linus Walleij a écrit :
> On Wed, Apr 3, 2013 at 7:40 PM, Alexandre Belloni
> <alexandre.belloni@free-electrons.com> wrote:
>
>> We actually have to pass chip as the host_data parameter of
>> irq_domain_add_simple() as later on, it is used to initialize chip_data
>> in pca953x_gpio_irq_map(). Failing to do so is leading to a NULL pointer
>> dereference after calling irq_data_get_irq_chip_data() in
>> pca953x_irq_mask(), pca953x_irq_unmask(), pca953x_irq_bus_lock(),
>> pca953x_irq_bus_sync_unlock() and pca953x_irq_set_type().
>>
>> Fixes regression introduced by commit
>> 0e8f2fdacf1d44651aa7e57063c76142d1f4988b (gpio: pca953x: use simple
>> irqdomain)
>>
>> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>> ---
>>
>> This would probably be good to introduce that patch in the next 3.9 rc as the
>> regression leads to a lot of breakage (and cursing).
>
> OK patch applied let's see if I get it to Torvalds in time.
>
> Can I have some ACK from Maxime?
Sure,
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-11 7:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-03 17:40 [PATCH] gpio: pca953x: fix irq_domain_add_simple usage Alexandre Belloni
2013-04-09 21:34 ` Alexandre Belloni
2013-04-10 20:54 ` Linus Walleij
2013-04-11 7:50 ` Maxime Ripard
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).