From: Thomas Renninger <trenn@suse.de>
To: Len Brown <len.brown@intel.com>
Cc: linux-acpi@vger.kernel.org
Subject: Re: [PATCH 2/8] ACPI: thermal: Replace pointer with name in trip_points
Date: Mon, 04 Jun 2007 18:30:45 +0200 [thread overview]
Message-ID: <1180974645.28514.99.camel@queen.suse.de> (raw)
In-Reply-To: <68ccfaa8222f2a26f0689fad9e8c0c3f4c19f599.1180761191.git.len.brown@intel.com>
[-- Attachment #1: Type: text/plain, Size: 4925 bytes --]
On Sat, 2007-06-02 at 01:15 -0400, Len Brown wrote:
> From: Thomas Renninger <trenn@suse.de>
>
> For users with active thermal trip points, they need
> the fan's name, rather than its address, to understand
> where to look to observe and control fan state.
>
> Signed-off-by: Thomas Renninger <trenn@suse.de>
> Signed-off-by: Len Brown <len.brown@intel.com>
> ---
> drivers/acpi/thermal.c | 13 +++++++------
> 1 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
> index 1ada017..194ecfe 100644
> --- a/drivers/acpi/thermal.c
> +++ b/drivers/acpi/thermal.c
> @@ -827,6 +827,7 @@ static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file)
> static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
> {
> struct acpi_thermal *tz = seq->private;
> + struct acpi_device *device;
> int i = 0;
> int j = 0;
>
> @@ -849,9 +850,8 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
> tz->trips.passive.tc1, tz->trips.passive.tc2,
> tz->trips.passive.tsp);
> for (j = 0; j < tz->trips.passive.devices.count; j++) {
> -
> - seq_printf(seq, "0x%p ",
> - tz->trips.passive.devices.handles[j]);
> + acpi_bus_get_device(tz->trips.passive.devices.handles[j], &device);
> + seq_printf(seq, "%4.4s ", acpi_device_bid(device));
> }
> seq_puts(seq, "\n");
> }
> @@ -862,9 +862,10 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
> seq_printf(seq, "active[%d]: %ld C: devices=",
> i,
> KELVIN_TO_CELSIUS(tz->trips.active[i].temperature));
> - for (j = 0; j < tz->trips.active[i].devices.count; j++)
> - seq_printf(seq, "0x%p ",
> - tz->trips.active[i].devices.handles[j]);
> + for (j = 0; j < tz->trips.active[i].devices.count; j++){
> + acpi_bus_get_device(tz->trips.active[i].devices.handles[j], &device);
> + seq_printf(seq, "%4.4s ", acpi_device_bid(device));
> + }
If acpi_bus_get_device(..) fails, device will be NULL.
I sent another patch checking for that. I couldn't find it, I redid the
small change and test-booted (machine only has a passive tp, but I could
see: ...devices=CPU0), seems to work.
Not sure whether the check is really needed, but I think yes. IIRC I saw
the warn/err message for this happening ("No context for object..") for
fan devices in some dmesg.
Len, could you also check for the asus patch I sent you some time ago.
While testing this one, I got kernel Warnings with backtrace because of
a wrong return value in the asus module, should be just replacing return
result with return -ENODEV in the init function. Tell me and I can
resend it.
Thanks,
Thomas
Show devices for active/passive cooling in thermal trip_points file
Currently the internal pointer to a ACPI handle of a device
which is used for active/passive cooling at a certain temperature
is exported to userspace. This pointer isn't of any use for userspace.
Instead, export the device name, so
that automated tests (e.g. linuxfirmwarekit) can check whether the
device (at least fans for active cooling trip points) really get activated
on the right temperature.
Signed-off-by: Thomas Renninger <trenn@suse.de>
drivers/acpi/thermal.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
Index: linux-2.6.22-rc3/drivers/acpi/thermal.c
===================================================================
--- linux-2.6.22-rc3.orig/drivers/acpi/thermal.c
+++ linux-2.6.22-rc3/drivers/acpi/thermal.c
@@ -827,6 +827,9 @@ static int acpi_thermal_temp_open_fs(str
static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_thermal *tz = seq->private;
+ struct acpi_device *device;
+ acpi_status status;
+
int i = 0;
int j = 0;
@@ -849,9 +852,10 @@ static int acpi_thermal_trip_seq_show(st
tz->trips.passive.tc1, tz->trips.passive.tc2,
tz->trips.passive.tsp);
for (j = 0; j < tz->trips.passive.devices.count; j++) {
-
- seq_printf(seq, "0x%p ",
- tz->trips.passive.devices.handles[j]);
+ status = acpi_bus_get_device(tz->trips.passive.devices.
+ handles[j], &device);
+ seq_printf(seq, "%4.4s ", status ? "" :
+ acpi_device_bid(device));
}
seq_puts(seq, "\n");
}
@@ -862,9 +866,13 @@ static int acpi_thermal_trip_seq_show(st
seq_printf(seq, "active[%d]: %ld C: devices=",
i,
KELVIN_TO_CELSIUS(tz->trips.active[i].temperature));
- for (j = 0; j < tz->trips.active[i].devices.count; j++)
- seq_printf(seq, "0x%p ",
- tz->trips.active[i].devices.handles[j]);
+ for (j = 0; j < tz->trips.active[i].devices.count; j++){
+ status = acpi_bus_get_device(tz->trips.active[i].
+ devices.handles[j],
+ &device);
+ seq_printf(seq, "%4.4s ", status ? "" :
+ acpi_device_bid(device));
+ }
seq_puts(seq, "\n");
}
[-- Attachment #2: acpi_show_devices.patch --]
[-- Type: text/x-patch, Size: 2197 bytes --]
Show devices for active/passive cooling in thermal trip_points file
Currently the internal pointer to a ACPI handle of a device
which is used for active/passive cooling at a certain temperature
is exported to userspace. This pointer isn't of any use for userspace.
Instead, export the device name, so
that automated tests (e.g. linuxfirmwarekit) can check whether the
device (at least fans for active cooling trip points) really get activated
on the right temperature.
Signed-off-by: Thomas Renninger <trenn@suse.de>
drivers/acpi/thermal.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
Index: linux-2.6.22-rc3/drivers/acpi/thermal.c
===================================================================
--- linux-2.6.22-rc3.orig/drivers/acpi/thermal.c
+++ linux-2.6.22-rc3/drivers/acpi/thermal.c
@@ -827,6 +827,9 @@ static int acpi_thermal_temp_open_fs(str
static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_thermal *tz = seq->private;
+ struct acpi_device *device;
+ acpi_status status;
+
int i = 0;
int j = 0;
@@ -849,9 +852,10 @@ static int acpi_thermal_trip_seq_show(st
tz->trips.passive.tc1, tz->trips.passive.tc2,
tz->trips.passive.tsp);
for (j = 0; j < tz->trips.passive.devices.count; j++) {
-
- seq_printf(seq, "0x%p ",
- tz->trips.passive.devices.handles[j]);
+ status = acpi_bus_get_device(tz->trips.passive.devices.
+ handles[j], &device);
+ seq_printf(seq, "%4.4s ", status ? "" :
+ acpi_device_bid(device));
}
seq_puts(seq, "\n");
}
@@ -862,9 +866,13 @@ static int acpi_thermal_trip_seq_show(st
seq_printf(seq, "active[%d]: %ld C: devices=",
i,
KELVIN_TO_CELSIUS(tz->trips.active[i].temperature));
- for (j = 0; j < tz->trips.active[i].devices.count; j++)
- seq_printf(seq, "0x%p ",
- tz->trips.active[i].devices.handles[j]);
+ for (j = 0; j < tz->trips.active[i].devices.count; j++){
+ status = acpi_bus_get_device(tz->trips.active[i].
+ devices.handles[j],
+ &device);
+ seq_printf(seq, "%4.4s ", status ? "" :
+ acpi_device_bid(device));
+ }
seq_puts(seq, "\n");
}
next prev parent reply other threads:[~2007-06-04 16:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-02 5:15 ACPI patches for 2.6.22-rc3 Len Brown
2007-06-02 5:15 ` [PATCH 1/8] ACPICA: allow Load(OEMx) tables Len Brown
2007-06-02 5:15 ` Len Brown
2007-06-02 5:15 ` [PATCH 2/8] ACPI: thermal: Replace pointer with name in trip_points Len Brown
2007-06-02 5:15 ` Len Brown
2007-06-04 16:30 ` Thomas Renninger [this message]
2007-06-18 4:38 ` Len Brown
2007-06-02 5:15 ` [PATCH 3/8] ACPI: extend "acpi_osi=" boot option Len Brown
2007-06-02 5:15 ` Len Brown
2007-06-02 5:15 ` [PATCH 4/8] ACPI: Make _OSI(Linux) a special case Len Brown
2007-06-02 5:15 ` Len Brown
2007-06-02 5:15 ` [PATCH 5/8] ACPI: add __init to acpi_initialize_subsystem() Len Brown
2007-06-02 5:15 ` Len Brown
2007-06-02 5:15 ` [PATCH 6/8] ACPI: thinkpad-acpi: do not use named sysfs groups Len Brown
2007-06-02 5:15 ` Len Brown
2007-06-02 5:15 ` [PATCH 7/8] ACPI: Section mismatch ... acpi_map_pxm_to_node Len Brown
2007-06-02 5:15 ` Len Brown
2007-06-02 5:15 ` [PATCH 8/8] ACPICA: Support for external package objects as method arguments Len Brown
2007-06-02 5:15 ` Len Brown
2007-06-04 22:25 ` Myron Stowe
2007-06-18 4:53 ` Len Brown
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=1180974645.28514.99.camel@queen.suse.de \
--to=trenn@suse.de \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.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 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.