From: Stephen Boyd <swboyd@chromium.org>
To: Tri Vo <trong@android.com>,
gregkh@linuxfoundation.org, rjw@rjwysocki.net,
viresh.kumar@linaro.org
Cc: rafael@kernel.org, hridya@google.com, sspatil@google.com,
kaleshsingh@google.com, ravisadineni@chromium.org,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
kernel-team@android.com, Tri Vo <trong@android.com>
Subject: Re: [PATCH v7 3/3] PM / wakeup: Show wakeup sources stats in sysfs
Date: Mon, 05 Aug 2019 16:29:05 -0700 [thread overview]
Message-ID: <5d48bbc2.1c69fb81.62114.5473@mx.google.com> (raw)
In-Reply-To: <20190805175848.163558-4-trong@android.com>
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);
> +
next prev parent reply other threads:[~2019-08-05 23:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-05 17:58 [PATCH v7 0/3] PM / wakeup: show wakeup sources stats in sysfs Tri Vo
2019-08-05 17:58 ` [PATCH v7 1/3] PM / wakeup: Drop wakeup_source_init(), wakeup_source_prepare() Tri Vo
2019-08-05 20:54 ` Stephen Boyd
2019-08-05 21:11 ` Tri Vo
2019-08-05 21:15 ` Stephen Boyd
2019-08-05 17:58 ` [PATCH v7 2/3] PM / wakeup: Use wakeup_source_register() in wakelock.c Tri Vo
2019-08-05 20:57 ` Stephen Boyd
2019-08-05 17:58 ` [PATCH v7 3/3] PM / wakeup: Show wakeup sources stats in sysfs Tri Vo
2019-08-05 21:02 ` Stephen Boyd
2019-08-05 23:29 ` Stephen Boyd [this message]
2019-08-06 18:51 ` Tri Vo
2019-08-06 21:32 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5d48bbc2.1c69fb81.62114.5473@mx.google.com \
--to=swboyd@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=hridya@google.com \
--cc=kaleshsingh@google.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=ravisadineni@chromium.org \
--cc=rjw@rjwysocki.net \
--cc=sspatil@google.com \
--cc=trong@android.com \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox