linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Power driver patches to avoid lockdep complaints
@ 2016-06-15 21:13 Paul E. McKenney
  2016-08-18 22:51 ` Tony Lindgren
  0 siblings, 1 reply; 14+ messages in thread
From: Paul E. McKenney @ 2016-06-15 21:13 UTC (permalink / raw)
  To: rjw, pavel, tony, linux; +Cc: rostedt, linux-pm

Hello!

Ingo was not comfortable taking these through -tip, which is understandable,
given that they don't depend on each other or on anything else not already
in mainline, and that they don't have anything to do with -tip.

So what would you guys like to do with these?

They may be pulled from 13e698e68f75 (power: Use _rcuidle for
suspend/resume tracepoints) in my -rcu tree:

	git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

							Thanx, Paul


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

* Re: Power driver patches to avoid lockdep complaints
  2016-06-15 21:13 Power driver patches to avoid lockdep complaints Paul E. McKenney
@ 2016-08-18 22:51 ` Tony Lindgren
  2016-08-20  1:40   ` Rafael J. Wysocki
  0 siblings, 1 reply; 14+ messages in thread
From: Tony Lindgren @ 2016-08-18 22:51 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: rjw, pavel, linux, rostedt, linux-pm

Hi,

* Paul E. McKenney <paulmck@linux.vnet.ibm.com> [160615 14:16]:
> Hello!
> 
> Ingo was not comfortable taking these through -tip, which is understandable,
> given that they don't depend on each other or on anything else not already
> in mainline, and that they don't have anything to do with -tip.
> 
> So what would you guys like to do with these?
> 
> They may be pulled from 13e698e68f75 (power: Use _rcuidle for
> suspend/resume tracepoints) in my -rcu tree:
> 
> 	git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> 

Rafael, looks like commit 13e698e68f75 is still missing from the
mainline tree. Care to merge it to your fixes so I don't have to
keep looking at that splat on daily basis?

Regards,

Tony

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

* Re: Power driver patches to avoid lockdep complaints
  2016-08-18 22:51 ` Tony Lindgren
@ 2016-08-20  1:40   ` Rafael J. Wysocki
  2016-08-20 14:28     ` Tony Lindgren
  0 siblings, 1 reply; 14+ messages in thread
From: Rafael J. Wysocki @ 2016-08-20  1:40 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Paul E. McKenney, pavel, linux, rostedt, linux-pm

On Thursday, August 18, 2016 03:51:52 PM Tony Lindgren wrote:
> Hi,
> 
> * Paul E. McKenney <paulmck@linux.vnet.ibm.com> [160615 14:16]:
> > Hello!
> > 
> > Ingo was not comfortable taking these through -tip, which is understandable,
> > given that they don't depend on each other or on anything else not already
> > in mainline, and that they don't have anything to do with -tip.
> > 
> > So what would you guys like to do with these?
> > 
> > They may be pulled from 13e698e68f75 (power: Use _rcuidle for
> > suspend/resume tracepoints) in my -rcu tree:
> > 
> > 	git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > 
> 
> Rafael, looks like commit 13e698e68f75 is still missing from the
> mainline tree. Care to merge it to your fixes so I don't have to
> keep looking at that splat on daily basis?

I could pull it if I knew where to pull it from.  The above gives me
"Already up-to-date."

Thanks,
Rafael


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

* Re: Power driver patches to avoid lockdep complaints
  2016-08-20  1:40   ` Rafael J. Wysocki
@ 2016-08-20 14:28     ` Tony Lindgren
  2016-08-22 17:34       ` Rafael J. Wysocki
  0 siblings, 1 reply; 14+ messages in thread
From: Tony Lindgren @ 2016-08-20 14:28 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Paul E. McKenney, pavel, linux, rostedt, linux-pm

* Rafael J. Wysocki <rjw@rjwysocki.net> [160819 18:35]:
> On Thursday, August 18, 2016 03:51:52 PM Tony Lindgren wrote:
> > Hi,
> > 
> > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> [160615 14:16]:
> > > Hello!
> > > 
> > > Ingo was not comfortable taking these through -tip, which is understandable,
> > > given that they don't depend on each other or on anything else not already
> > > in mainline, and that they don't have anything to do with -tip.
> > > 
> > > So what would you guys like to do with these?
> > > 
> > > They may be pulled from 13e698e68f75 (power: Use _rcuidle for
> > > suspend/resume tracepoints) in my -rcu tree:
> > > 
> > > 	git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > 
> > 
> > Rafael, looks like commit 13e698e68f75 is still missing from the
> > mainline tree. Care to merge it to your fixes so I don't have to
> > keep looking at that splat on daily basis?
> 
> I could pull it if I knew where to pull it from.  The above gives me
> "Already up-to-date."

Here are the ones still missing:

$ git log --pretty=oneline v4.7-rc2..13e698e68f75
13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle

So maybe just git merge 13e698e68f75 if you have the linux-rcu.git
fetched and the above look OK to you?

Regards,

Tony

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

* Re: Power driver patches to avoid lockdep complaints
  2016-08-20 14:28     ` Tony Lindgren
