mbox series

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

Message ID 20190722223337.36199-1-ravisadineni@chromium.org (mailing list archive)
Headers show
Series power: Refactor device level sysfs. | expand

Message

Ravi Chandra Sadineni July 22, 2019, 10:33 p.m. UTC
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 attribute.
  power:sysfs: Expose device wakeup_event_count.

 Documentation/ABI/testing/sysfs-devices-power | 36 +++++++++----------
 drivers/base/power/sysfs.c                    | 27 +++++++-------
 2 files changed, 33 insertions(+), 30 deletions(-)

Comments

Rafael J. Wysocki July 23, 2019, 7:44 a.m. UTC | #1
On Tue, Jul 23, 2019 at 12:33 AM Ravi Chandra Sadineni
<ravisadineni@chromium.org> wrote:
>
> 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 attribute.
>   power:sysfs: Expose device wakeup_event_count.

I don't think you need this at all, because
https://patchwork.kernel.org/patch/11045069/ is exposing what you need
already.

Thanks!
Ravi Chandra Sadineni July 23, 2019, 4:56 p.m. UTC | #2
Hi Greg,

https://patchwork.kernel.org/patch/11045069/ seems to create a virtual
device under wakeup class with the same name as the actual device. I
don't see a way to reliably map these virtual devices to the actual
device sysfs node. For example if we have to know if a particular
input device has triggered a wake event, we have to look for a virtual
device under /sys/class/wakeup with the same name. I am afraid that
depending just on the name might be too risky as there can be multiple
devices under different buses with the same name.  Am I missing
something?

Thanks,
Ravi

On Tue, Jul 23, 2019 at 12:44 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Tue, Jul 23, 2019 at 12:33 AM Ravi Chandra Sadineni
> <ravisadineni@chromium.org> wrote:
> >
> > 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 attribute.
> >   power:sysfs: Expose device wakeup_event_count.
>
> I don't think you need this at all, because
> https://patchwork.kernel.org/patch/11045069/ is exposing what you need
> already.
>
> Thanks!
Rafael J. Wysocki July 23, 2019, 5:02 p.m. UTC | #3
On Tue, Jul 23, 2019 at 6:57 PM Ravi Chandra Sadineni
<ravisadineni@chromium.org> wrote:
>
> Hi Greg,
>
> https://patchwork.kernel.org/patch/11045069/ seems to create a virtual
> device under wakeup class with the same name as the actual device. I
> don't see a way to reliably map these virtual devices to the actual
> device sysfs node. For example if we have to know if a particular
> input device has triggered a wake event, we have to look for a virtual
> device under /sys/class/wakeup with the same name. I am afraid that
> depending just on the name might be too risky as there can be multiple
> devices under different buses with the same name.  Am I missing
> something?

There can be a symlink (say "wakeup_source") from under the actual
device to the virtual wakeup one associated with it.

Then we can advise everybody to use the symlink for the stats and
deprecate the stats attributes under the actual device going forward.
:-)

I have a plan to cut a patch to add such a symlink, but you can try to
beat me to that if you want.

> On Tue, Jul 23, 2019 at 12:44 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
> >
> > On Tue, Jul 23, 2019 at 12:33 AM Ravi Chandra Sadineni
> > <ravisadineni@chromium.org> wrote:
> > >
> > > 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 attribute.
> > >   power:sysfs: Expose device wakeup_event_count.
> >
> > I don't think you need this at all, because
> > https://patchwork.kernel.org/patch/11045069/ is exposing what you need
> > already.
> >
> > Thanks!
Ravi Chandra Sadineni July 23, 2019, 5:25 p.m. UTC | #4
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 <rafael@kernel.org> wrote:
>
> On Tue, Jul 23, 2019 at 6:57 PM Ravi Chandra Sadineni
> <ravisadineni@chromium.org> wrote:
> >
> > Hi Greg,
> >
> > https://patchwork.kernel.org/patch/11045069/ seems to create a virtual
> > device under wakeup class with the same name as the actual device. I
> > don't see a way to reliably map these virtual devices to the actual
> > device sysfs node. For example if we have to know if a particular
> > input device has triggered a wake event, we have to look for a virtual
> > device under /sys/class/wakeup with the same name. I am afraid that
> > depending just on the name might be too risky as there can be multiple
> > devices under different buses with the same name.  Am I missing
> > something?
>
> There can be a symlink (say "wakeup_source") from under the actual
> device to the virtual wakeup one associated with it.
>
> Then we can advise everybody to use the symlink for the stats and
> deprecate the stats attributes under the actual device going forward.
> :-)
>
> I have a plan to cut a patch to add such a symlink, but you can try to
> beat me to that if you want.
>
> > On Tue, Jul 23, 2019 at 12:44 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
> > >
> > > On Tue, Jul 23, 2019 at 12:33 AM Ravi Chandra Sadineni
> > > <ravisadineni@chromium.org> wrote:
> > > >
> > > > 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 attribute.
> > > >   power:sysfs: Expose device wakeup_event_count.
> > >
> > > I don't think you need this at all, because
> > > https://patchwork.kernel.org/patch/11045069/ is exposing what you need
> > > already.
> > >
> > > Thanks!