* [PATCH] power: Print wakeup_count instead of event_count in the sysfs attribute.
@ 2018-06-02 2:32 Ravi Chandra Sadineni
2018-06-02 19:02 ` Pavel Machek
2018-06-03 8:05 ` Rafael J. Wysocki
0 siblings, 2 replies; 6+ messages in thread
From: Ravi Chandra Sadineni @ 2018-06-02 2:32 UTC (permalink / raw)
To: rjw, chenhong3, ravisadineni, pavel, ravisadineni, dtor,
len.brown, gregkh
Cc: tbroch, linux-kernel, linux-pm, rajatja, bleung
Currently we show event_count instead of wakeup_count as part of per
device wakeup_count sysfs attribute. Change it to wakeup_count to make
it more meaningful.
Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org>
---
drivers/base/power/sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
index 0f651efc58a1a..d713738ce7967 100644
--- a/drivers/base/power/sysfs.c
+++ b/drivers/base/power/sysfs.c
@@ -353,7 +353,7 @@ static ssize_t wakeup_count_show(struct device *dev,
spin_lock_irq(&dev->power.lock);
if (dev->power.wakeup) {
- count = dev->power.wakeup->event_count;
+ count = dev->power.wakeup->wakeup_count;
enabled = true;
}
spin_unlock_irq(&dev->power.lock);
--
2.17.1.1185.g55be947832-goog
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] power: Print wakeup_count instead of event_count in the sysfs attribute.
2018-06-02 2:32 [PATCH] power: Print wakeup_count instead of event_count in the sysfs attribute Ravi Chandra Sadineni
@ 2018-06-02 19:02 ` Pavel Machek
2018-06-03 8:05 ` Rafael J. Wysocki
1 sibling, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2018-06-02 19:02 UTC (permalink / raw)
To: Ravi Chandra Sadineni
Cc: rjw, chenhong3, ravisadineni, dtor, len.brown, gregkh, tbroch,
linux-kernel, linux-pm, rajatja, bleung
[-- Attachment #1: Type: text/plain, Size: 481 bytes --]
On Fri 2018-06-01 19:32:15, Ravi Chandra Sadineni wrote:
> Currently we show event_count instead of wakeup_count as part of per
> device wakeup_count sysfs attribute. Change it to wakeup_count to make
> it more meaningful.
>
> Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power: Print wakeup_count instead of event_count in the sysfs attribute.
2018-06-02 2:32 [PATCH] power: Print wakeup_count instead of event_count in the sysfs attribute Ravi Chandra Sadineni
2018-06-02 19:02 ` Pavel Machek
@ 2018-06-03 8:05 ` Rafael J. Wysocki
2018-06-03 17:14 ` Ravi Chandra Sadineni
1 sibling, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2018-06-03 8:05 UTC (permalink / raw)
To: Ravi Chandra Sadineni
Cc: Rafael J. Wysocki, chenhong3, Pavel Machek, ravisadineni,
Dmitry Torokhov, Len Brown, Greg Kroah-Hartman, tbroch,
Linux Kernel Mailing List, Linux PM, Rajat Jain, bleung
On Sat, Jun 2, 2018 at 4:32 AM, Ravi Chandra Sadineni
<ravisadineni@chromium.org> wrote:
> Currently we show event_count instead of wakeup_count as part of per
> device wakeup_count sysfs attribute. Change it to wakeup_count to make
> it more meaningful.
More information, please.
In particular, why it is more meaningful.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power: Print wakeup_count instead of event_count in the sysfs attribute.
2018-06-03 8:05 ` Rafael J. Wysocki
@ 2018-06-03 17:14 ` Ravi Chandra Sadineni
2018-06-07 16:47 ` Ravi Chandra Sadineni
0 siblings, 1 reply; 6+ messages in thread
From: Ravi Chandra Sadineni @ 2018-06-03 17:14 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Ravi Chandra Sadineni, Rafael J. Wysocki, chenhong3,
Pavel Machek, Dmitry Torokhov, Len Brown, Greg Kroah-Hartman,
Todd Broch, Linux Kernel Mailing List, Linux PM, Rajat Jain,
Benson Leung
Hi Rafael,
On Sun, Jun 3, 2018 at 1:05 AM, Rafael J. Wysocki <rafael@kernel.org> wrote:
> On Sat, Jun 2, 2018 at 4:32 AM, Ravi Chandra Sadineni
> <ravisadineni@chromium.org> wrote:
>> Currently we show event_count instead of wakeup_count as part of per
>> device wakeup_count sysfs attribute. Change it to wakeup_count to make
>> it more meaningful.
>
> More information, please.
>
> In particular, why it is more meaningful.
Wakeup_count increments only when events_check_enabled is set. This
bool is set whenever we write current wakeup count to
/sys/power/wakeup_count from the user land. Also events_check_enabled
is cleared on every resume. My understanding is that, userland is
expected to write to this just before suspend. This way
pm_wakeup_event() when called from irqs will increment the
wakeup_count only if we are in system wide suspend resume cycle and
should give a fair approximation of how many times a device might have
caused a wake from S3/S0iX. event_count on the other hand will
increment every time pm_wakeup_event() is called irrespective of
whether we are in a suspend/resume cycle. For example when I try
doing something like this (https://lkml.org/lkml/2018/6/1/890), we see
the wakeup_count sysfs attribute for the particular device
incrementing every time there is a irq. If it is important to expose
event_count via sysfs attribute, should we create another attribute ?
Also we do expose each of these counters via
debugfs(/sys/kernel/debug/wake_sources).
Please correct me if I am wrong or missing something. Also if there is
a better way to do this, please let me know.
>
> Thanks,
> Rafael
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power: Print wakeup_count instead of event_count in the sysfs attribute.
2018-06-03 17:14 ` Ravi Chandra Sadineni
@ 2018-06-07 16:47 ` Ravi Chandra Sadineni
2018-06-08 9:16 ` Rafael J. Wysocki
0 siblings, 1 reply; 6+ messages in thread
From: Ravi Chandra Sadineni @ 2018-06-07 16:47 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Ravi Chandra Sadineni, Rafael J. Wysocki, chenhong3,
Pavel Machek, Dmitry Torokhov, Len Brown, Greg Kroah-Hartman,
Todd Broch, Linux Kernel Mailing List, Linux PM, Rajat Jain,
Benson Leung
Hi Rafeal,
Soft ping. Is this patch good to be merged ?
Thanks,
Ravi
On Sun, Jun 3, 2018 at 10:14 AM, Ravi Chandra Sadineni
<ravisadineni@google.com> wrote:
> Hi Rafael,
>
> On Sun, Jun 3, 2018 at 1:05 AM, Rafael J. Wysocki <rafael@kernel.org> wrote:
>> On Sat, Jun 2, 2018 at 4:32 AM, Ravi Chandra Sadineni
>> <ravisadineni@chromium.org> wrote:
>>> Currently we show event_count instead of wakeup_count as part of per
>>> device wakeup_count sysfs attribute. Change it to wakeup_count to make
>>> it more meaningful.
>>
>> More information, please.
>>
>> In particular, why it is more meaningful.
> Wakeup_count increments only when events_check_enabled is set. This
> bool is set whenever we write current wakeup count to
> /sys/power/wakeup_count from the user land. Also events_check_enabled
> is cleared on every resume. My understanding is that, userland is
> expected to write to this just before suspend. This way
> pm_wakeup_event() when called from irqs will increment the
> wakeup_count only if we are in system wide suspend resume cycle and
> should give a fair approximation of how many times a device might have
> caused a wake from S3/S0iX. event_count on the other hand will
> increment every time pm_wakeup_event() is called irrespective of
> whether we are in a suspend/resume cycle. For example when I try
> doing something like this (https://lkml.org/lkml/2018/6/1/890), we see
> the wakeup_count sysfs attribute for the particular device
> incrementing every time there is a irq. If it is important to expose
> event_count via sysfs attribute, should we create another attribute ?
> Also we do expose each of these counters via
> debugfs(/sys/kernel/debug/wake_sources).
>
> Please correct me if I am wrong or missing something. Also if there is
> a better way to do this, please let me know.
>>
>> Thanks,
>> Rafael
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power: Print wakeup_count instead of event_count in the sysfs attribute.
2018-06-07 16:47 ` Ravi Chandra Sadineni
@ 2018-06-08 9:16 ` Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2018-06-08 9:16 UTC (permalink / raw)
To: Ravi Chandra Sadineni
Cc: Rafael J. Wysocki, Ravi Chandra Sadineni, chenhong3,
Pavel Machek, Dmitry Torokhov, Len Brown, Greg Kroah-Hartman,
Todd Broch, Linux Kernel Mailing List, Linux PM, Rajat Jain,
Benson Leung
On Thursday, June 7, 2018 6:47:24 PM CEST Ravi Chandra Sadineni wrote:
> Hi Rafeal,
>
> Soft ping. Is this patch good to be merged ?
Yes, it is. It's there in my linux-next branch.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-06-08 9:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-02 2:32 [PATCH] power: Print wakeup_count instead of event_count in the sysfs attribute Ravi Chandra Sadineni
2018-06-02 19:02 ` Pavel Machek
2018-06-03 8:05 ` Rafael J. Wysocki
2018-06-03 17:14 ` Ravi Chandra Sadineni
2018-06-07 16:47 ` Ravi Chandra Sadineni
2018-06-08 9:16 ` Rafael J. Wysocki
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).