Re: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT

2015-09-26 Thread Sebastian Reichel
Hi Valentin,

On Tue, Sep 22, 2015 at 07:28:23PM +0200, Valentin Rothberg wrote:
> From bceb7cace76aba9212db56be939bfecaacb75bc2 Mon Sep 17 00:00:00 2001
> From: Valentin Rothberg 
> Date: Tue, 22 Sep 2015 19:00:40 +0200
> Subject: [PATCH] wm831x_power: Use IRQF_ONESHOT to request threaded IRQs
> 
> Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
> threaded IRQs without a primary handler need to be requested with
> IRQF_ONESHOT, otherwise the request will fail.
> 
> scripts/coccinelle/misc/irqf_oneshot.cocci detected this issue.
> 
> Fixes: b5874f33bbaf ("wm831x_power: Use genirq")
> Signed-off-by: Valentin Rothberg 

Thanks, queued.

-- Sebastian


signature.asc
Description: Digital signature


Re: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT

2015-09-26 Thread Sebastian Reichel
Hi,

On Tue, Sep 22, 2015 at 10:01:33PM +0200, Valentin Rothberg wrote:
> I CCed Anton, who signed with Mark the responsible commit.

mh Mark is now working for Linaro, so he probably didn't see this
thread and Anton no longer maintains the power-supply subsystem.
Maybe you could add support for MAINTAINERS file to your scripts?

-- Sebastian


signature.asc
Description: Digital signature


Re: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT

2015-09-26 Thread Sebastian Reichel
Hi Valentin,

On Tue, Sep 22, 2015 at 07:28:23PM +0200, Valentin Rothberg wrote:
> From bceb7cace76aba9212db56be939bfecaacb75bc2 Mon Sep 17 00:00:00 2001
> From: Valentin Rothberg 
> Date: Tue, 22 Sep 2015 19:00:40 +0200
> Subject: [PATCH] wm831x_power: Use IRQF_ONESHOT to request threaded IRQs
> 
> Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
> threaded IRQs without a primary handler need to be requested with
> IRQF_ONESHOT, otherwise the request will fail.
> 
> scripts/coccinelle/misc/irqf_oneshot.cocci detected this issue.
> 
> Fixes: b5874f33bbaf ("wm831x_power: Use genirq")
> Signed-off-by: Valentin Rothberg 

Thanks, queued.

-- Sebastian


signature.asc
Description: Digital signature


Re: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT

2015-09-26 Thread Sebastian Reichel
Hi,

On Tue, Sep 22, 2015 at 10:01:33PM +0200, Valentin Rothberg wrote:
> I CCed Anton, who signed with Mark the responsible commit.

mh Mark is now working for Linaro, so he probably didn't see this
thread and Anton no longer maintains the power-supply subsystem.
Maybe you could add support for MAINTAINERS file to your scripts?

-- Sebastian


signature.asc
Description: Digital signature


Re: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT

2015-09-22 Thread Valentin Rothberg
Hi Sasha,

On Sep 22 '15 15:41, Sasha Levin wrote:
> Hi folks,
> 
> I'm slightly confused about the bisection: it points out to a gcc5
> support patch, what does it have to do with wm831x?

I don't know why it points to the gcc patch.  I asked this myself as
well and I couldn't figure out a relation between you and the driver,
but somehow I trusted the report - a machine must know better :)
Sorry for making the noise.

I CCed Anton, who signed with Mark the responsible commit.

Best regards,
 Valentin

> Thanks,
> Sasha
> 
> On 09/22/2015 01:28 PM, Valentin Rothberg wrote:
> > Hi Sasha,
> > 
> > Julia forwarded the report (see below) to me.  Unless
> > IRQCHIP_ONESHOT_SAFE is set, requesting a threaded IRQ will always fail
> > when the primary handler is set to NULL.  In some cases there's a
> > potential to run into stack overflows.
> > 
> > I attached a patch that fixes the issue.
> > 
> > Kind regards,
> >  Valentin
> > 
> > -- Forwarded message --
> > Date: Tue, 22 Sep 2015 21:42:18 +0800
> > From: kbuild test robot 
> > To: kbu...@01.org
> > Cc: Julia Lawall 
> > Subject: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no
> > primary handler requested without IRQF_ONESHOT
> > 
> > TO: Sasha Levin 
> > CC: kbuild-...@01.org
> > CC: Andrew Morton 
> > CC: Linux Memory Management List 
> > 
> > Hi Sasha,
> > 
> > First bad commit (maybe != root cause):
> > 
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> > master
> > head:   bcee19f424a0d8c26ecf2607b73c690802658b29
> > commit: 71458cfc782eafe4b27656e078d379a34e472adf kernel: add support for 
> > gcc 5
> > date:   11 months ago
> > :: branch date: 12 hours ago
> > :: commit date: 11 months ago
> > 
> >>> drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no 
> >>> primary handler requested without IRQF_ONESHOT
> >drivers/power/wm831x_power.c:579:7-27: ERROR: Threaded IRQ with no 
> > primary handler requested without IRQF_ONESHOT
> >drivers/power/wm831x_power.c:592:8-28: ERROR: Threaded IRQ with no 
> > primary handler requested without IRQF_ONESHOT
> > --
> >>> drivers/power/88pm860x_battery.c:243:1-4: WARNING: end returns can be 
> >>> simpified if negative or 0 value
> > 
> > git remote add linus 
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > git remote update linus
> > git checkout 71458cfc782eafe4b27656e078d379a34e472adf
> > vim +569 drivers/power/wm831x_power.c
> > 
> > 35c3ae5e Mark Brown 2011-08-16  553 if (ret < 0)
> > 35c3ae5e Mark Brown 2011-08-16  554 goto err_wall;
> > 35c3ae5e Mark Brown 2011-08-16  555 power->have_battery = ret & 
> > WM831X_CHG_ENA;
> > 35c3ae5e Mark Brown 2011-08-16  556
> > 35c3ae5e Mark Brown 2011-08-16  557 if (power->have_battery) {
> > 35c3ae5e Mark Brown 2011-08-16  558 battery->name = 
> > power->battery_name;
> > 35c3ae5e Mark Brown 2011-08-16  559 battery->properties 
> > = wm831x_bat_props;
> > 35c3ae5e Mark Brown 2011-08-16  560 
> > battery->num_properties = ARRAY_SIZE(wm831x_bat_props);
> > 35c3ae5e Mark Brown 2011-08-16  561 
> > battery->get_property = wm831x_bat_get_prop;
> > 35c3ae5e Mark Brown 2011-08-16  562 
> > battery->use_for_apm = 1;
> > 35c3ae5e Mark Brown 2011-08-16  563 ret = 
> > power_supply_register(>dev, battery);
> > 35c3ae5e Mark Brown 2011-08-16  564 if (ret)
> > 35c3ae5e Mark Brown 2011-08-16  565 goto 
> > err_usb;
> > 35c3ae5e Mark Brown 2011-08-16  566 }
> > 3961f7c3 Mark Brown 2009-08-10  567
> > cd99758b Mark Brown 2012-05-14  568 irq = wm831x_irq(wm831x, 
> > platform_get_irq_byname(pdev, "SYSLO"));
> > b5874f33 Mark Brown 2010-03-10 @569 ret = request_threaded_irq(irq, 
> > NULL, wm831x_syslo_irq,
> > b5874f33 Mark Brown 2010-03-10  570
> > IRQF_TRIGGER_RISING, "System power low",
> > 3961f7c3 Mark Brown 2009-08-10  571
> > power);
> > 3961f7c3 Mark Brown 2009-08-10  572 if (ret != 0) {
> > 3961f7c3 Mark Brown 2009-08-10  573 dev_err(>dev, 
> > "Failed to request SYSLO IRQ %d: %d\n",
> > 3961f7c

Re: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT

2015-09-22 Thread Sasha Levin
Hi folks,

I'm slightly confused about the bisection: it points out to a gcc5
support patch, what does it have to do with wm831x?


Thanks,
Sasha

On 09/22/2015 01:28 PM, Valentin Rothberg wrote:
> Hi Sasha,
> 
> Julia forwarded the report (see below) to me.  Unless
> IRQCHIP_ONESHOT_SAFE is set, requesting a threaded IRQ will always fail
> when the primary handler is set to NULL.  In some cases there's a
> potential to run into stack overflows.
> 
> I attached a patch that fixes the issue.
> 
> Kind regards,
>  Valentin
> 
> -- Forwarded message --
> Date: Tue, 22 Sep 2015 21:42:18 +0800
> From: kbuild test robot 
> To: kbu...@01.org
> Cc: Julia Lawall 
> Subject: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no
> primary handler requested without IRQF_ONESHOT
> 
> TO: Sasha Levin 
> CC: kbuild-...@01.org
> CC: Andrew Morton 
> CC: Linux Memory Management List 
> 
> Hi Sasha,
> 
> First bad commit (maybe != root cause):
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> master
> head:   bcee19f424a0d8c26ecf2607b73c690802658b29
> commit: 71458cfc782eafe4b27656e078d379a34e472adf kernel: add support for gcc 5
> date:   11 months ago
> :::::: branch date: 12 hours ago
> :: commit date: 11 months ago
> 
>>> drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary 
>>> handler requested without IRQF_ONESHOT
>drivers/power/wm831x_power.c:579:7-27: ERROR: Threaded IRQ with no primary 
> handler requested without IRQF_ONESHOT
>drivers/power/wm831x_power.c:592:8-28: ERROR: Threaded IRQ with no primary 
> handler requested without IRQF_ONESHOT
> --
>>> drivers/power/88pm860x_battery.c:243:1-4: WARNING: end returns can be 
>>> simpified if negative or 0 value
> 
> git remote add linus 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git remote update linus
> git checkout 71458cfc782eafe4b27656e078d379a34e472adf
> vim +569 drivers/power/wm831x_power.c
> 
> 35c3ae5e Mark Brown 2011-08-16  553   if (ret < 0)
> 35c3ae5e Mark Brown 2011-08-16  554   goto err_wall;
> 35c3ae5e Mark Brown 2011-08-16  555   power->have_battery = ret & 
> WM831X_CHG_ENA;
> 35c3ae5e Mark Brown 2011-08-16  556
> 35c3ae5e Mark Brown 2011-08-16  557   if (power->have_battery) {
> 35c3ae5e Mark Brown 2011-08-16  558   battery->name = 
> power->battery_name;
> 35c3ae5e Mark Brown 2011-08-16  559   battery->properties = 
> wm831x_bat_props;
> 35c3ae5e Mark Brown 2011-08-16  560   battery->num_properties = 
> ARRAY_SIZE(wm831x_bat_props);
> 35c3ae5e Mark Brown 2011-08-16  561   battery->get_property = 
> wm831x_bat_get_prop;
> 35c3ae5e Mark Brown 2011-08-16  562   battery->use_for_apm = 1;
> 35c3ae5e Mark Brown 2011-08-16  563   ret = 
> power_supply_register(>dev, battery);
> 35c3ae5e Mark Brown 2011-08-16  564   if (ret)
> 35c3ae5e Mark Brown 2011-08-16  565   goto err_usb;
> 35c3ae5e Mark Brown 2011-08-16  566   }
> 3961f7c3 Mark Brown 2009-08-10  567
> cd99758b Mark Brown 2012-05-14  568   irq = wm831x_irq(wm831x, 
> platform_get_irq_byname(pdev, "SYSLO"));
> b5874f33 Mark Brown 2010-03-10 @569   ret = request_threaded_irq(irq, NULL, 
> wm831x_syslo_irq,
> b5874f33 Mark Brown 2010-03-10  570  
> IRQF_TRIGGER_RISING, "System power low",
> 3961f7c3 Mark Brown 2009-08-10  571  power);
> 3961f7c3 Mark Brown 2009-08-10  572   if (ret != 0) {
> 3961f7c3 Mark Brown 2009-08-10  573   dev_err(>dev, "Failed to 
> request SYSLO IRQ %d: %d\n",
> 3961f7c3 Mark Brown 2009-08-10  574   irq, ret);
> 35c3ae5e Mark Brown 2011-08-16  575   goto err_battery;
> 3961f7c3 Mark Brown 2009-08-10  576   }
> 3961f7c3 Mark Brown 2009-08-10  577
> 
> :: The code at line 569 was first introduced by commit
> :: b5874f33bbaf00586d05de37706491ee37057e11 wm831x_power: Use genirq
> 
> :: TO: Mark Brown 
> :: CC: Anton Vorontsov 
> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT

2015-09-22 Thread Valentin Rothberg
Hi Sasha,

Julia forwarded the report (see below) to me.  Unless
IRQCHIP_ONESHOT_SAFE is set, requesting a threaded IRQ will always fail
when the primary handler is set to NULL.  In some cases there's a
potential to run into stack overflows.

I attached a patch that fixes the issue.

Kind regards,
 Valentin

-- Forwarded message --
Date: Tue, 22 Sep 2015 21:42:18 +0800
From: kbuild test robot 
To: kbu...@01.org
Cc: Julia Lawall 
Subject: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no
primary handler requested without IRQF_ONESHOT

TO: Sasha Levin 
CC: kbuild-...@01.org
CC: Andrew Morton 
CC: Linux Memory Management List 

Hi Sasha,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   bcee19f424a0d8c26ecf2607b73c690802658b29
commit: 71458cfc782eafe4b27656e078d379a34e472adf kernel: add support for gcc 5
date:   11 months ago
:: branch date: 12 hours ago
:: commit date: 11 months ago

>> drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary 
>> handler requested without IRQF_ONESHOT
   drivers/power/wm831x_power.c:579:7-27: ERROR: Threaded IRQ with no primary 
handler requested without IRQF_ONESHOT
   drivers/power/wm831x_power.c:592:8-28: ERROR: Threaded IRQ with no primary 
handler requested without IRQF_ONESHOT
--
>> drivers/power/88pm860x_battery.c:243:1-4: WARNING: end returns can be 
>> simpified if negative or 0 value

git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout 71458cfc782eafe4b27656e078d379a34e472adf
vim +569 drivers/power/wm831x_power.c

35c3ae5e Mark Brown 2011-08-16  553 if (ret < 0)
35c3ae5e Mark Brown 2011-08-16  554 goto err_wall;
35c3ae5e Mark Brown 2011-08-16  555 power->have_battery = ret & 
WM831X_CHG_ENA;
35c3ae5e Mark Brown 2011-08-16  556
35c3ae5e Mark Brown 2011-08-16  557 if (power->have_battery) {
35c3ae5e Mark Brown 2011-08-16  558 battery->name = 
power->battery_name;
35c3ae5e Mark Brown 2011-08-16  559 battery->properties = 
wm831x_bat_props;
35c3ae5e Mark Brown 2011-08-16  560 battery->num_properties = 
ARRAY_SIZE(wm831x_bat_props);
35c3ae5e Mark Brown 2011-08-16  561 battery->get_property = 
wm831x_bat_get_prop;
35c3ae5e Mark Brown 2011-08-16  562 battery->use_for_apm = 1;
35c3ae5e Mark Brown 2011-08-16  563 ret = 
power_supply_register(>dev, battery);
35c3ae5e Mark Brown 2011-08-16  564 if (ret)
35c3ae5e Mark Brown 2011-08-16  565 goto err_usb;
35c3ae5e Mark Brown 2011-08-16  566 }
3961f7c3 Mark Brown 2009-08-10  567
cd99758b Mark Brown 2012-05-14  568 irq = wm831x_irq(wm831x, 
platform_get_irq_byname(pdev, "SYSLO"));
b5874f33 Mark Brown 2010-03-10 @569 ret = request_threaded_irq(irq, NULL, 
wm831x_syslo_irq,
b5874f33 Mark Brown 2010-03-10  570
IRQF_TRIGGER_RISING, "System power low",
3961f7c3 Mark Brown 2009-08-10  571power);
3961f7c3 Mark Brown 2009-08-10  572 if (ret != 0) {
3961f7c3 Mark Brown 2009-08-10  573 dev_err(>dev, "Failed to 
request SYSLO IRQ %d: %d\n",
3961f7c3 Mark Brown 2009-08-10  574 irq, ret);
35c3ae5e Mark Brown 2011-08-16  575 goto err_battery;
3961f7c3 Mark Brown 2009-08-10  576 }
3961f7c3 Mark Brown 2009-08-10  577

:: The code at line 569 was first introduced by commit
:: b5874f33bbaf00586d05de37706491ee37057e11 wm831x_power: Use genirq

:: TO: Mark Brown 
:: CC: Anton Vorontsov 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation
>From bceb7cace76aba9212db56be939bfecaacb75bc2 Mon Sep 17 00:00:00 2001
From: Valentin Rothberg 
Date: Tue, 22 Sep 2015 19:00:40 +0200
Subject: [PATCH] wm831x_power: Use IRQF_ONESHOT to request threaded IRQs

Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
threaded IRQs without a primary handler need to be requested with
IRQF_ONESHOT, otherwise the request will fail.

scripts/coccinelle/misc/irqf_oneshot.cocci detected this issue.

Fixes: b5874f33bbaf ("wm831x_power: Use genirq")
Signed-off-by: Valentin Rothberg 
---
 drivers/power/wm831x_power.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/power/wm831x_power.c b/drivers/power/wm831x_power.c
index db11ae6599f3..25f8b3409935 100644
--- a/drivers/power/wm831x_power.c
+++ b/drivers/power/wm831x_power.c
@@ -572,7 +572,7 @@ static int wm831x_power_probe(struct platform_device *pdev)
 
 	irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "SYSLO"));
 	ret = re

Re: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT

2015-09-22 Thread Sasha Levin
Hi folks,

I'm slightly confused about the bisection: it points out to a gcc5
support patch, what does it have to do with wm831x?


Thanks,
Sasha

On 09/22/2015 01:28 PM, Valentin Rothberg wrote:
> Hi Sasha,
> 
> Julia forwarded the report (see below) to me.  Unless
> IRQCHIP_ONESHOT_SAFE is set, requesting a threaded IRQ will always fail
> when the primary handler is set to NULL.  In some cases there's a
> potential to run into stack overflows.
> 
> I attached a patch that fixes the issue.
> 
> Kind regards,
>  Valentin
> 
> -- Forwarded message --
> Date: Tue, 22 Sep 2015 21:42:18 +0800
> From: kbuild test robot <fengguang...@intel.com>
> To: kbu...@01.org
> Cc: Julia Lawall <julia.law...@lip6.fr>
> Subject: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no
> primary handler requested without IRQF_ONESHOT
> 
> TO: Sasha Levin <sasha.le...@oracle.com>
> CC: kbuild-...@01.org
> CC: Andrew Morton <a...@linux-foundation.org>
> CC: Linux Memory Management List <linux...@kvack.org>
> 
> Hi Sasha,
> 
> First bad commit (maybe != root cause):
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> master
> head:   bcee19f424a0d8c26ecf2607b73c690802658b29
> commit: 71458cfc782eafe4b27656e078d379a34e472adf kernel: add support for gcc 5
> date:   11 months ago
> :: branch date: 12 hours ago
> :: commit date: 11 months ago
> 
>>> drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary 
>>> handler requested without IRQF_ONESHOT
>drivers/power/wm831x_power.c:579:7-27: ERROR: Threaded IRQ with no primary 
> handler requested without IRQF_ONESHOT
>drivers/power/wm831x_power.c:592:8-28: ERROR: Threaded IRQ with no primary 
> handler requested without IRQF_ONESHOT
> --
>>> drivers/power/88pm860x_battery.c:243:1-4: WARNING: end returns can be 
>>> simpified if negative or 0 value
> 
> git remote add linus 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git remote update linus
> git checkout 71458cfc782eafe4b27656e078d379a34e472adf
> vim +569 drivers/power/wm831x_power.c
> 
> 35c3ae5e Mark Brown 2011-08-16  553   if (ret < 0)
> 35c3ae5e Mark Brown 2011-08-16  554   goto err_wall;
> 35c3ae5e Mark Brown 2011-08-16  555   power->have_battery = ret & 
> WM831X_CHG_ENA;
> 35c3ae5e Mark Brown 2011-08-16  556
> 35c3ae5e Mark Brown 2011-08-16  557   if (power->have_battery) {
> 35c3ae5e Mark Brown 2011-08-16  558   battery->name = 
> power->battery_name;
> 35c3ae5e Mark Brown 2011-08-16  559   battery->properties = 
> wm831x_bat_props;
> 35c3ae5e Mark Brown 2011-08-16  560   battery->num_properties = 
> ARRAY_SIZE(wm831x_bat_props);
> 35c3ae5e Mark Brown 2011-08-16  561   battery->get_property = 
> wm831x_bat_get_prop;
> 35c3ae5e Mark Brown 2011-08-16  562   battery->use_for_apm = 1;
> 35c3ae5e Mark Brown 2011-08-16  563   ret = 
> power_supply_register(>dev, battery);
> 35c3ae5e Mark Brown 2011-08-16  564   if (ret)
> 35c3ae5e Mark Brown 2011-08-16  565   goto err_usb;
> 35c3ae5e Mark Brown 2011-08-16  566   }
> 3961f7c3 Mark Brown 2009-08-10  567
> cd99758b Mark Brown 2012-05-14  568   irq = wm831x_irq(wm831x, 
> platform_get_irq_byname(pdev, "SYSLO"));
> b5874f33 Mark Brown 2010-03-10 @569   ret = request_threaded_irq(irq, NULL, 
> wm831x_syslo_irq,
> b5874f33 Mark Brown 2010-03-10  570  
> IRQF_TRIGGER_RISING, "System power low",
> 3961f7c3 Mark Brown 2009-08-10  571  power);
> 3961f7c3 Mark Brown 2009-08-10  572   if (ret != 0) {
> 3961f7c3 Mark Brown 2009-08-10  573   dev_err(>dev, "Failed to 
> request SYSLO IRQ %d: %d\n",
> 3961f7c3 Mark Brown 2009-08-10  574   irq, ret);
> 35c3ae5e Mark Brown 2011-08-16  575   goto err_battery;
> 3961f7c3 Mark Brown 2009-08-10  576   }
> 3961f7c3 Mark Brown 2009-08-10  577
> 
> :: The code at line 569 was first introduced by commit
> :: b5874f33bbaf00586d05de37706491ee37057e11 wm831x_power: Use genirq
> 
> :: TO: Mark Brown <broo...@opensource.wolfsonmicro.com>
> :: CC: Anton Vorontsov <cbouatmai...@gmail.com>
> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT

2015-09-22 Thread Valentin Rothberg
Hi Sasha,

On Sep 22 '15 15:41, Sasha Levin wrote:
> Hi folks,
> 
> I'm slightly confused about the bisection: it points out to a gcc5
> support patch, what does it have to do with wm831x?

I don't know why it points to the gcc patch.  I asked this myself as
well and I couldn't figure out a relation between you and the driver,
but somehow I trusted the report - a machine must know better :)
Sorry for making the noise.

I CCed Anton, who signed with Mark the responsible commit.

Best regards,
 Valentin

> Thanks,
> Sasha
> 
> On 09/22/2015 01:28 PM, Valentin Rothberg wrote:
> > Hi Sasha,
> > 
> > Julia forwarded the report (see below) to me.  Unless
> > IRQCHIP_ONESHOT_SAFE is set, requesting a threaded IRQ will always fail
> > when the primary handler is set to NULL.  In some cases there's a
> > potential to run into stack overflows.
> > 
> > I attached a patch that fixes the issue.
> > 
> > Kind regards,
> >  Valentin
> > 
> > -- Forwarded message --
> > Date: Tue, 22 Sep 2015 21:42:18 +0800
> > From: kbuild test robot <fengguang...@intel.com>
> > To: kbu...@01.org
> > Cc: Julia Lawall <julia.law...@lip6.fr>
> > Subject: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no
> > primary handler requested without IRQF_ONESHOT
> > 
> > TO: Sasha Levin <sasha.le...@oracle.com>
> > CC: kbuild-...@01.org
> > CC: Andrew Morton <a...@linux-foundation.org>
> > CC: Linux Memory Management List <linux...@kvack.org>
> > 
> > Hi Sasha,
> > 
> > First bad commit (maybe != root cause):
> > 
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> > master
> > head:   bcee19f424a0d8c26ecf2607b73c690802658b29
> > commit: 71458cfc782eafe4b27656e078d379a34e472adf kernel: add support for 
> > gcc 5
> > date:   11 months ago
> > :: branch date: 12 hours ago
> > :: commit date: 11 months ago
> > 
> >>> drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no 
> >>> primary handler requested without IRQF_ONESHOT
> >drivers/power/wm831x_power.c:579:7-27: ERROR: Threaded IRQ with no 
> > primary handler requested without IRQF_ONESHOT
> >drivers/power/wm831x_power.c:592:8-28: ERROR: Threaded IRQ with no 
> > primary handler requested without IRQF_ONESHOT
> > --
> >>> drivers/power/88pm860x_battery.c:243:1-4: WARNING: end returns can be 
> >>> simpified if negative or 0 value
> > 
> > git remote add linus 
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > git remote update linus
> > git checkout 71458cfc782eafe4b27656e078d379a34e472adf
> > vim +569 drivers/power/wm831x_power.c
> > 
> > 35c3ae5e Mark Brown 2011-08-16  553 if (ret < 0)
> > 35c3ae5e Mark Brown 2011-08-16  554 goto err_wall;
> > 35c3ae5e Mark Brown 2011-08-16  555 power->have_battery = ret & 
> > WM831X_CHG_ENA;
> > 35c3ae5e Mark Brown 2011-08-16  556
> > 35c3ae5e Mark Brown 2011-08-16  557 if (power->have_battery) {
> > 35c3ae5e Mark Brown 2011-08-16  558 battery->name = 
> > power->battery_name;
> > 35c3ae5e Mark Brown 2011-08-16  559 battery->properties 
> > = wm831x_bat_props;
> > 35c3ae5e Mark Brown 2011-08-16  560 
> > battery->num_properties = ARRAY_SIZE(wm831x_bat_props);
> > 35c3ae5e Mark Brown 2011-08-16  561 
> > battery->get_property = wm831x_bat_get_prop;
> > 35c3ae5e Mark Brown 2011-08-16  562 
> > battery->use_for_apm = 1;
> > 35c3ae5e Mark Brown 2011-08-16  563 ret = 
> > power_supply_register(>dev, battery);
> > 35c3ae5e Mark Brown 2011-08-16  564 if (ret)
> > 35c3ae5e Mark Brown 2011-08-16  565 goto 
> > err_usb;
> > 35c3ae5e Mark Brown 2011-08-16  566 }
> > 3961f7c3 Mark Brown 2009-08-10  567
> > cd99758b Mark Brown 2012-05-14  568 irq = wm831x_irq(wm831x, 
> > platform_get_irq_byname(pdev, "SYSLO"));
> > b5874f33 Mark Brown 2010-03-10 @569 ret = request_threaded_irq(irq, 
> > NULL, wm831x_syslo_irq,
> > b5874f33 Mark Brown 2010-03-10  570
> > IRQF_TRIGGER_RISING, "System power low",
> > 3961f7c3 Mark Brown 2009-08-10  571
> > power);
> > 3961f7c3 Mark Brown 2009-08-10  572 if (ret != 0) {
> > 

Re: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT

2015-09-22 Thread Valentin Rothberg
Hi Sasha,

Julia forwarded the report (see below) to me.  Unless
IRQCHIP_ONESHOT_SAFE is set, requesting a threaded IRQ will always fail
when the primary handler is set to NULL.  In some cases there's a
potential to run into stack overflows.

I attached a patch that fixes the issue.

Kind regards,
 Valentin

-- Forwarded message --
Date: Tue, 22 Sep 2015 21:42:18 +0800
From: kbuild test robot <fengguang...@intel.com>
To: kbu...@01.org
Cc: Julia Lawall <julia.law...@lip6.fr>
Subject: drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no
primary handler requested without IRQF_ONESHOT

TO: Sasha Levin <sasha.le...@oracle.com>
CC: kbuild-...@01.org
CC: Andrew Morton <a...@linux-foundation.org>
CC: Linux Memory Management List <linux...@kvack.org>

Hi Sasha,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   bcee19f424a0d8c26ecf2607b73c690802658b29
commit: 71458cfc782eafe4b27656e078d379a34e472adf kernel: add support for gcc 5
date:   11 months ago
:: branch date: 12 hours ago
:: commit date: 11 months ago

>> drivers/power/wm831x_power.c:569:7-27: ERROR: Threaded IRQ with no primary 
>> handler requested without IRQF_ONESHOT
   drivers/power/wm831x_power.c:579:7-27: ERROR: Threaded IRQ with no primary 
handler requested without IRQF_ONESHOT
   drivers/power/wm831x_power.c:592:8-28: ERROR: Threaded IRQ with no primary 
handler requested without IRQF_ONESHOT
--
>> drivers/power/88pm860x_battery.c:243:1-4: WARNING: end returns can be 
>> simpified if negative or 0 value

git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout 71458cfc782eafe4b27656e078d379a34e472adf
vim +569 drivers/power/wm831x_power.c

35c3ae5e Mark Brown 2011-08-16  553 if (ret < 0)
35c3ae5e Mark Brown 2011-08-16  554 goto err_wall;
35c3ae5e Mark Brown 2011-08-16  555 power->have_battery = ret & 
WM831X_CHG_ENA;
35c3ae5e Mark Brown 2011-08-16  556
35c3ae5e Mark Brown 2011-08-16  557 if (power->have_battery) {
35c3ae5e Mark Brown 2011-08-16  558 battery->name = 
power->battery_name;
35c3ae5e Mark Brown 2011-08-16  559 battery->properties = 
wm831x_bat_props;
35c3ae5e Mark Brown 2011-08-16  560 battery->num_properties = 
ARRAY_SIZE(wm831x_bat_props);
35c3ae5e Mark Brown 2011-08-16  561 battery->get_property = 
wm831x_bat_get_prop;
35c3ae5e Mark Brown 2011-08-16  562 battery->use_for_apm = 1;
35c3ae5e Mark Brown 2011-08-16  563 ret = 
power_supply_register(>dev, battery);
35c3ae5e Mark Brown 2011-08-16  564 if (ret)
35c3ae5e Mark Brown 2011-08-16  565 goto err_usb;
35c3ae5e Mark Brown 2011-08-16  566 }
3961f7c3 Mark Brown 2009-08-10  567
cd99758b Mark Brown 2012-05-14  568 irq = wm831x_irq(wm831x, 
platform_get_irq_byname(pdev, "SYSLO"));
b5874f33 Mark Brown 2010-03-10 @569 ret = request_threaded_irq(irq, NULL, 
wm831x_syslo_irq,
b5874f33 Mark Brown 2010-03-10  570
IRQF_TRIGGER_RISING, "System power low",
3961f7c3 Mark Brown 2009-08-10  571power);
3961f7c3 Mark Brown 2009-08-10  572 if (ret != 0) {
3961f7c3 Mark Brown 2009-08-10  573 dev_err(>dev, "Failed to 
request SYSLO IRQ %d: %d\n",
3961f7c3 Mark Brown 2009-08-10  574 irq, ret);
35c3ae5e Mark Brown 2011-08-16  575 goto err_battery;
3961f7c3 Mark Brown 2009-08-10  576 }
3961f7c3 Mark Brown 2009-08-10  577

:: The code at line 569 was first introduced by commit
:: b5874f33bbaf00586d05de37706491ee37057e11 wm831x_power: Use genirq

:: TO: Mark Brown <broo...@opensource.wolfsonmicro.com>
:: CC: Anton Vorontsov <cbouatmai...@gmail.com>

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation
>From bceb7cace76aba9212db56be939bfecaacb75bc2 Mon Sep 17 00:00:00 2001
From: Valentin Rothberg <valentinrothb...@gmail.com>
Date: Tue, 22 Sep 2015 19:00:40 +0200
Subject: [PATCH] wm831x_power: Use IRQF_ONESHOT to request threaded IRQs

Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
threaded IRQs without a primary handler need to be requested with
IRQF_ONESHOT, otherwise the request will fail.

scripts/coccinelle/misc/irqf_oneshot.cocci detected this issue.

Fixes: b5874f33bbaf ("wm831x_power: Use genirq")
Signed-off-by: Valentin Rothberg <valentinrothb...@gmail.com>
---
 drivers/power/wm831x_power.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/power/wm831x_power.c b/drivers/power/wm831x_power.