[PATCH] platform/chrome: chromeos_tbmc : Report wake events.

2019-08-30 Thread Ravi Chandra Sadineni
Mark chromeos_tbmc as wake capable and report wake events. This helps to abort suspend on seeing a tablet mode switch event when kernel is suspending. This also helps identifying if chroemos_tbmc is the wake source. Signed-off-by: Ravi Chandra Sadineni --- drivers/platform/chrome

[PATCH 0/2] Add wakeup_source symlink and update documentation.

2019-07-24 Thread Ravi Chandra Sadineni
As discussed in https://lkml.org/lkml/2019/7/23/687 this patch set creates symlink from device node to wakeup_source virtual device. This patch set also updates the documentation accordingly. Ravi Chandra Sadineni (2): power: sysfs: Add link to wakeup class device. power: sysfs: move wakeup

[PATCH 1/2] power: sysfs: Add link to wakeup class device.

2019-07-24 Thread Ravi Chandra Sadineni
o the corresponding wakeup_source device under wakeup class. Signed-off-by: Ravi Chandra Sadineni --- drivers/base/power/power.h | 2 ++ drivers/base/power/sysfs.c | 25 + drivers/base/power/wakeup.c | 2 ++ 3 files changed, 29 insertions(+) diff --git a/drivers/base/

[PATCH 2/2] power: sysfs: move wakeup related nodes in power dir to obselete.

2019-07-24 Thread Ravi Chandra Sadineni
As we have a new wakeup_source sub directory under power/ that exposes all the wakeup_source related attributes, move the documentation pointing to the existing attributes directly under power/ directory to obselete. Signed-off-by: Ravi Chandra Sadineni --- Documentation/ABI/obsolete/sysfs

Re: [PATCH 0/2] power: Refactor device level sysfs.

2019-07-23 Thread Ravi Chandra Sadineni
Thanks Rafael. I will abandon this patch set and try to create a symlink as you suggested. Thanks, Ravi On Tue, Jul 23, 2019 at 10:02 AM Rafael J. Wysocki wrote: > > On Tue, Jul 23, 2019 at 6:57 PM Ravi Chandra Sadineni > wrote: > > > > Hi Greg, > > > > h

Re: [PATCH 0/2] power: Refactor device level sysfs.

2019-07-23 Thread Ravi Chandra Sadineni
ul 23, 2019 at 12:44 AM Rafael J. Wysocki wrote: > > On Tue, Jul 23, 2019 at 12:33 AM Ravi Chandra Sadineni > wrote: > > > > wakeup_abort_count and wakeup_count attributes print the > > same (wakeup_count) variable. Thus this patchset removes the > > duplicate wa

Re: [PATCH] power:sysfs: Expose device wakeup_event_count.

2019-07-23 Thread Ravi Chandra Sadineni
Hi Greg, On Mon, Jul 22, 2019 at 11:22 AM Greg KH wrote: > > On Mon, Jul 22, 2019 at 11:02:58AM -0700, Ravi Chandra Sadineni wrote: > > Device level event_count can help user level daemon to track if a > > praticular device has seen an wake interrupt during a suspend resu

[PATCH 1/2 V2] power: sysfs: Remove wakeup_abort_count attribute.

2019-07-22 Thread Ravi Chandra Sadineni
wakeup_abort_count and wakeup_count sysfs entries print the same (wakeup_count) attribute. This patch removes the duplicate wakeup_abort_count sysfs entry. Signed-off-by: Ravi Chandra Sadineni --- Documentation/ABI/testing/sysfs-devices-power | 25 ++- drivers/base/power/sysfs.c

[PATCH 0/2] power: Refactor device level sysfs.

2019-07-22 Thread Ravi Chandra Sadineni
wakeup_abort_count and wakeup_count attributes print the same (wakeup_count) variable. Thus this patchset removes the duplicate wakeup_abort_count sysfs attribute. This patchset also exposes event_count as a sysfs attribute. Ravi Chandra Sadineni (2): power: sysfs: Remove wakeup_abort_count

[PATCH 2/2 V2] power:sysfs: Expose device wakeup_event_count.

