lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5d48bbc2.1c69fb81.62114.5473@mx.google.com>
Date:   Mon, 05 Aug 2019 16:29:05 -0700
From:   Stephen Boyd <swboyd@...omium.org>
To:     Tri Vo <trong@...roid.com>, gregkh@...uxfoundation.org,
        rjw@...ysocki.net, viresh.kumar@...aro.org
Cc:     rafael@...nel.org, hridya@...gle.com, sspatil@...gle.com,
        kaleshsingh@...gle.com, ravisadineni@...omium.org,
        linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
        kernel-team@...roid.com, Tri Vo <trong@...roid.com>
Subject: Re: [PATCH v7 3/3] PM / wakeup: Show wakeup sources stats in sysfs

Quoting Tri Vo (2019-08-05 10:58:48)
> diff --git a/drivers/base/power/wakeup_stats.c b/drivers/base/power/wakeup_stats.c
> new file mode 100644
> index 000000000000..3a4f55028e27
> --- /dev/null
> +++ b/drivers/base/power/wakeup_stats.c
> @@ -0,0 +1,161 @@
[...]
> +/**
> + * wakeup_source_sysfs_add - Add wakeup_source attributes to sysfs.
> + * @parent: Device given wakeup source is associated with (or NULL if virtual).
> + * @ws: Wakeup source to be added in sysfs.
> + */
> +int wakeup_source_sysfs_add(struct device *parent, struct wakeup_source *ws)
> +{
> +       struct device *dev;
> +
> +       dev = device_create_with_groups(wakeup_class, parent, MKDEV(0, 0), ws,
> +                                       wakeup_source_groups, "wakeup%d",
> +                                       ws->id);
> +       if (IS_ERR(dev))
> +               return PTR_ERR(dev);
> +       ws->dev = dev;
> +       pm_runtime_no_callbacks(ws->dev);

Does this only avoid adding runtime PM attributes?

I thought we would call device_set_pm_not_required() on the device here.
Probably requiring a bit of copy/paste from device_create_with_groups()
so that it can be set before the device is registered. Or another
version of device_create_with_groups() that does everything besides call
device_add().

> +
> +       return 0;
> +}
> +EXPORT_SYMBOL_GPL(wakeup_source_sysfs_add);
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