@ 2016-08-22 17:34       ` Rafael J. Wysocki
  2016-08-22 17:43         ` Paul E. McKenney
  2016-08-23  0:45         ` Tony Lindgren
  0 siblings, 2 replies; 14+ messages in thread
From: Rafael J. Wysocki @ 2016-08-22 17:34 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Paul E. McKenney, pavel, linux, rostedt, linux-pm

On Saturday, August 20, 2016 07:28:37 AM Tony Lindgren wrote:
> * Rafael J. Wysocki <rjw@rjwysocki.net> [160819 18:35]:
> > On Thursday, August 18, 2016 03:51:52 PM Tony Lindgren wrote:
> > > Hi,
> > > 
> > > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> [160615 14:16]:
> > > > Hello!
> > > > 
> > > > Ingo was not comfortable taking these through -tip, which is understandable,
> > > > given that they don't depend on each other or on anything else not already
> > > > in mainline, and that they don't have anything to do with -tip.
> > > > 
> > > > So what would you guys like to do with these?
> > > > 
> > > > They may be pulled from 13e698e68f75 (power: Use _rcuidle for
> > > > suspend/resume tracepoints) in my -rcu tree:
> > > > 
> > > > 	git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > > 
> > > 
> > > Rafael, looks like commit 13e698e68f75 is still missing from the
> > > mainline tree. Care to merge it to your fixes so I don't have to
> > > keep looking at that splat on daily basis?
> > 
> > I could pull it if I knew where to pull it from.  The above gives me
> > "Already up-to-date."
> 
> Here are the ones still missing:
> 
> $ git log --pretty=oneline v4.7-rc2..13e698e68f75
> 13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
> 320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
> b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle
> 
> So maybe just git merge 13e698e68f75 if you have the linux-rcu.git
> fetched and the above look OK to you?

If I do

$ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

and then

$ git show 13e698e68f75

then it tells me

fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.

Do I need to fetch it in any special way or something?

Thanks,
Rafael


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

* Re: Power driver patches to avoid lockdep complaints
  2016-08-22 17:34       ` Rafael J. Wysocki
@ 2016-08-22 17:43         ` Paul E. McKenney
  2016-08-23  0:45         ` Tony Lindgren
  1 sibling, 0 replies; 14+ messages in thread
From: Paul E. McKenney @ 2016-08-22 17:43 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Tony Lindgren, pavel, linux, rostedt, linux-pm

[-- Attachment #1: Type: text/plain, Size: 6313 bytes --]

On Mon, Aug 22, 2016 at 07:34:57PM +0200, Rafael J. Wysocki wrote:
> On Saturday, August 20, 2016 07:28:37 AM Tony Lindgren wrote:
> > * Rafael J. Wysocki <rjw@rjwysocki.net> [160819 18:35]:
> > > On Thursday, August 18, 2016 03:51:52 PM Tony Lindgren wrote:
> > > > Hi,
> > > > 
> > > > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> [160615 14:16]:
> > > > > Hello!
> > > > > 
> > > > > Ingo was not comfortable taking these through -tip, which is understandable,
> > > > > given that they don't depend on each other or on anything else not already
> > > > > in mainline, and that they don't have anything to do with -tip.
> > > > > 
> > > > > So what would you guys like to do with these?
> > > > > 
> > > > > They may be pulled from 13e698e68f75 (power: Use _rcuidle for
> > > > > suspend/resume tracepoints) in my -rcu tree:
> > > > > 
> > > > > 	git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > > > 
> > > > 
> > > > Rafael, looks like commit 13e698e68f75 is still missing from the
> > > > mainline tree. Care to merge it to your fixes so I don't have to
> > > > keep looking at that splat on daily basis?
> > > 
> > > I could pull it if I knew where to pull it from.  The above gives me
> > > "Already up-to-date."
> > 
> > Here are the ones still missing:
> > 
> > $ git log --pretty=oneline v4.7-rc2..13e698e68f75
> > 13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
> > 320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
> > b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle
> > 
> > So maybe just git merge 13e698e68f75 if you have the linux-rcu.git
> > fetched and the above look OK to you?
> 
> If I do
> 
> $ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> 
> and then
> 
> $ git show 13e698e68f75
> 
> then it tells me
> 
> fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.
> 
> Do I need to fetch it in any special way or something?

Strange.  When I do "git show 13e698e68f75" in my local -rcu repo, I
get the following.  I get the same from my test repository that pulls
from kernel.org, and also when I "git clone" a fresh image of -rcu.

So maybe a fresh clone of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git?

I have added the other two commits as attachments, so feel free to apply
them from this email, if that works better for you.

							Thanx, Paul

------------------------------------------------------------------------

commit 13e698e68f75708c45241a2dad23cd6b65181056
Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Date:   Tue Apr 26 10:42:25 2016 -0700

    power: Use _rcuidle for suspend/resume tracepoints
    
    Further testing with false negatives suppressed by commit 293e2421fe25
    ("rcu: Remove superfluous versions of rcu_read_lock_sched_held()")
    identified a few more unprotected uses of RCU from the idle loop.
    Because RCU actively ignores idle-loop code (for energy-efficiency
    reasons, among other things), using RCU from the idle loop can result
    in too-short grace periods, in turn resulting in arbitrary misbehavior.
    
    The affected function is rpm_suspend().
    
    The resulting lockdep-RCU splat is as follows:
    
    ------------------------------------------------------------------------
    
    Warning from omap3
    ===============================
    [ INFO: suspicious RCU usage. ]
    4.6.0-rc5-next-20160426+ #1112 Not tainted
    -------------------------------
    include/trace/events/rpm.h:63 suspicious rcu_dereference_check() usage!
    
    other info that might help us debug this:
    
    RCU used illegally from idle CPU!
    rcu_scheduler_active = 1, debug_locks = 0
    RCU used illegally from extended quiescent state!
    1 lock held by swapper/0/0:
     #0:  (&(&dev->power.lock)->rlock){-.-...}, at: [<c052ee24>] __pm_runtime_suspend+0x54/0x84
    
    stack backtrace:
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.6.0-rc5-next-20160426+ #1112
    Hardware name: Generic OMAP36xx (Flattened Device Tree)
    [<c0110308>] (unwind_backtrace) from [<c010c3a8>] (show_stack+0x10/0x14)
    [<c010c3a8>] (show_stack) from [<c047fec8>] (dump_stack+0xb0/0xe4)
    [<c047fec8>] (dump_stack) from [<c052d7b4>] (rpm_suspend+0x604/0x7e4)
    [<c052d7b4>] (rpm_suspend) from [<c052ee34>] (__pm_runtime_suspend+0x64/0x84)
    [<c052ee34>] (__pm_runtime_suspend) from [<c04bf3bc>] (omap2_gpio_prepare_for_idle+0x5c/0x70)
    [<c04bf3bc>] (omap2_gpio_prepare_for_idle) from [<c01255e8>] (omap_sram_idle+0x140/0x244)
    [<c01255e8>] (omap_sram_idle) from [<c0126b48>] (omap3_enter_idle_bm+0xfc/0x1ec)
    [<c0126b48>] (omap3_enter_idle_bm) from [<c0601db8>] (cpuidle_enter_state+0x80/0x3d4)
    [<c0601db8>] (cpuidle_enter_state) from [<c0183c74>] (cpu_startup_entry+0x198/0x3a0)
    [<c0183c74>] (cpu_startup_entry) from [<c0b00c0c>] (start_kernel+0x354/0x3c8)
    [<c0b00c0c>] (start_kernel) from [<8000807c>] (0x8000807c)
    
    ------------------------------------------------------------------------
    
    Reported-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Tested-by: Tony Lindgren <tony@atomide.com>
    Tested-by: Guenter Roeck <linux@roeck-us.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
    Cc: Pavel Machek <pavel@ucw.cz>
    Cc: <linux-omap@vger.kernel.org>
    Cc: <linux-arm-kernel@lists.infradead.org>
    Cc: <linux-pm@vger.kernel.org>

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index fd553d0cbb6b..15b6d5b199d4 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -419,7 +419,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
 	struct device *parent = NULL;
 	int retval;
 
-	trace_rpm_suspend(dev, rpmflags);
+	trace_rpm_suspend_rcuidle(dev, rpmflags);
 
  repeat:
 	retval = rpm_check_suspend_allowed(dev);
@@ -549,7 +549,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
 	}
 
  out:
-	trace_rpm_return_int(dev, _THIS_IP_, retval);
+	trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval);
 
 	return retval;
 

[-- Attachment #2: diffs.320e2a2d081b6c519f80fca9377b8fb90db7bb9c --]
[-- Type: text/plain, Size: 3057 bytes --]

commit 320e2a2d081b6c519f80fca9377b8fb90db7bb9c
Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Date:   Tue Apr 26 13:38:55 2016 -0700

    power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
    
    This commit applies another _rcuidle suffix to fix an RCU use from
    idle.
    
    > ===============================
    > [ INFO: suspicious RCU usage. ]
    > 4.6.0-rc5-next-20160426+ #1122 Not tainted
    > -------------------------------
    > include/trace/events/rpm.h:69 suspicious rcu_dereference_check() usage!
    >
    > other info that might help us debug this:
    >
    >
    > RCU used illegally from idle CPU!
    > rcu_scheduler_active = 1, debug_locks = 0
    > RCU used illegally from extended quiescent state!
    > 1 lock held by swapper/0/0:
    >  #0:  (&(&dev->power.lock)->rlock){-.-...}, at: [<c052e3dc>] __pm_runtime_resume+0x3c/0x64
    >
    > stack backtrace:
    > CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.6.0-rc5-next-20160426+ #1122
    > Hardware name: Generic OMAP36xx (Flattened Device Tree)
    > [<c0110290>] (unwind_backtrace) from [<c010c3a8>] (show_stack+0x10/0x14)
    > [<c010c3a8>] (show_stack) from [<c047fd68>] (dump_stack+0xb0/0xe4)
    > [<c047fd68>] (dump_stack) from [<c052e178>] (rpm_resume+0x5cc/0x7f4)
    > [<c052e178>] (rpm_resume) from [<c052e3ec>] (__pm_runtime_resume+0x4c/0x64)
    > [<c052e3ec>] (__pm_runtime_resume) from [<c04bf2c4>] (omap2_gpio_resume_after_idle+0x54/0x68)
    > [<c04bf2c4>] (omap2_gpio_resume_after_idle) from [<c01269dc>] (omap3_enter_idle_bm+0xfc/0x1ec)
    > [<c01269dc>] (omap3_enter_idle_bm) from [<c060198c>] (cpuidle_enter_state+0x80/0x3d4)
    > [<c060198c>] (cpuidle_enter_state) from [<c0183b08>] (cpu_startup_entry+0x198/0x3a0)
    > [<c0183b08>] (cpu_startup_entry) from [<c0b00c0c>] (start_kernel+0x354/0x3c8)
    > [<c0b00c0c>] (start_kernel) from [<8000807c>] (0x8000807c)
    
    Reported-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Tested-by: Tony Lindgren <tony@atomide.com>
    Tested-by: Guenter Roeck <linux@roeck-us.net>
    Cc: Russell King <linux@arm.linux.org.uk>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
    Cc: <linux-omap@vger.kernel.org>
    Cc: <linux-arm-kernel@lists.infradead.org>
    Cc: <linux-pm@vger.kernel.org>

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index da38ecf022f7..fd553d0cbb6b 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -601,7 +601,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
 	struct device *parent = NULL;
 	int retval = 0;
 
-	trace_rpm_resume(dev, rpmflags);
+	trace_rpm_resume_rcuidle(dev, rpmflags);
 
  repeat:
 	if (dev->power.runtime_error)
@@ -764,7 +764,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
 		spin_lock_irq(&dev->power.lock);
 	}
 
-	trace_rpm_return_int(dev, _THIS_IP_, retval);
+	trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval);
 
 	return retval;
 }

[-- Attachment #3: diffs.b72aadb1d082d3935cbffd60e979238252045971 --]
[-- Type: text/plain, Size: 3600 bytes --]

commit b72aadb1d082d3935cbffd60e979238252045971
Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Date:   Tue Apr 26 13:03:51 2016 -0700

    power: Add _rcuidle suffix to allow rpm_idle() use from idle
    
    This commit appends a few _rcuidle suffixes to fix the following
    RCU-used-from-idle bug:
    
    > ===============================
    > [ INFO: suspicious RCU usage. ]
    > 4.6.0-rc5-next-20160426+ #1116 Not tainted
    > -------------------------------
    > include/trace/events/rpm.h:95 suspicious rcu_dereference_check() usage!
    >
    > other info that might help us debug this:
    >
    >
    > RCU used illegally from idle CPU!
    > rcu_scheduler_active = 1, debug_locks = 0
    > RCU used illegally from extended quiescent state!
    > 1 lock held by swapper/0/0:
    >  #0:  (&(&dev->power.lock)->rlock){-.-...}, at: [<c052cc2c>] __rpm_callback+0x58/0x60
    >
    > stack backtrace:
    > CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.6.0-rc5-next-20160426+ #1116
    > Hardware name: Generic OMAP36xx (Flattened Device Tree)
    > [<c0110290>] (unwind_backtrace) from [<c010c3a8>] (show_stack+0x10/0x14)
    > [<c010c3a8>] (show_stack) from [<c047fd68>] (dump_stack+0xb0/0xe4)
    > [<c047fd68>] (dump_stack) from [<c052d5d0>] (rpm_suspend+0x580/0x768)
    > [<c052d5d0>] (rpm_suspend) from [<c052ec58>] (__pm_runtime_suspend+0x64/0x84)
    > [<c052ec58>] (__pm_runtime_suspend) from [<c04bf25c>] (omap2_gpio_prepare_for_idle+0x5c/0x70)
    > [<c04bf25c>] (omap2_gpio_prepare_for_idle) from [<c0125568>] (omap_sram_idle+0x140/0x244)
    > [<c0125568>] (omap_sram_idle) from [<c01269dc>] (omap3_enter_idle_bm+0xfc/0x1ec)
    > [<c01269dc>] (omap3_enter_idle_bm) from [<c0601bdc>] (cpuidle_enter_state+0x80/0x3d4)
    > [<c0601bdc>] (cpuidle_enter_state) from [<c0183b08>] (cpu_startup_entry+0x198/0x3a0)
    > [<c0183b08>] (cpu_startup_entry) from [<c0b00c0c>] (start_kernel+0x354/0x3c8)
    > [<c0b00c0c>] (start_kernel) from [<8000807c>] (0x8000807c)
    
    In the immortal words of Steven Rostedt, "*Whack* *Whack* *Whack*!!!"
    
    Reported-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Tested-by: Tony Lindgren <tony@atomide.com>
    Tested-by: Guenter Roeck <linux@roeck-us.net>
    Cc: Russell King <linux@arm.linux.org.uk>
    WhACKED-by: Steven Rostedt <rostedt@goodmis.org>
    Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
    Cc: <linux-omap@vger.kernel.org>
    Cc: <linux-arm-kernel@lists.infradead.org>
    Cc: <linux-pm@vger.kernel.org>

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 4c7055009bd6..da38ecf022f7 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -301,7 +301,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
 	int (*callback)(struct device *);
 	int retval;
 
-	trace_rpm_idle(dev, rpmflags);
+	trace_rpm_idle_rcuidle(dev, rpmflags);
 	retval = rpm_check_suspend_allowed(dev);
 	if (retval < 0)
 		;	/* Conditions are wrong. */
@@ -337,7 +337,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
 			dev->power.request_pending = true;
 			queue_work(pm_wq, &dev->power.work);
 		}
-		trace_rpm_return_int(dev, _THIS_IP_, 0);
+		trace_rpm_return_int_rcuidle(dev, _THIS_IP_, 0);
 		return 0;
 	}
 
@@ -352,7 +352,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
 	wake_up_all(&dev->power.wait_queue);
 
  out:
-	trace_rpm_return_int(dev, _THIS_IP_, retval);
+	trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval);
 	return retval ? retval : rpm_suspend(dev, rpmflags | RPM_AUTO);
 }
 

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

* Re: Power driver patches to avoid lockdep complaints
  2016-08-22 17:34       ` Rafael J. Wysocki
  2016-08-22 17:43         ` Paul E. McKenney
@ 2016-08-23  0:45         ` Tony Lindgren
  2016-08-23  0:59           ` Paul E. McKenney
  1 sibling, 1 reply; 14+ messages in thread
From: Tony Lindgren @ 2016-08-23  0:45 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Paul E. McKenney, pavel, linux, rostedt, linux-pm

* Rafael J. Wysocki <rjw@rjwysocki.net> [160822 10:30]:
> On Saturday, August 20, 2016 07:28:37 AM Tony Lindgren wrote:
> > * Rafael J. Wysocki <rjw@rjwysocki.net> [160819 18:35]:
> > > On Thursday, August 18, 2016 03:51:52 PM Tony Lindgren wrote:
> > > > Hi,
> > > > 
> > > > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> [160615 14:16]:
> > > > > Hello!
> > > > > 
> > > > > Ingo was not comfortable taking these through -tip, which is understandable,
> > > > > given that they don't depend on each other or on anything else not already
> > > > > in mainline, and that they don't have anything to do with -tip.
> > > > > 
> > > > > So what would you guys like to do with these?
> > > > > 
> > > > > They may be pulled from 13e698e68f75 (power: Use _rcuidle for
> > > > > suspend/resume tracepoints) in my -rcu tree:
> > > > > 
> > > > > 	git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > > > 
> > > > 
> > > > Rafael, looks like commit 13e698e68f75 is still missing from the
> > > > mainline tree. Care to merge it to your fixes so I don't have to
> > > > keep looking at that splat on daily basis?
> > > 
> > > I could pull it if I knew where to pull it from.  The above gives me
> > > "Already up-to-date."
> > 
> > Here are the ones still missing:
> > 
> > $ git log --pretty=oneline v4.7-rc2..13e698e68f75
> > 13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
> > 320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
> > b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle
> > 
> > So maybe just git merge 13e698e68f75 if you have the linux-rcu.git
> > fetched and the above look OK to you?
> 
> If I do
> 
> $ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> 
> and then
> 
> $ git show 13e698e68f75
> 
> then it tells me
> 
> fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.
> 
> Do I need to fetch it in any special way or something?

Well I usuall add things to my .git/config like:

[remote "rcu"]
	url = git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
	fetch = refs/heads/*:refs/remotes/rcu/*

And then do git fetch --no-tags on what I need. There's probably
some easy way to do that temporarily too :)

But now doing git fetch --no-tags rcu here with produces this
for me:
...
 ! [rejected]        rcu/dev    -> rcu/rcu/dev  (non-fast-forward)
 ! [rejected]        rcu/next   -> rcu/rcu/next  (non-fast-forward)

So maybe that branch got trashed and the commit is there no more.

Paul, do you have 13e698e68f75 still somewhere or want me to push
out a branch with that?

Regards,

Tony

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

* Re: Power driver patches to avoid lockdep complaints
  2016-08-23  0:45         ` Tony Lindgren
@ 2016-08-23  0:59           ` Paul E. McKenney
  2016-08-23  1:52             ` Rafael J. Wysocki
  0 siblings, 1 reply; 14+ messages in thread
From: Paul E. McKenney @ 2016-08-23  0:59 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Rafael J. Wysocki, pavel, linux, rostedt, linux-pm

On Mon, Aug 22, 2016 at 05:45:49PM -0700, Tony Lindgren wrote:
> * Rafael J. Wysocki <rjw@rjwysocki.net> [160822 10:30]:
> > On Saturday, August 20, 2016 07:28:37 AM Tony Lindgren wrote:
> > > * Rafael J. Wysocki <rjw@rjwysocki.net> [160819 18:35]:
> > > > On Thursday, August 18, 2016 03:51:52 PM Tony Lindgren wrote:
> > > > > Hi,
> > > > > 
> > > > > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> [160615 14:16]:
> > > > > > Hello!
> > > > > > 
> > > > > > Ingo was not comfortable taking these through -tip, which is understandable,
> > > > > > given that they don't depend on each other or on anything else not already
> > > > > > in mainline, and that they don't have anything to do with -tip.
> > > > > > 
> > > > > > So what would you guys like to do with these?
> > > > > > 
> > > > > > They may be pulled from 13e698e68f75 (power: Use _rcuidle for
> > > > > > suspend/resume tracepoints) in my -rcu tree:
> > > > > > 
> > > > > > 	git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > > > > 
> > > > > 
> > > > > Rafael, looks like commit 13e698e68f75 is still missing from the
> > > > > mainline tree. Care to merge it to your fixes so I don't have to
> > > > > keep looking at that splat on daily basis?
> > > > 
> > > > I could pull it if I knew where to pull it from.  The above gives me
> > > > "Already up-to-date."
> > > 
> > > Here are the ones still missing:
> > > 
> > > $ git log --pretty=oneline v4.7-rc2..13e698e68f75
> > > 13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
> > > 320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
> > > b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle
> > > 
> > > So maybe just git merge 13e698e68f75 if you have the linux-rcu.git
> > > fetched and the above look OK to you?
> > 
> > If I do
> > 
> > $ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > 
> > and then
> > 
> > $ git show 13e698e68f75
> > 
> > then it tells me
> > 
> > fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.
> > 
> > Do I need to fetch it in any special way or something?
> 
> Well I usuall add things to my .git/config like:
> 
> [remote "rcu"]
> 	url = git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> 	fetch = refs/heads/*:refs/remotes/rcu/*
> 
> And then do git fetch --no-tags on what I need. There's probably
> some easy way to do that temporarily too :)
> 
> But now doing git fetch --no-tags rcu here with produces this
> for me:
> ...
>  ! [rejected]        rcu/dev    -> rcu/rcu/dev  (non-fast-forward)
>  ! [rejected]        rcu/next   -> rcu/rcu/next  (non-fast-forward)
> 
> So maybe that branch got trashed and the commit is there no more.

The trick is that rcu/dev and rcu/next simply mark my current development
branch and the stuff I want Stephen Rothwell to pull into -next,
respectively.

> Paul, do you have 13e698e68f75 still somewhere or want me to push
> out a branch with that?

The permanent branch name for those changes is power.2016.06.15a,
so those should be pullable from anywhere.

Or please do feel free to push from your tree if that works better.
However they get where they need to go, I am good!  ;-)

							Thanx, Paul


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

* Re: Power driver patches to avoid lockdep complaints
  2016-08-23  0:59           ` Paul E. McKenney
@ 2016-08-23  1:52             ` Rafael J. Wysocki
  2016-08-23 10:16               ` Paul E. McKenney
  0 siblings, 1 reply; 14+ messages in thread
From: Rafael J. Wysocki @ 2016-08-23  1:52 UTC (permalink / raw)
  To: paulmck; +Cc: Tony Lindgren, pavel, linux, rostedt, linux-pm

On Monday, August 22, 2016 05:59:17 PM Paul E. McKenney wrote:
> On Mon, Aug 22, 2016 at 05:45:49PM -0700, Tony Lindgren wrote:
> > * Rafael J. Wysocki <rjw@rjwysocki.net> [160822 10:30]:
> > > On Saturday, August 20, 2016 07:28:37 AM Tony Lindgren wrote:
> > > > * Rafael J. Wysocki <rjw@rjwysocki.net> [160819 18:35]:
> > > > > On Thursday, August 18, 2016 03:51:52 PM Tony Lindgren wrote:
> > > > > > Hi,
> > > > > > 
> > > > > > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> [160615 14:16]:
> > > > > > > Hello!
> > > > > > > 
> > > > > > > Ingo was not comfortable taking these through -tip, which is understandable,
> > > > > > > given that they don't depend on each other or on anything else not already
> > > > > > > in mainline, and that they don't have anything to do with -tip.
> > > > > > > 
> > > > > > > So what would you guys like to do with these?
> > > > > > > 
> > > > > > > They may be pulled from 13e698e68f75 (power: Use _rcuidle for
> > > > > > > suspend/resume tracepoints) in my -rcu tree:
> > > > > > > 
> > > > > > > 	git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > > > > > 
> > > > > > 
> > > > > > Rafael, looks like commit 13e698e68f75 is still missing from the
> > > > > > mainline tree. Care to merge it to your fixes so I don't have to
> > > > > > keep looking at that splat on daily basis?
> > > > > 
> > > > > I could pull it if I knew where to pull it from.  The above gives me
> > > > > "Already up-to-date."
> > > > 
> > > > Here are the ones still missing:
> > > > 
> > > > $ git log --pretty=oneline v4.7-rc2..13e698e68f75
> > > > 13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
> > > > 320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
> > > > b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle
> > > > 
> > > > So maybe just git merge 13e698e68f75 if you have the linux-rcu.git
> > > > fetched and the above look OK to you?
> > > 
> > > If I do
> > > 
> > > $ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > 
> > > and then
> > > 
> > > $ git show 13e698e68f75
> > > 
> > > then it tells me
> > > 
> > > fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.
> > > 
> > > Do I need to fetch it in any special way or something?
> > 
> > Well I usuall add things to my .git/config like:
> > 
> > [remote "rcu"]
> > 	url = git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > 	fetch = refs/heads/*:refs/remotes/rcu/*
> > 
> > And then do git fetch --no-tags on what I need. There's probably
> > some easy way to do that temporarily too :)
> > 
> > But now doing git fetch --no-tags rcu here with produces this
> > for me:
> > ...
> >  ! [rejected]        rcu/dev    -> rcu/rcu/dev  (non-fast-forward)
> >  ! [rejected]        rcu/next   -> rcu/rcu/next  (non-fast-forward)
> > 
> > So maybe that branch got trashed and the commit is there no more.
> 
> The trick is that rcu/dev and rcu/next simply mark my current development
> branch and the stuff I want Stephen Rothwell to pull into -next,
> respectively.
> 
> > Paul, do you have 13e698e68f75 still somewhere or want me to push
> > out a branch with that?
> 
> The permanent branch name for those changes is power.2016.06.15a,
> so those should be pullable from anywhere.
> 
> Or please do feel free to push from your tree if that works better.
> However they get where they need to go, I am good!  ;-)

I guess I'll just apply the patches you've sent directly then.

Thanks,
Rafael


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

* Re: Power driver patches to avoid lockdep complaints
  2016-08-23  1:52             ` Rafael J. Wysocki
@ 2016-08-23 10:16               ` Paul E. McKenney
  2016-09-15 19:41                 ` Tony Lindgren
  0 siblings, 1 reply; 14+ messages in thread
From: Paul E. McKenney @ 2016-08-23 10:16 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Tony Lindgren, pavel, linux, rostedt, linux-pm

On Tue, Aug 23, 2016 at 03:52:12AM +0200, Rafael J. Wysocki wrote:
> On Monday, August 22, 2016 05:59:17 PM Paul E. McKenney wrote:
> > On Mon, Aug 22, 2016 at 05:45:49PM -0700, Tony Lindgren wrote:
> > > * Rafael J. Wysocki <rjw@rjwysocki.net> [160822 10:30]:
> > > > On Saturday, August 20, 2016 07:28:37 AM Tony Lindgren wrote:
> > > > > * Rafael J. Wysocki <rjw@rjwysocki.net> [160819 18:35]:
> > > > > > On Thursday, August 18, 2016 03:51:52 PM Tony Lindgren wrote:
> > > > > > > Hi,
> > > > > > > 
> > > > > > > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> [160615 14:16]:
> > > > > > > > Hello!
> > > > > > > > 
> > > > > > > > Ingo was not comfortable taking these through -tip, which is understandable,
> > > > > > > > given that they don't depend on each other or on anything else not already
> > > > > > > > in mainline, and that they don't have anything to do with -tip.
> > > > > > > > 
> > > > > > > > So what would you guys like to do with these?
> > > > > > > > 
> > > > > > > > They may be pulled from 13e698e68f75 (power: Use _rcuidle for
> > > > > > > > suspend/resume tracepoints) in my -rcu tree:
> > > > > > > > 
> > > > > > > > 	git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > > > > > > 
> > > > > > > 
> > > > > > > Rafael, looks like commit 13e698e68f75 is still missing from the
> > > > > > > mainline tree. Care to merge it to your fixes so I don't have to
> > > > > > > keep looking at that splat on daily basis?
> > > > > > 
> > > > > > I could pull it if I knew where to pull it from.  The above gives me
> > > > > > "Already up-to-date."
> > > > > 
> > > > > Here are the ones still missing:
> > > > > 
> > > > > $ git log --pretty=oneline v4.7-rc2..13e698e68f75
> > > > > 13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
> > > > > 320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
> > > > > b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle
> > > > > 
> > > > > So maybe just git merge 13e698e68f75 if you have the linux-rcu.git
> > > > > fetched and the above look OK to you?
> > > > 
> > > > If I do
> > > > 
> > > > $ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > > 
> > > > and then
> > > > 
> > > > $ git show 13e698e68f75
> > > > 
> > > > then it tells me
> > > > 
> > > > fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.
> > > > 
> > > > Do I need to fetch it in any special way or something?
> > > 
> > > Well I usuall add things to my .git/config like:
> > > 
> > > [remote "rcu"]
> > > 	url = git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > 	fetch = refs/heads/*:refs/remotes/rcu/*
> > > 
> > > And then do git fetch --no-tags on what I need. There's probably
> > > some easy way to do that temporarily too :)
> > > 
> > > But now doing git fetch --no-tags rcu here with produces this
> > > for me:
> > > ...
> > >  ! [rejected]        rcu/dev    -> rcu/rcu/dev  (non-fast-forward)
> > >  ! [rejected]        rcu/next   -> rcu/rcu/next  (non-fast-forward)
> > > 
> > > So maybe that branch got trashed and the commit is there no more.
> > 
> > The trick is that rcu/dev and rcu/next simply mark my current development
> > branch and the stuff I want Stephen Rothwell to pull into -next,
> > respectively.
> > 
> > > Paul, do you have 13e698e68f75 still somewhere or want me to push
> > > out a branch with that?
> > 
> > The permanent branch name for those changes is power.2016.06.15a,
> > so those should be pullable from anywhere.
> > 
> > Or please do feel free to push from your tree if that works better.
> > However they get where they need to go, I am good!  ;-)
> 
> I guess I'll just apply the patches you've sent directly then.

Works for me!

							Thanx, Paul


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

* Re: Power driver patches to avoid lockdep complaints
  2016-08-23 10:16               ` Paul E. McKenney
@ 2016-09-15 19:41                 ` Tony Lindgren
  2016-09-15 19:52                   ` Tony Lindgren
  0 siblings, 1 reply; 14+ messages in thread
From: Tony Lindgren @ 2016-09-15 19:41 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: Rafael J. Wysocki, pavel, linux, rostedt, linux-pm

Hi,

* Paul E. McKenney <paulmck@linux.vnet.ibm.com> [160823 03:16]:
> On Tue, Aug 23, 2016 at 03:52:12AM +0200, Rafael J. Wysocki wrote:
> > On Monday, August 22, 2016 05:59:17 PM Paul E. McKenney wrote:
> > > On Mon, Aug 22, 2016 at 05:45:49PM -0700, Tony Lindgren wrote:
> > > > * Rafael J. Wysocki <rjw@rjwysocki.net> [160822 10:30]:
> > > > > On Saturday, August 20, 2016 07:28:37 AM Tony Lindgren wrote:
> > > > > > * Rafael J. Wysocki <rjw@rjwysocki.net> [160819 18:35]:
> > > > > > > On Thursday, August 18, 2016 03:51:52 PM Tony Lindgren wrote:
> > > > > > > > Hi,
> > > > > > > > 
> > > > > > > > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> [160615 14:16]:
> > > > > > > > > Hello!
> > > > > > > > > 
> > > > > > > > > Ingo was not comfortable taking these through -tip, which is understandable,
> > > > > > > > > given that they don't depend on each other or on anything else not already
> > > > > > > > > in mainline, and that they don't have anything to do with -tip.
> > > > > > > > > 
> > > > > > > > > So what would you guys like to do with these?
> > > > > > > > > 
> > > > > > > > > They may be pulled from 13e698e68f75 (power: Use _rcuidle for
> > > > > > > > > suspend/resume tracepoints) in my -rcu tree:
> > > > > > > > > 
> > > > > > > > > 	git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > > > > > > > 
> > > > > > > > 
> > > > > > > > Rafael, looks like commit 13e698e68f75 is still missing from the
> > > > > > > > mainline tree. Care to merge it to your fixes so I don't have to
> > > > > > > > keep looking at that splat on daily basis?
> > > > > > > 
> > > > > > > I could pull it if I knew where to pull it from.  The above gives me
> > > > > > > "Already up-to-date."
> > > > > > 
> > > > > > Here are the ones still missing:
> > > > > > 
> > > > > > $ git log --pretty=oneline v4.7-rc2..13e698e68f75
> > > > > > 13e698e68f75708c45241a2dad23cd6b65181056 power: Use _rcuidle for suspend/resume tracepoints
> > > > > > 320e2a2d081b6c519f80fca9377b8fb90db7bb9c power: Add _rcuidle suffix to allow rpm_resume() to be called from idle
> > > > > > b72aadb1d082d3935cbffd60e979238252045971 power: Add _rcuidle suffix to allow rpm_idle() use from idle
> > > > > > 
> > > > > > So maybe just git merge 13e698e68f75 if you have the linux-rcu.git
> > > > > > fetched and the above look OK to you?
> > > > > 
> > > > > If I do
> > > > > 
> > > > > $ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > > > 
> > > > > and then
> > > > > 
> > > > > $ git show 13e698e68f75
> > > > > 
> > > > > then it tells me
> > > > > 
> > > > > fatal: ambiguous argument '13e698e68f75': unknown revision or path not in the working tree.
> > > > > 
> > > > > Do I need to fetch it in any special way or something?
> > > > 
> > > > Well I usuall add things to my .git/config like:
> > > > 
> > > > [remote "rcu"]
> > > > 	url = git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > > 	fetch = refs/heads/*:refs/remotes/rcu/*
> > > > 
> > > > And then do git fetch --no-tags on what I need. There's probably
> > > > some easy way to do that temporarily too :)
> > > > 
> > > > But now doing git fetch --no-tags rcu here with produces this
> > > > for me:
> > > > ...
> > > >  ! [rejected]        rcu/dev    -> rcu/rcu/dev  (non-fast-forward)
> > > >  ! [rejected]        rcu/next   -> rcu/rcu/next  (non-fast-forward)
> > > > 
> > > > So maybe that branch got trashed and the commit is there no more.
> > > 
> > > The trick is that rcu/dev and rcu/next simply mark my current development
> > > branch and the stuff I want Stephen Rothwell to pull into -next,
> > > respectively.
> > > 
> > > > Paul, do you have 13e698e68f75 still somewhere or want me to push
> > > > out a branch with that?
> > > 
> > > The permanent branch name for those changes is power.2016.06.15a,
> > > so those should be pullable from anywhere.
> > > 
> > > Or please do feel free to push from your tree if that works better.
> > > However they get where they need to go, I am good!  ;-)
> > 
> > I guess I'll just apply the patches you've sent directly then.
> 
> Works for me!

Rafael, I'm still not seeing these applied, care to check?

Regards,

Tony

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

* Re: Power driver patches to avoid lockdep complaints
  2016-09-15 19:41                 ` Tony Lindgren
@ 2016-09-15 19:52                   ` Tony Lindgren
  2016-09-15 20:41                     ` Rafael J. Wysocki
  0 siblings, 1 reply; 14+ messages in thread
From: Tony Lindgren @ 2016-09-15 19:52 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: Rafael J. Wysocki, pavel, linux, rostedt, linux-pm

* Tony Lindgren <tony@atomide.com> [160915 12:41]:
> Rafael, I'm still not seeing these applied, care to check?

Sorry looks like only one of the three fixes is missing from
current mainline:

13e698e68f75 ("power: Use _rcuidle for suspend/resume tracepoints")

So I'm still getting warning out of box with omap2plus_defconfig.

Regards,

Tony

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

* Re: Power driver patches to avoid lockdep complaints
  2016-09-15 19:52                   ` Tony Lindgren
@ 2016-09-15 20:41                     ` Rafael J. Wysocki
  2016-09-15 21:45                       ` Tony Lindgren
  0 siblings, 1 reply; 14+ messages in thread
From: Rafael J. Wysocki @ 2016-09-15 20:41 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Paul E. McKenney, Rafael J. Wysocki, Pavel Machek, Guenter Roeck,
	Steven Rostedt, Linux PM

On Thu, Sep 15, 2016 at 9:52 PM, Tony Lindgren <tony@atomide.com> wrote:
> * Tony Lindgren <tony@atomide.com> [160915 12:41]:
>> Rafael, I'm still not seeing these applied, care to check?
>
> Sorry looks like only one of the three fixes is missing from
> current mainline:
>
> 13e698e68f75 ("power: Use _rcuidle for suspend/resume tracepoints")
>
> So I'm still getting warning out of box with omap2plus_defconfig.

It's not been applied, because I was unaware of it.

Care to send it to me as a patch?

Thanks,
Rafael

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

* Re: Power driver patches to avoid lockdep complaints
  2016-09-15 20:41                     ` Rafael J. Wysocki
@ 2016-09-15 21:45                       ` Tony Lindgren
  0 siblings, 0 replies; 14+ messages in thread
From: Tony Lindgren @ 2016-09-15 21:45 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Paul E. McKenney, Rafael J. Wysocki, Pavel Machek, Guenter Roeck,
	Steven Rostedt, Linux PM

* Rafael J. Wysocki <rafael@kernel.org> [160915 13:41]:
> On Thu, Sep 15, 2016 at 9:52 PM, Tony Lindgren <tony@atomide.com> wrote:
> > * Tony Lindgren <tony@atomide.com> [160915 12:41]:
> >> Rafael, I'm still not seeing these applied, care to check?
> >
> > Sorry looks like only one of the three fixes is missing from
> > current mainline:
> >
> > 13e698e68f75 ("power: Use _rcuidle for suspend/resume tracepoints")
> >
> > So I'm still getting warning out of box with omap2plus_defconfig.
> 
> It's not been applied, because I was unaware of it.

OK well good thing I bugged you then :)

> Care to send it to me as a patch?

Below produced with git show --pretty=email 13e698e68f75.

Regards,

Tony

8< ------------------------
>From 13e698e68f75708c45241a2dad23cd6b65181056 Mon Sep 17 00:00:00 2001
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date: Tue, 26 Apr 2016 10:42:25 -0700
Subject: [PATCH] power: Use _rcuidle for suspend/resume tracepoints

Further testing with false negatives suppressed by commit 293e2421fe25
("rcu: Remove superfluous versions of rcu_read_lock_sched_held()")
identified a few more unprotected uses of RCU from the idle loop.
Because RCU actively ignores idle-loop code (for energy-efficiency
reasons, among other things), using RCU from the idle loop can result
in too-short grace periods, in turn resulting in arbitrary misbehavior.

The affected function is rpm_suspend().

The resulting lockdep-RCU splat is as follows:

------------------------------------------------------------------------

Warning from omap3
===============================
[ INFO: suspicious RCU usage. ]
4.6.0-rc5-next-20160426+ #1112 Not tainted
-------------------------------
include/trace/events/rpm.h:63 suspicious rcu_dereference_check() usage!

other info that might help us debug this:

RCU used illegally from idle CPU!
rcu_scheduler_active = 1, debug_locks = 0
RCU used illegally from extended quiescent state!
1 lock held by swapper/0/0:
 #0:  (&(&dev->power.lock)->rlock){-.-...}, at: [<c052ee24>] __pm_runtime_suspend+0x54/0x84

stack backtrace:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.6.0-rc5-next-20160426+ #1112
Hardware name: Generic OMAP36xx (Flattened Device Tree)
[<c0110308>] (unwind_backtrace) from [<c010c3a8>] (show_stack+0x10/0x14)
[<c010c3a8>] (show_stack) from [<c047fec8>] (dump_stack+0xb0/0xe4)
[<c047fec8>] (dump_stack) from [<c052d7b4>] (rpm_suspend+0x604/0x7e4)
[<c052d7b4>] (rpm_suspend) from [<c052ee34>] (__pm_runtime_suspend+0x64/0x84)
[<c052ee34>] (__pm_runtime_suspend) from [<c04bf3bc>] (omap2_gpio_prepare_for_idle+0x5c/0x70)
[<c04bf3bc>] (omap2_gpio_prepare_for_idle) from [<c01255e8>] (omap_sram_idle+0x140/0x244)
[<c01255e8>] (omap_sram_idle) from [<c0126b48>] (omap3_enter_idle_bm+0xfc/0x1ec)
[<c0126b48>] (omap3_enter_idle_bm) from [<c0601db8>] (cpuidle_enter_state+0x80/0x3d4)
[<c0601db8>] (cpuidle_enter_state) from [<c0183c74>] (cpu_startup_entry+0x198/0x3a0)
[<c0183c74>] (cpu_startup_entry) from [<c0b00c0c>] (start_kernel+0x354/0x3c8)
[<c0b00c0c>] (start_kernel) from [<8000807c>] (0x8000807c)

------------------------------------------------------------------------

Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: <linux-omap@vger.kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>
Cc: <linux-pm@vger.kernel.org>

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index fd553d0..15b6d5b 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -419,7 +419,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
 	struct device *parent = NULL;
 	int retval;
 
-	trace_rpm_suspend(dev, rpmflags);
+	trace_rpm_suspend_rcuidle(dev, rpmflags);
 
  repeat:
 	retval = rpm_check_suspend_allowed(dev);
@@ -549,7 +549,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
 	}
 
  out:
-	trace_rpm_return_int(dev, _THIS_IP_, retval);
+	trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval);
 
 	return retval;
 

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

end of thread, other threads:[~2016-09-15 21:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-15 21:13 Power driver patches to avoid lockdep complaints Paul E. McKenney
2016-08-18 22:51 ` Tony Lindgren
2016-08-20  1:40   ` Rafael J. Wysocki
2016-08-20 14:28     ` Tony Lindgren
2016-08-22 17:34       ` Rafael J. Wysocki
2016-08-22 17:43         ` Paul E. McKenney
2016-08-23  0:45         ` Tony Lindgren
2016-08-23  0:59           ` Paul E. McKenney
2016-08-23  1:52             ` Rafael J. Wysocki
2016-08-23 10:16               ` Paul E. McKenney
2016-09-15 19:41                 ` Tony Lindgren
2016-09-15 19:52                   ` Tony Lindgren
2016-09-15 20:41                     ` Rafael J. Wysocki
2016-09-15 21:45                       ` Tony Lindgren

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).