PM/Trace: get rid of synchronous resume limit during PM trace
Subsystems (4)
PATCH 1/1 PM/Trace: get rid of synchronous resume limit during PM trace
Quoted 1 line
From
f9c841d1f943d81b5ab0aac7483e794a7f966296Mon Sep 17 00:00:00 2001
From: Zhonghui Fu <[email protected]>
Date: Mon, 26 Jan 2015 11:27:08 +0800
Subject: [PATCH] PM/Trace: get rid of synchronous resume limit during PM trace
There are some kind of dependency between devices in some hardware platforms. So, asynchronous resuming devices may hang system due to wrong resume order. As a result, should not fore synchronously resuming devices during tracing PM events.
--- drivers/base/power/main.c | 3 +-- include/linux/resume-trace.h | 7 ------- 2 files changed, 1 insertions(+), 9 deletions(-)
drivers/base/power/main.c +1 -2
@@ -517,8 +517,7 @@ static int device_resume_noirq(struct device *dev, pm_message_t state, bool asynstatic bool is_async (struct device *dev) { -return dev->power.async_suspend && pm_async_enabled - && !pm_trace_is_enabled (); +return dev->power.async_suspend && pm_async_enabled; }static void async_resume_noirq (void *data,async_cookie_t cookie)
include/linux/resume-trace.h +0 -7
@@ -7,11 +7,6 @@extern int pm_trace_enabled; -static inline int pm_trace_is_enabled (void ) -{ -return pm_trace_enabled; -} -struct device ;extern void set_trace_device (struct device *);extern void generate_resume_trace (const void *tracedata,unsigned int user);
@@ -24,8 +19,6 @@ extern int show_trace_dev_match(char *buf, size_t size);#else -static inline int pm_trace_is_enabled (void ) {return 0 ; } -#define TRACE_DEVICE (dev) do { } while (0)#define TRACE_RESUME (dev) do { } while (0)
-- 1.7.1
This is a incorrect patch , please ignore it.
Thanks,
Zhonghui
Quoted 58 lines · Zhonghui
From
f9c841d1f943d81b5ab0aac7483e794a7f966296Mon Sep 17 00:00:00 2001
From: Zhonghui Fu <[email protected]>
Date: Mon, 26 Jan 2015 11:27:08 +0800
Subject: [PATCH] PM/Trace: get rid of synchronous resume limit during PM traceThere are some kind of dependency between devices in some hardware platforms. So, asynchronous resuming devices may hang system due to wrong resume order. As a result, should not fore synchronously resuming devices during tracing PM events.
Signed-off-by Zhonghui Fu <[email protected]>--- drivers/base/power/main.c | 3 +-- include/linux/resume-trace.h | 7 ------- 2 files changed, 1 insertions(+), 9 deletions(-)drivers/base/power/main.c +1
-2@@ -517,8 +517,7 @@ static int device_resume_noirq(struct device *dev, pm_message_t state, bool asynstatic bool is_async (struct device *dev) { -return dev->power.async_suspend && pm_async_enabled - && !pm_trace_is_enabled (); +return dev->power.async_suspend && pm_async_enabled; }static void async_resume_noirq (void *data,async_cookie_t cookie)include/linux/resume-trace.h +0
-8@@ -7,11 +7,6 @@extern int pm_trace_enabled; -static inline int pm_trace_is_enabled (void ) -{ -return pm_trace_enabled; -} -struct device ;extern void set_trace_device (struct device *);extern void generate_resume_trace (const void *tracedata,unsigned int user);@@ -24,8 +19,6 @@ extern int show_trace_dev_match(char *buf, size_t size);#else -static inline int pm_trace_is_enabled (void ) {return 0 ; } -#define TRACE_DEVICE (dev) do { } while (0)#define TRACE_RESUME (dev) do { } while (0) -- 1.7.1
Quoted 2 lines · Zhonghui
This is a incorrect patch , please ignore it.
Of course it is incorrect.
If it "fixes" anything for you, this means you need to reorder devices in dpm_list on the given system.
Quoted 60 lines · Zhonghui
Quoted 58 lines
From
f9c841d1f943d81b5ab0aac7483e794a7f966296Mon Sep 17 00:00:00 2001
From: Zhonghui Fu <[email protected]>
Date: Mon, 26 Jan 2015 11:27:08 +0800
Subject: [PATCH] PM/Trace: get rid of synchronous resume limit during PM traceThere are some kind of dependency between devices in some hardware platforms. So, asynchronous resuming devices may hang system due to wrong resume order. As a result, should not fore synchronously resuming devices during tracing PM events.
Signed-off-by Zhonghui Fu <[email protected]>--- drivers/base/power/main.c | 3 +-- include/linux/resume-trace.h | 7 ------- 2 files changed, 1 insertions(+), 9 deletions(-)drivers/base/power/main.c +1
-2@@ -517,8 +517,7 @@ static int device_resume_noirq(struct device *dev, pm_message_t state, bool asynstatic bool is_async (struct device *dev) { -return dev->power.async_suspend && pm_async_enabled - && !pm_trace_is_enabled (); +return dev->power.async_suspend && pm_async_enabled; }static void async_resume_noirq (void *data,async_cookie_t cookie)include/linux/resume-trace.h +0
-8@@ -7,11 +7,6 @@extern int pm_trace_enabled; -static inline int pm_trace_is_enabled (void ) -{ -return pm_trace_enabled; -} -struct device ;extern void set_trace_device (struct device *);extern void generate_resume_trace (const void *tracedata,unsigned int user);@@ -24,8 +19,6 @@ extern int show_trace_dev_match(char *buf, size_t size);#else -static inline int pm_trace_is_enabled (void ) {return 0 ; } -#define TRACE_DEVICE (dev) do { } while (0)#define TRACE_RESUME (dev) do { } while (0) -- 1.7.1
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
Change behaviour when tracing ... nasty trap (was Re: [PATCH] PM/Trace: get rid of synchronous resume limit during PM trace)
In reply to Fu, ZhonghuiQuoted 22 lines · Zhonghui
Quoted 1 line
From
f9c841d1f943d81b5ab0aac7483e794a7f966296Mon Sep 17 00:00:00 2001From: Zhonghui Fu <[email protected]>
Date: Mon, 26 Jan 2015 11:27:08 +0800
Subject: [PATCH] PM/Trace: get rid of synchronous resume limit during PM traceThere are some kind of dependency between devices in some hardware platforms. So, asynchronous resuming devices may hang system due to wrong resume order. As a result, should not fore synchronously resuming devices during tracing PM events.
Signed-off-by Zhonghui Fu <[email protected]>--- drivers/base/power/main.c | 3 +-- include/linux/resume-trace.h | 7 ------- 2 files changed, 1 insertions(+), 9 deletions(-)drivers/base/power/main.c +0
-0
drivers/base/power/main.c static int device_resume_noirq(struct device *dev, pm_message_t state, bool asyn · line 522
Quoted 8 lines
drivers/base/power/main.c +1
-2@@ -517,8 +517,7 @@ static int device_resume_noirq(struct device *dev, pm_message_t state, bool asynstatic bool is_async (struct device *dev) { -return dev->power.async_suspend && pm_async_enabled - && !pm_trace_is_enabled (); +return dev->power.async_suspend && pm_async_enabled; }
Actually... whoever did the original patch was evil person. Changing behaviour when tracing is requested is evil, evil, evil. Git blame tells me
went to the dark side.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
RE: Change behaviour when tracing ... nasty trap (was Re: [PATCH] PM/Trace: get rid of synchronous resume limit during PM trace)
Hello Pavel,
Quoted 48 lines
-----Original Message-----
From: Pavel Machek [mailto:[email protected]]
Sent: Monday, January 26, 2015 6:24 PM
To: Fu, Zhonghui
Cc: Rafael J. Wysocki; Brown, Len; Greg Kroah-Hartman; [email protected]; [email protected]; Liu, Chuansheng
Subject: Change behaviour when tracing ... nasty trap (was Re: [PATCH] PM/Trace: get rid of synchronous resume limit during PM trace)Quoted 1 line · Zhonghui
Quoted 1 line
From
f9c841d1f943d81b5ab0aac7483e794a7f966296Mon Sep 17 00:00:002001
Quoted 3 lines
From: Zhonghui Fu <[email protected]>
Date: Mon, 26 Jan 2015 11:27:08 +0800
Subject: [PATCH] PM/Trace: get rid of synchronous resume limit during PMtrace
drivers/base/power/main.c static int device_resume_noirq(struct device *dev,
Quoted 18 lines
There are some kind of dependency between devices in some hardware platforms. So, asynchronous resuming devices may hang system due to wrong resume order. As a result, should not fore synchronously resuming devices during tracing PM events.
Signed-off-by Zhonghui Fu <[email protected]>--- drivers/base/power/main.c | 3 +-- include/linux/resume-trace.h | 7 ------- 2 files changed, 1 insertions(+), 9 deletions(-)drivers/base/power/main.c +0
-0@@ -517,8 +517,7 @@ static int device_resume_noirq(struct device *dev,
pm_message_tstate, bool asyndrivers/base/power/main.c static int device_resume_noirq(struct device *dev, pm_message_t state, bool asyn · line 522
Quoted 8 lines
drivers/base/power/main.c +1
-2static bool is_async (struct device *dev) { -return dev->power.async_suspend && pm_async_enabled - && !pm_trace_is_enabled (); +return dev->power.async_suspend && pm_async_enabled; }Actually... whoever did the original patch was evil person. Changing behaviour when tracing is requested is evil, evil, evil. Git blame tells me
Quoted 3 lines
Signed-off-by Chuansheng Liu <[email protected]>went to the dark side.
Although I didn't get where is something wrong, but the is_async() is not created by my commit, it is from commit (PM: Start asynchronous resume threads upfront), I just moved it ahead.
And like other phases, I added it into resum/suspend_noirq()...
Re: Change behaviour when tracing ... nasty trap (was Re: [PATCH] PM/Trace: get rid of synchronous resume limit during PM trace)
Quoted 33 lines · Chuansheng
Hello Pavel,
Quoted 31 lines
drivers/base/power/main.c static int device_resume_noirq(struct device *dev,
Quoted 17 lines
There are some kind of dependency between devices in some hardware platforms. So, asynchronous resuming devices may hang system due to wrong resume order. As a result, should not fore synchronously resuming devices during tracing PM events.
Signed-off-by Zhonghui Fu <[email protected]>--- drivers/base/power/main.c | 3 +-- include/linux/resume-trace.h | 7 ------- 2 files changed, 1 insertions(+), 9 deletions(-)drivers/base/power/main.c +0
-0@@ -517,8 +517,7 @@ static int device_resume_noirq(struct device *dev,
pm_message_tstate, bool asyndrivers/base/power/main.c static int device_resume_noirq(struct device *dev, pm_message_t state, bool asyn · line 522
Quoted 8 lines
drivers/base/power/main.c +1
-2static bool is_async (struct device *dev) { -return dev->power.async_suspend && pm_async_enabled - && !pm_trace_is_enabled (); +return dev->power.async_suspend && pm_async_enabled; }Actually... whoever did the original patch was evil person. Changing behaviour when tracing is requested is evil, evil, evil. Git blame tells me
Quoted 8 lines
Quoted 3 lines
Signed-off-by Chuansheng Liu <[email protected]>went to the dark side.
Although I didn't get where is something wrong, but the
is_async()is not created by my commit, it is from commit (PM: Start asynchronous resume threads upfront), I just moved it ahead.And like other phases, I added it into resum/suspend_noirq()...
I see, blame blamed wrong person. It looks like Rafael is evil:
commit 97df8c12995c5bac73e3bfeea4c5be155c1f4401
Author: Rafael J. Wysocki <[email protected]> Date: Sat Jan 23 22:25:31 2010 +0100
PM: Start asynchronous resume threads upfront
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: Change behaviour when tracing ... nasty trap (was Re: [PATCH] PM/Trace: get rid of synchronous resume limit during PM trace)
Quoted 43 lines · Pavel Machek
Quoted 33 lines · Chuansheng
Hello Pavel,
Quoted 31 lines
drivers/base/power/main.c static int device_resume_noirq(struct device *dev,
Quoted 17 lines
There are some kind of dependency between devices in some hardware platforms. So, asynchronous resuming devices may hang system due to wrong resume order. As a result, should not fore synchronously resuming devices during tracing PM events.
Signed-off-by Zhonghui Fu <[email protected]>--- drivers/base/power/main.c | 3 +-- include/linux/resume-trace.h | 7 ------- 2 files changed, 1 insertions(+), 9 deletions(-)drivers/base/power/main.c +0
-0@@ -517,8 +517,7 @@ static int device_resume_noirq(struct device *dev,
pm_message_tstate, bool asyndrivers/base/power/main.c static int device_resume_noirq(struct device *dev, pm_message_t state, bool asyn · line 522
Quoted 8 lines
drivers/base/power/main.c +1
-2static bool is_async (struct device *dev) { -return dev->power.async_suspend && pm_async_enabled - && !pm_trace_is_enabled (); +return dev->power.async_suspend && pm_async_enabled; }Actually... whoever did the original patch was evil person. Changing behaviour when tracing is requested is evil, evil, evil. Git blame tells me
Quoted 8 lines
Quoted 3 lines
Signed-off-by Chuansheng Liu <[email protected]>went to the dark side.
Although I didn't get where is something wrong, but the
is_async()is not created by my commit, it is from commit (PM: Start asynchronous resume threads upfront), I just moved it ahead.And like other phases, I added it into resum/suspend_noirq()...
Quoted 7 lines
I see, blame blamed wrong person. It looks like Rafael is evil:
commit
97df8c12995c5bac73e3bfeea4c5be155c1f4401Author: Rafael J. Wysocki <[email protected]> Date: Sat Jan 23 22:25:31 2010 +0100PM: Start asynchronous resume threads upfront
This only means we won't use asyc suspend/resume at all when the RTC-based resume debug is enabled, because it wouldn't make sense (the RTC-based debug requires strict ordering of callbacks between devices or we may find that device A hanged the resume while actually device B that was running in parallel with A did that).
And I shouldn't even need to explain this ... Sad.
Rafael
Re: Change behaviour when tracing ... nasty trap (was Re: [PATCH] PM/Trace: get rid of synchronous resume limit during PM trace)
Document pm_tracing actually affecting suspend in non-trivial way.
---
Quoted 35 lines · Rafael J. Wysocki
Quoted 26 lines · Pavel Machek
Quoted 15 lines · Chuansheng
Quoted 15 lines
Review static int device_resume_noirq(struct device *dev,
Quoted 1 line
(quoted diff) +0
-0@@ -517,8 +517,7 @@ static int device_resume_noirq(struct device *dev,
pm_message_tstate, bool asynReview static int device_resume_noirq(struct device *dev, · line 521
Quoted 8 lines
(quoted diff) +1
-2static bool is_async(struct device *dev) { - return dev->power.async_suspend && pm_async_enabled - && !pm_trace_is_enabled(); + return dev->power.async_suspend && pm_async_enabled; }Actually... whoever did the original patch was evil person. Changing behaviour when tracing is requested is evil, evil, evil. Git blame tells me
Quoted 8 lines
Quoted 3 lines
Signed-off-by Chuansheng Liu <[email protected]>went to the dark side.
Although I didn't get where is something wrong, but the
is_async()is not created by my commit, it is from commit (PM: Start asynchronous resume threads upfront), I just moved it ahead.And like other phases, I added it into resum/suspend_noirq()...
Quoted 7 lines
I see, blame blamed wrong person. It looks like Rafael is evil:
commit
97df8c12995c5bac73e3bfeea4c5be155c1f4401Author: Rafael J. Wysocki <[email protected]> Date: Sat Jan 23 22:25:31 2010 +0100PM: Start asynchronous resume threads upfront
Quoted 7 lines
This only means we won't use asyc suspend/resume at all when the RTC-based resume debug is enabled, because it wouldn't make sense (the RTC-based debug requires strict ordering of callbacks between devices or we may find that device A hanged the resume while actually device B that was running in parallel with A did that).
And I shouldn't even need to explain this ... Sad.
Well, I forgot that pm_trace_is_enabled() is the simple, RTC based one, and believe it would be worth a comment...
Documentation/power/s2ram.txt +4 -0
@@ -69,6 +69,10 @@ Reason for this is that the RTC is the only reliably available piece of hardware during resume operations where a value can be set that will survive a reboot. +pm_trace is not compatible with asynchronous suspend, so it turns +asynchronous suspend off (which may work around timing or +ordering-sensitive bugs). + Consequence is that after a resume (even if it is successful) your system clock will have a value corresponding to the magic number instead of the correct date/time! It is therefore advisable to use a program like ntp-date
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Rafael J. Wysocki
AppliedRe: Change behaviour when tracing ... nasty trap (was Re: [PATCH] PM/Trace: get rid of synchronous resume limit during PM trace)
Quoted 49 lines · Pavel Machek
Document
pm_tracingactually affecting suspend in non-trivial way.Signed-off-by Pavel Machek <[email protected]>---
Quoted 41 lines · Rafael J. Wysocki
Quoted 26 lines · Pavel Machek
Quoted 15 lines · Chuansheng
Quoted 15 lines
Review static int device_resume_noirq(struct device *dev,
Quoted 1 line
(quoted diff) +0
-0@@ -517,8 +517,7 @@ static int device_resume_noirq(struct device *dev,
pm_message_tstate, bool asynReview static int device_resume_noirq(struct device *dev, · line 521
Quoted 8 lines
(quoted diff) +1
-2static bool is_async(struct device *dev) { - return dev->power.async_suspend && pm_async_enabled - && !pm_trace_is_enabled(); + return dev->power.async_suspend && pm_async_enabled; }Actually... whoever did the original patch was evil person. Changing behaviour when tracing is requested is evil, evil, evil. Git blame tells me
Quoted 8 lines
Quoted 3 lines
Signed-off-by Chuansheng Liu <[email protected]>went to the dark side.
Although I didn't get where is something wrong, but the
is_async()is not created by my commit, it is from commit (PM: Start asynchronous resume threads upfront), I just moved it ahead.And like other phases, I added it into resum/suspend_noirq()...
Quoted 7 lines
I see, blame blamed wrong person. It looks like Rafael is evil:
commit
97df8c12995c5bac73e3bfeea4c5be155c1f4401Author: Rafael J. Wysocki <[email protected]> Date: Sat Jan 23 22:25:31 2010 +0100PM: Start asynchronous resume threads upfront
This only means we won't use asyc suspend/resume at all when the RTC-based resume debug is enabled, because it wouldn't make sense (the RTC-based debug requires strict ordering of callbacks between devices or we may find that device A hanged the resume while actually device B that was running in parallel with A did that).
Quoted 4 lines
Quoted 1 line
And I shouldn't even need to explain this ... Sad.
Well, I forgot that
pm_trace_is_enabled()is the simple, RTC based one, and believe it would be worth a comment...
A comment won't hurt. :-)
Applied, thanks!
Quoted 18 lines
Documentation/power/s2ram.txt +4
-0@@ -69,6 +69,10 @@ Reason for this is that the RTC is the only reliably available piece of hardware during resume operations where a value can be set that will survive a reboot. +pm_trace is not compatible with asynchronous suspend, so it turns +asynchronous suspend off (which may work around timing or +ordering-sensitive bugs). + Consequence is that after a resume (even if it is successful) your system clock will have a value corresponding to the magic number instead of the correct date/time! It is therefore advisable to use a program like ntp-date
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.