From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Prashanth Prakash <pprakash@codeaurora.org>
Cc: linux-acpi@vger.kernel.org, lenb@kernel.org,
sudeep.holla@arm.com, al.stone@linaro.org
Subject: Re: [RFC] ACPI / Processor: add sysfs support for low power idle
Date: Tue, 18 Apr 2017 16:34:36 +0200 [thread overview]
Message-ID: <2594349.EKCJmLdolL@aspire.rjw.lan> (raw)
In-Reply-To: <1490832795-27441-1-git-send-email-pprakash@codeaurora.org>
On Wednesday, March 29, 2017 06:13:15 PM Prashanth Prakash wrote:
> Add support to expose idle statistics maintained by platform to
> userspace via sysfs in addition to other data of interest from
> each LPI(Low Power Idle) state.
>
> LPI described in section 8.4.4 of ACPI spec 6.1 provides different
> methods to obtain idle statistics maintained by the platform. These
> show a granular view of how each of the LPI state is being used at
> different level of hierarchy. sysfs data is exposed at each level in
> the hierarchy by creating a directory named 'lpi' at each level and
> the LPI state information is presented under it. Below is the
> representation of LPI information at one such level in the hierarchy
>
> .../ACPI00XX: XX/lpi
> |-> summary_stats
> |-> state0
> | |-> desc
> | |-> time
> | |-> usage
> | |-> latency
> | |-> min_residency
> | |-> flags
> | |-> arch_flags
> |
> <<more states>>
>
> ACPI00XX can be ACPI0007(processor) or ACPI0010(processor container)
>
> stateX contains information related to a specific LPI state defined
> in the LPI ACPI tables.
>
> summary_stats shows the stats(usage and time) from all the LPI states
> under a device. The summary_stats are provided to reduce the number'
> of files to be accessed by the userspace to capture a snapshot of the'
> idle statistics.
>
> Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org>
I'd like Sudeep to tell me what he thinks about this in the first place.
> ---
> drivers/acpi/acpi_processor.c | 11 ++
> drivers/acpi/processor_idle.c | 345 +++++++++++++++++++++++++++++++++++++++++-
> include/acpi/processor.h | 27 ++++
> 3 files changed, 381 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
> index 0143135..a01368d 100644
> --- a/drivers/acpi/acpi_processor.c
> +++ b/drivers/acpi/acpi_processor.c
> @@ -570,9 +570,19 @@ void __init acpi_early_processor_osc(void)
> static int acpi_processor_container_attach(struct acpi_device *dev,
> const struct acpi_device_id *id)
> {
> + if (dev->status.present && dev->status.functional &&
> + dev->status.enabled && dev->status.show_in_ui)
> + acpi_lpi_sysfs_init(dev->handle,
> + (struct acpi_lpi_sysfs_data **)&dev->driver_data);
This isn't the right place to do it IMO.
It should be done at the processor driver initialization when it is know that
LPI is going to be used at all.
> return 1;
> }
>
> +static void acpi_processor_container_detach(struct acpi_device *dev)
> +{
> + if (dev->driver_data)
> + acpi_lpi_sysfs_exit((struct acpi_lpi_sysfs_data *)dev->driver_data);
And analogously here.
> +}
> +
> static const struct acpi_device_id processor_container_ids[] = {
> { ACPI_PROCESSOR_CONTAINER_HID, },
> { }
Thanks,
Rafael
next prev parent reply other threads:[~2017-04-18 14:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-30 0:13 [RFC] ACPI / Processor: add sysfs support for low power idle Prashanth Prakash
2017-04-18 14:34 ` Rafael J. Wysocki [this message]
2017-04-19 23:00 ` Prakash, Prashanth
2017-04-19 15:37 ` Sudeep Holla
2017-04-19 22:57 ` Prakash, Prashanth
2017-04-20 8:46 ` Sudeep Holla
2017-04-25 1:17 ` Prakash, Prashanth
2017-04-25 10:28 ` Sudeep Holla
2017-04-26 23:21 ` Prakash, Prashanth
2017-04-27 9:16 ` Sudeep Holla
2017-04-27 21:04 ` Prakash, Prashanth
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=2594349.EKCJmLdolL@aspire.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=al.stone@linaro.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=pprakash@codeaurora.org \
--cc=sudeep.holla@arm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.