2019-07-22 Thread Ravi Chandra Sadineni
Device level event_count can help user level daemon to track if a praticular device has seen an wake interrupt during a suspend resume cycle. Thus expose it via sysfs. Signed-off-by: Ravi Chandra Sadineni --- V2: Address comments from patchset 1. Documentation/ABI/testing/sysfs-devices-power

[PATCH] power:sysfs: Expose device wakeup_event_count.

2019-07-22 Thread Ravi Chandra Sadineni
Device level event_count can help user level daemon to track if a praticular device has seen an wake interrupt during a suspend resume cycle. Thus expose it via sysfs. Signed-off-by: Ravi Chandra Sadineni --- Documentation/ABI/testing/sysfs-devices-power | 11 ++ drivers/base/power

[PATCH] power: sysfs: Remove wakeup_abort_count attribute.

2019-07-22 Thread Ravi Chandra Sadineni
wakeup_abort_count and wakeup_count sysfs entries print the same (wakeup_count) attribute. This patch removes the duplicate wakeup_abort_count sysfs entry. Signed-off-by: Ravi Chandra Sadineni --- Documentation/ABI/testing/sysfs-devices-power | 25 ++- drivers/base/power/sysfs.c

Re: [PATCH] power: Do not clear events_check_enabled in pm_wakeup_pending()

2019-06-24 Thread Ravi Chandra Sadineni
Hi, Just wanted to check if this is o.k. Thanks, Ravi On Wed, Jun 19, 2019 at 10:52 AM Ravi Chandra Sadineni wrote: > > events_check_enabled bool is set when wakeup_count sysfs attribute > is written. User level daemon is expected to write this attribute > just before suspend. &

[PATCH] power: Do not clear events_check_enabled in pm_wakeup_pending()

2019-06-19 Thread Ravi Chandra Sadineni
get to execute, wakeup count will not be incremented. Thus let us not reset the bool here. Note that events_check_enabled is also cleared in suspend.c/enter_state() on every resume at the end. Signed-off-by: Ravi Chandra Sadineni --- drivers/base/power/wakeup.c | 1 - 1 file changed, 1 deletion

Re: [PATCH] power: Do not clear events_check_enabled in pm_wakeup_pending()

2019-06-14 Thread Ravi Chandra Sadineni
Hi, Just wanted to check if this o.k. Thanks, Ravi On Thu, Jun 6, 2019 at 5:37 PM Ravi Chandra Sadineni wrote: > > events_check_enabled bool is set when wakeup_count sysfs attribute > is written. User level daemon is expected to write this attribute > just before suspend. > >

[PATCH] power: Do not clear events_check_enabled in pm_wakeup_pending()

2019-06-06 Thread Ravi Chandra Sadineni
get to execute, wakeup count will not be incremented. Thus let us not reset the bool here. Note that events_check_enabled is also cleared in suspend.c/enter_state() on every resume at the end. Signed-off-by: Ravi Chandra Sadineni --- drivers/base/power/wakeup.c | 1 - 1 file changed, 1 deletion

Re: [PATCH V1] elan_i2c: Increment wakeup count if wake source.

2019-05-15 Thread Ravi Chandra Sadineni
Hi Dmitry, On Mon, May 13, 2019 at 4:29 PM Dmitry Torokhov wrote: > > Hi Ravi, > > On Mon, May 13, 2019 at 3:06 PM Ravi Chandra Sadineni > wrote: > > > > Notify the PM core that this dev is the wake source. This helps > > userspace daemon tracking the wake sou

[PATCH V1] elan_i2c: Increment wakeup count if wake source.

2019-05-13 Thread Ravi Chandra Sadineni
Notify the PM core that this dev is the wake source. This helps userspace daemon tracking the wake source to identify the origin of the wake. Signed-off-by: Ravi Chandra Sadineni --- drivers/input/mouse/elan_i2c_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/mouse

Re: [PATCH V3] cros_ec: Expose sysfile to force battery cut-off on shutdown.

2019-03-08 Thread Ravi Chandra Sadineni
what you want. Ideally I'd like to see visible the > attribute only on those ECs that support that feature. Is this command > associated with an EC feature? Yes with EC_FEATURE_BATTERY. Now checking if EC supports EC_FEATURE_BATTERY. > > If that's not possible I can assum

Re: [PATCH V2] cros_ec: Expose sysfile to force battery cut-off on shutdown.

2019-03-05 Thread Ravi Chandra Sadineni
C exposes more attributes, it will not be that difficult to add support here. > > On Mon, Mar 4, 2019 at 5:00 PM Ravi Chandra Sadineni > wrote: >> >> Hi Guenter, >> >> On Sun, Mar 3, 2019 at 5:13 PM Guenter Roeck wrote: >> > >> > On Sun, Mar 3,

Re: [PATCH V2] cros_ec: Expose sysfile to force battery cut-off on shutdown.

2019-03-04 Thread Ravi Chandra Sadineni
> b/Documentation/ABI/testing/sysfs-class-chromeos >> new file mode 100644 >> index ..44d3cee6e7ae >> --- /dev/null >> +++ b/Documentation/ABI/testing/sysfs-class-chromeos >> @@ -0,0 +1,8 @@ >> +What: /sys/class/chromeos/cros_ec/cutoff_at

Re: [PATCH] cros_ec: Expose sysfile to force battery cut-off on shutdown.

2019-03-03 Thread Ravi Chandra Sadineni
Hi Guenter, On Fri, Mar 1, 2019 at 1:00 PM Guenter Roeck wrote: > > On Fri, Mar 1, 2019 at 11:22 AM RaviChandra Sadineni > wrote: >> >> On chromebooks, power_manager daemon normally shutsdown(S5) the device >> when the battery charge falls below 4% threshold. ChromeOS EC then >> normally spends

Re: [PATCH] Input: cros_ec_keyb: Remove check before calling pm_wakeup_event.

2018-08-07 Thread Ravi Chandra Sadineni
hi Merek, I tried booting a snow device and could not get it to boot it to the console. I assume i don't have right kernel config. Can you share your config if possible. Thanks, RaviOn Mon, Aug 6, 2018 at 4:05 PM Ravi Chandra Sadineni wrote: > > Hi Merek, > > Thanks fo

Re: [PATCH] Input: cros_ec_keyb: Remove check before calling pm_wakeup_event.

2018-08-06 Thread Ravi Chandra Sadineni
:29 PM Marek Szyprowski > > wrote: > >> Hi Ravi, > >> > >> On 2018-08-03 18:53, Ravi Chandra Sadineni wrote: > >>> Understood. I am trying to reproduce this issue locally. Wanted to > >>> know the version of the kernel so I can give a try. M

Re: [PATCH] Input: cros_ec_keyb: Remove check before calling pm_wakeup_event.

2018-08-03 Thread Ravi Chandra Sadineni
Understood. I am trying to reproduce this issue locally. Wanted to know the version of the kernel so I can give a try. Marek, can you please confirm the kernel version. Thanks, On Fri, Aug 3, 2018 at 9:08 AM Dmitry Torokhov wrote: > On Fri, Aug 3, 2018 at 8:51 AM Ravi Chandra Sadin

Re: [PATCH] Input: cros_ec_keyb: Remove check before calling pm_wakeup_event.

2018-08-03 Thread Ravi Chandra Sadineni
i Chandra Sadineni wrote: > > Remove the unnecessary check before calling pm_wakeup_event. If the > > device is not wake enabled, this call is no-op anyway. > > > > Signed-off-by: Ravi Chandra Sadineni > > This patch breaks suspend/resume on Samsung Exynos5250 Snow Ch

[PATCH V3] ACPI LID: increment wakeup count only when notified.

2018-06-27 Thread Ravi Chandra Sadineni
avior confuses user space deamons using wakeup_count to identify the potential system wakeup source. To avoid the confusion, only trigger acpi_pm_wakeup_event() in the acpi_button_notify() path and don't do that in the acpi_lid_initialize_state() path. Signed-off-by: Ravi Chandra Sadineni --- v

Re: [PATCH] ACPI LID: increment wakeup count only when notified.

2018-06-11 Thread Ravi Chandra Sadineni
Hi Rafael, Hopefully this will clear things a bit. 1. Why is this patch needed ? Consider the following scenario. 1. User left the device idle for some time. 2. A deamon in the userland that controls suspend policy might suspend the device. The lid is still open. 3. Now the use

[PATCH V2] ACPI LID: increment wakeup count only when notified.

2018-06-11 Thread Ravi Chandra Sadineni
only when there is a FIXED_HARDWARE/NOTFIY_STATUS event. Signed-off-by: Ravi Chandra Sadineni --- V2: Increment the wakeup count only when the lid is open. drivers/acpi/button.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/button.c b/drivers

Re: [PATCH] power: Print wakeup_count instead of event_count in the sysfs attribute.

2018-06-07 Thread Ravi Chandra Sadineni
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 wrote: > Hi Rafael, > > On Sun, Jun 3, 2018 at 1:05 AM, Rafael J. Wysocki wrote: >> On Sat, Jun 2, 2018 at 4:32 AM, Ravi Chandra Sadineni >> wr

[PATCH] Input: cros_ec_keyb: Remove check before calling pm_wakeup_event.

2018-06-05 Thread Ravi Chandra Sadineni
Remove the unnecessary check before calling pm_wakeup_event. If the device is not wake enabled, this call is no-op anyway. Signed-off-by: Ravi Chandra Sadineni --- drivers/input/keyboard/cros_ec_keyb.c | 30 ++- 1 file changed, 11 insertions(+), 19 deletions(-) diff

Re: [PATCH V2] i8042: Increment wakeup_count for the respective port.

2018-06-05 Thread Ravi Chandra Sadineni
On Tue, Jun 5, 2018 at 2:14 AM, Rafael J. Wysocki wrote: > On Mon, Jun 4, 2018 at 11:53 PM, Dmitry Torokhov > wrote: >> On Fri, Jun 01, 2018 at 06:07:08PM -0700, Ravi Chandra Sadineni wrote: >>> Call pm_wakeup_event on every irq. This should help us in identifying if >>

[PATCH V3] i8042: Increment wakeup_count for the respective port.

2018-06-05 Thread Ravi Chandra Sadineni
Call pm_wakeup_event on every irq. This should help us in identifying if keyboard was a potential wake reason for the last resume. Signed-off-by: Ravi Chandra Sadineni --- V3: Remove the unnecessary device_may_wakeup check. V2: Increment the wakeup count only when there is a irq and not when the

[PATCH] ACPI LID: increment wakeup count only when notified.

2018-06-04 Thread Ravi Chandra Sadineni
only when there is a FIXED_HARDWARE/NOTFIY_STATUS event. Signed-off-by: Ravi Chandra Sadineni --- drivers/acpi/button.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index f1cc4f9d31cd9..d40fef7241f08 100644 --- a/drivers

Re: [PATCH] power: Print wakeup_count instead of event_count in the sysfs attribute.

2018-06-03 Thread Ravi Chandra Sadineni
Hi Rafael, On Sun, Jun 3, 2018 at 1:05 AM, Rafael J. Wysocki wrote: > On Sat, Jun 2, 2018 at 4:32 AM, 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

[PATCH] power: Print wakeup_count instead of event_count in the sysfs attribute.

2018-06-01 Thread Ravi Chandra Sadineni
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 --- drivers/base/power/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH V2] i8042: Increment wakeup_count for the respective port.

2018-06-01 Thread Ravi Chandra Sadineni
Call pm_wakeup_event on every irq. This should help us in identifying if keyboard was a potential wake reason for the last resume. Signed-off-by: Ravi Chandra Sadineni --- V2: Increment the wakeup count only when there is a irq and not when the method is called internally. drivers/input/serio

[PATCH] i8042: Increment wakeup_count for the respective port.

2018-06-01 Thread Ravi Chandra Sadineni
Call pm_wakeup_event on every irq. This should help us in identifying if i8042 port was a potential wake reason for the last resume. Signed-off-by: Ravi Chandra Sadineni --- drivers/input/serio/i8042.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/serio/i8042.c b/drivers

[PATCH V2] cros_ec_keyb: Mark cros_ec_keyb driver as wake enabled device.

2018-05-25 Thread Ravi Chandra Sadineni
Mark cros_ec_keyb has wake enabled by default. If we see a MKBP event related to keyboard, call pm_wakeup_event() to make sure wakeup triggers are accounted to keyb during suspend resume path. Signed-off-by: Ravi Chandra Sadineni --- V2: Marked the ckdev as wake enabled instead of input devices

[PATCH] cros_ec_keyb: Increment the wakeup count to the specific mfd device.

2018-05-23 Thread Ravi Chandra Sadineni
If the IRQ is processed during resume, increment the wakeup count to the specific mfd device based on the event, if the mfd device is wake enabled. This helps in identifying the specific device that caused the wake. Signed-off-by: Ravi Chandra Sadineni --- drivers/input/keyboard/cros_ec_keyb.c

Re: [PATCH V5] USB: Increment wakeup count on remote wakeup.

2018-04-21 Thread Ravi Chandra Sadineni
Sure. Pushing it to the older kernels will definitely help. Thanks, Ravi On Sat, Apr 21, 2018 at 1:59 AM, Greg KH wrote: > On Fri, Apr 20, 2018 at 11:08:21AM -0700, Ravi Chandra Sadineni wrote: >> On chromebooks we depend on wakeup count to identify the wakeup source. >> Bu

Re: [PATCH V3] USB: Increment wakeup count on remote wakeup.

2018-04-20 Thread Ravi Chandra Sadineni
On Fri, Apr 20, 2018 at 10:29 AM, Alan Stern wrote: > On Fri, 20 Apr 2018, Ravi Chandra Sadineni wrote: > >> On chromebooks we depend on wakeup count to identify the wakeup source. >> But currently USB devices do not increment the wakeup count when they >> trigger the

[PATCH V5] USB: Increment wakeup count on remote wakeup.

2018-04-20 Thread Ravi Chandra Sadineni
Notification to the host (USB3.0 spec section 8.5.6.4) Thus on receiving the Function Wake, increment the wakeup count. Signed-off-by: Ravi Chandra Sadineni --- V5: Added the description of changes between different versions of patches. V4: Moved the wakeup count increment logic to the existing if which is

[PATCH V4] USB: Increment wakeup count on remote wakeup.

2018-04-20 Thread Ravi Chandra Sadineni
Notification to the host (USB3.0 spec section 8.5.6.4) Thus on receiving the Function Wake, increment the wakeup count. Signed-off-by: Ravi Chandra Sadineni --- drivers/usb/core/hcd.c | 1 + drivers/usb/core/hub.c | 10 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/usb

Re: [PATCH V2] USB: Increment wakeup count on remote wakeup.

2018-04-20 Thread Ravi Chandra Sadineni
On Fri, Apr 20, 2018 at 7:12 AM, Alan Stern wrote: > On Thu, 19 Apr 2018, Ravi Chandra Sadineni wrote: > >> On chromebooks we depend on wakeup count to identify the wakeup source. >> But currently USB devices do not increment the wakeup count when they >> trigger the

[PATCH V3] USB: Increment wakeup count on remote wakeup.

2018-04-20 Thread Ravi Chandra Sadineni
Notification to the host (USB3.0 spec section 8.5.6.4) Thus on receiving the Function Wake, increment the wakeup count. Signed-off-by: Ravi Chandra Sadineni --- drivers/usb/core/hcd.c | 2 ++ drivers/usb/core/hub.c | 10 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/usb

Re: [PATCH] USB: Increment wakeup count on remote wakeup.

2018-04-19 Thread Ravi Chandra Sadineni
Hi Alan, Thanks for reviewing the change. Appreciate your time. I tried to address your comments in the V2 of the patch. On Thu, Apr 19, 2018 at 8:01 AM, Alan Stern wrote: > On Wed, 18 Apr 2018, Ravi Chandra Sadineni wrote: > >> On chromebooks we depend on wakeup count to identif

[PATCH V2] USB: Increment wakeup count on remote wakeup.

2018-04-19 Thread Ravi Chandra Sadineni
Notification to the host (USB3.0 spec section 8.5.6.4) Thus on receiving the Function Wake, increment the wakeup count. Signed-off-by: Ravi Chandra Sadineni --- drivers/usb/core/hcd.c | 2 ++ drivers/usb/core/hub.c | 10 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/usb

[PATCH] USB: Increment wakeup count on remote wakeup.

2018-04-18 Thread Ravi Chandra Sadineni
On chromebooks we depend on wakeup count to identify the wakeup source. But currently USB devices do not increment the wakeup count when they trigger the remote wake. This patch addresses the same. Resume condition is reported differently on USB 2.0 and USB 3.0 devices. On USB 2.0 devices, a wake