* ACPI patches for 2.6.22-rc3
@ 2007-06-02 5:15 Len Brown
[not found] ` <0efabac9b7c8535eeb199d2f16d3eb44dc4761b2.1180761191.git.len.brown@intel.com>
0 siblings, 1 reply; 13+ messages in thread
From: Len Brown @ 2007-06-02 5:15 UTC (permalink / raw)
To: linux-acpi
I'll request this batch be included in 2.6.22 for -rc4.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/8] ACPICA: allow Load(OEMx) tables
[not found] ` <0efabac9b7c8535eeb199d2f16d3eb44dc4761b2.1180761191.git.len.brown@intel.com>
@ 2007-06-02 5:15 ` Len Brown
[not found] ` <ae00d812436dc968f4a5dea7757b6a94910b6dc4.1180761191.git.len.brown@intel.com>
` (6 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Len Brown @ 2007-06-02 5:15 UTC (permalink / raw)
To: linux-acpi; +Cc: Len Brown
HP and Hitachi machines have been implemented with SSDT's
that use the "OEMx" signatures. But upon Load, ACPICA is rejecting
these tables because they are not using the "SSDT" signature.
ACPI Error (tbinstal-0134): Table has invalid signature [OEMx], must be SSDT...
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/tables/tbinstal.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 0e7b121..3bc0c67 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -123,14 +123,14 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc,
}
}
- /* The table must be either an SSDT or a PSDT */
+ /* The table must be either an SSDT or a PSDT or an OEMx */
if ((!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT))
&&
- (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)))
- {
+ (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT))
+ && (strncmp(table_desc->pointer->signature, "OEM", 3))) {
ACPI_ERROR((AE_INFO,
- "Table has invalid signature [%4.4s], must be SSDT or PSDT",
+ "Table has invalid signature [%4.4s], must be SSDT, PSDT or OEMx",
table_desc->pointer->signature));
return_ACPI_STATUS(AE_BAD_SIGNATURE);
}
--
1.5.2.146.gb75c6
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/8] ACPI: thermal: Replace pointer with name in trip_points
[not found] ` <68ccfaa8222f2a26f0689fad9e8c0c3f4c19f599.1180761191.git.len.brown@intel.com>
@ 2007-06-02 5:15 ` Len Brown
2007-06-04 16:30 ` Thomas Renninger
1 sibling, 0 replies; 13+ messages in thread
From: Len Brown @ 2007-06-02 5:15 UTC (permalink / raw)
To: linux-acpi; +Cc: Thomas Renninger, Len Brown
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));
+ }
seq_puts(seq, "\n");
}
--
1.5.2.146.gb75c6
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/8] ACPI: extend "acpi_osi=" boot option
[not found] ` <ae00d812436dc968f4a5dea7757b6a94910b6dc4.1180761191.git.len.brown@intel.com>
@ 2007-06-02 5:15 ` Len Brown
0 siblings, 0 replies; 13+ messages in thread
From: Len Brown @ 2007-06-02 5:15 UTC (permalink / raw)
To: linux-acpi; +Cc: Len Brown
The boot option "acpi_osi=" has always disabled Linux _OSI support,
thus disabling all OS Interface strings which are advertised
by Linux to the BIOS.
Now...
acpi_osi="string" adds the interface string, and
acpi_osi="!string" invalidates the pre-defined interface string
eg. acpi_osi="!Windows 2006"
would disable Linux's claim of Vista compatibility.
Signed-off-by: Len Brown <len.brown@intel.com>
---
Documentation/kernel-parameters.txt | 5 ++++-
drivers/acpi/osl.c | 25 ++++++++++++++++---------
drivers/acpi/utilities/uteval.c | 27 ++++++++++++++++++++++++++-
include/acpi/acpiosxf.h | 1 +
4 files changed, 47 insertions(+), 11 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index aae2282..7915014 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -170,7 +170,10 @@ and is between 256 and 4096 characters. It is defined in the file
acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS
Format: To spoof as Windows 98: ="Microsoft Windows"
- acpi_osi= [HW,ACPI] empty param disables _OSI
+ acpi_osi= [HW,ACPI] Modify list of supported OS interface strings
+ acpi_osi="string1" # add string1 -- only one string
+ acpi_osi="!string2" # remove built-in string2
+ acpi_osi= # disable all strings
acpi_serialize [HW,ACPI] force serialization of AML methods
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index b998340..f4760cf 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -73,6 +73,9 @@ static void *acpi_irq_context;
static struct workqueue_struct *kacpid_wq;
static struct workqueue_struct *kacpi_notify_wq;
+#define OSI_STRING_LENGTH_MAX 64 /* arbitrary */
+static char osi_additional_string[OSI_STRING_LENGTH_MAX];
+
static void __init acpi_request_region (struct acpi_generic_address *addr,
unsigned int length, char *desc)
{
@@ -961,19 +964,23 @@ static int __init acpi_os_name_setup(char *str)
__setup("acpi_os_name=", acpi_os_name_setup);
/*
- * _OSI control
+ * Modify the list of "OS Interfaces" reported to BIOS via _OSI
+ *
* empty string disables _OSI
- * TBD additional string adds to _OSI
+ * string starting with '!' disables that string
+ * otherwise string is added to list, augmenting built-in strings
*/
static int __init acpi_osi_setup(char *str)
{
if (str == NULL || *str == '\0') {
printk(KERN_INFO PREFIX "_OSI method disabled\n");
acpi_gbl_create_osi_method = FALSE;
- } else {
- /* TBD */
- printk(KERN_ERR PREFIX "_OSI additional string ignored -- %s\n",
- str);
+ } else if (*str == '!') {
+ if (acpi_osi_invalidate(++str) == AE_OK)
+ printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str);
+ } else if (*osi_additional_string == '\0') {
+ strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX);
+ printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str);
}
return 1;
@@ -1143,11 +1150,11 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
acpi_status
acpi_os_validate_interface (char *interface)
{
-
- return AE_SUPPORT;
+ if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX))
+ return AE_OK;
+ return AE_SUPPORT;
}
-
/******************************************************************************
*
* FUNCTION: acpi_os_validate_address
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index 13d5879..a10120a 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -59,7 +59,7 @@ acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc,
/*
* Strings supported by the _OSI predefined (internal) method.
*/
-static const char *acpi_interfaces_supported[] = {
+static char *acpi_interfaces_supported[] = {
/* Operating System Vendor Strings */
"Linux",
@@ -158,6 +158,31 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
/*******************************************************************************
*
+ * FUNCTION: acpi_osi_invalidate
+ *
+ * PARAMETERS: interface_string
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: invalidate string in pre-defiend _OSI string list
+ *
+ ******************************************************************************/
+
+acpi_status acpi_osi_invalidate(char *interface)
+{
+ int i;
+
+ for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) {
+ if (!ACPI_STRCMP(interface, acpi_interfaces_supported[i])) {
+ *acpi_interfaces_supported[i] = '\0';
+ return AE_OK;
+ }
+ }
+ return AE_NOT_FOUND;
+}
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_ut_evaluate_object
*
* PARAMETERS: prefix_node - Starting node
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 5e07db0..de26ee1 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -236,6 +236,7 @@ acpi_os_derive_pci_id(acpi_handle rhandle,
* Miscellaneous
*/
acpi_status acpi_os_validate_interface(char *interface);
+acpi_status acpi_osi_invalidate(char* interface);
acpi_status
acpi_os_validate_address(u8 space_id,
--
1.5.2.146.gb75c6
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 4/8] ACPI: Make _OSI(Linux) a special case
[not found] ` <f507654d450d329c81a70eec0096d5dfe67802ec.1180761191.git.len.brown@intel.com>
@ 2007-06-02 5:15 ` Len Brown
0 siblings, 0 replies; 13+ messages in thread
From: Len Brown @ 2007-06-02 5:15 UTC (permalink / raw)
To: linux-acpi; +Cc: Len Brown
_OSI("Linux") is like _OS("Linux"), it is ill-defined and
virtually no BIOS vendors test interaction with it.
As a result, it can do more damage than good because
it causes the BIOS to follow un-tested paths.
Recently, several machines have turned up that erroneously
test this string in a way which causes them to _not_ test other
compatibility strings, including the ZI9 and Toshiba.
So it appears that this bad code has made it into
a BIOS vendor's reference BIOS.
Linux has no choice but to stop advertising compatibility
with _OSI string "Linux" - as there are an unbounded
number of possible incompatibilities going forward.
But some BIOSes have already shipped which do use it
for things like conditionally re-enabling video on resume
from S3. (Too bad they didn't do that unconditionally)
Add special case code for _OSI(Linux)
Squawk to dmesg if _OSI(Linux) is requested
Add DMI list both to enable and disable _OSI(Linux)
But for now, keep the default enabled via
#define OSI_LINUX_ENABLED.
http://bugzilla.kernel.org/show_bug.cgi?id=7787
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/osl.c | 91 +++++++++++++++++++++++++++++++++++++++
drivers/acpi/utilities/uteval.c | 1 -
2 files changed, 91 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index f4760cf..e349879 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -33,6 +33,7 @@
#include <linux/interrupt.h>
#include <linux/kmod.h>
#include <linux/delay.h>
+#include <linux/dmi.h>
#include <linux/workqueue.h>
#include <linux/nmi.h>
#include <linux/acpi.h>
@@ -76,6 +77,18 @@ static struct workqueue_struct *kacpi_notify_wq;
#define OSI_STRING_LENGTH_MAX 64 /* arbitrary */
static char osi_additional_string[OSI_STRING_LENGTH_MAX];
+#define OSI_LINUX_ENABLED
+#ifdef OSI_LINUX_ENABLED
+int osi_linux = 1; /* enable _OSI(Linux) by default */
+#else
+int osi_linux; /* disable _OSI(Linux) by default */
+#endif
+
+
+#ifdef CONFIG_DMI
+static struct dmi_system_id acpi_osl_dmi_table[];
+#endif
+
static void __init acpi_request_region (struct acpi_generic_address *addr,
unsigned int length, char *desc)
{
@@ -126,6 +139,7 @@ device_initcall(acpi_reserve_resources);
acpi_status acpi_os_initialize(void)
{
+ dmi_check_system(acpi_osl_dmi_table);
return AE_OK;
}
@@ -963,6 +977,16 @@ static int __init acpi_os_name_setup(char *str)
__setup("acpi_os_name=", acpi_os_name_setup);
+static void enable_osi_linux(int enable) {
+
+ if (osi_linux != enable)
+ printk(KERN_INFO PREFIX "%sabled _OSI(Linux)\n",
+ enable ? "En": "Dis");
+
+ osi_linux = enable;
+ return;
+}
+
/*
* Modify the list of "OS Interfaces" reported to BIOS via _OSI
*
@@ -978,6 +1002,10 @@ static int __init acpi_osi_setup(char *str)
} else if (*str == '!') {
if (acpi_osi_invalidate(++str) == AE_OK)
printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str);
+ } else if (!strcmp("!Linux", str)) {
+ enable_osi_linux(0);
+ } else if (!strcmp("Linux", str)) {
+ enable_osi_linux(1);
} else if (*osi_additional_string == '\0') {
strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX);
printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str);
@@ -1152,6 +1180,23 @@ acpi_os_validate_interface (char *interface)
{
if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX))
return AE_OK;
+ if (!strcmp("Linux", interface)) {
+ printk(KERN_WARNING PREFIX
+ "System BIOS is requesting _OSI(Linux)\n");
+#ifdef OSI_LINUX_ENABLED
+ printk(KERN_WARNING PREFIX
+ "Please test with \"acpi_osi=!Linux\"\n"
+ "Please send dmidecode "
+ "to linux-acpi@vger.kernel.org\n");
+#else
+ printk(KERN_WARNING PREFIX
+ "If \"acpi_osi=Linux\" works better,\n"
+ "Please send dmidecode "
+ "to linux-acpi@vger.kernel.org\n");
+#endif
+ if(osi_linux)
+ return AE_OK;
+ }
return AE_SUPPORT;
}
@@ -1181,5 +1226,51 @@ acpi_os_validate_address (
return AE_OK;
}
+#ifdef CONFIG_DMI
+#ifdef OSI_LINUX_ENABLED
+static int dmi_osi_not_linux(struct dmi_system_id *d)
+{
+ printk(KERN_NOTICE "%s detected: requires not _OSI(Linux)\n", d->ident);
+ enable_osi_linux(0);
+ return 0;
+}
+#else
+static int dmi_osi_linux(struct dmi_system_id *d)
+{
+ printk(KERN_NOTICE "%s detected: requires _OSI(Linux)\n", d->ident);
+ enable_osi_linux(1);
+ return 0;
+}
+#endif
+
+static struct dmi_system_id acpi_osl_dmi_table[] = {
+#ifdef OSI_LINUX_ENABLED
+ /*
+ * Boxes that need NOT _OSI(Linux)
+ */
+ {
+ .callback = dmi_osi_not_linux,
+ .ident = "Toshiba Satellite P100",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "TOSHIBA"),
+ DMI_MATCH(DMI_BOARD_NAME, "Satellite P100"),
+ },
+ },
+#else
+ /*
+ * Boxes that need _OSI(Linux)
+ */
+ {
+ .callback = dmi_osi_linux,
+ .ident = "Intel Napa CRB",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
+ DMI_MATCH(DMI_BOARD_NAME, "MPAD-MSAE Customer Reference Boards"),
+ },
+ },
+#endif
+ {}
+};
+#endif /* CONFIG_DMI */
#endif
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index a10120a..8ec6f8e 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -62,7 +62,6 @@ acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc,
static char *acpi_interfaces_supported[] = {
/* Operating System Vendor Strings */
- "Linux",
"Windows 2000",
"Windows 2001",
"Windows 2001 SP0",
--
1.5.2.146.gb75c6
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 5/8] ACPI: add __init to acpi_initialize_subsystem()
[not found] ` <dd272b5716a54afa33a69f2241284d8ec60b7892.1180761191.git.len.brown@intel.com>
@ 2007-06-02 5:15 ` Len Brown
0 siblings, 0 replies; 13+ messages in thread
From: Len Brown @ 2007-06-02 5:15 UTC (permalink / raw)
To: linux-acpi; +Cc: Len Brown
Add __init to:
acpi_initialize_subsystem() (and un-export it)
acpi_os_initialize()
Add __initdata to:
acpi_osl_dmi_table[]
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/osl.c | 6 +++---
drivers/acpi/utilities/utxface.c | 4 +---
include/acpi/acpiosxf.h | 2 +-
include/acpi/acpixf.h | 2 +-
4 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index e349879..58ceb18 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -86,7 +86,7 @@ int osi_linux; /* disable _OSI(Linux) by default */
#ifdef CONFIG_DMI
-static struct dmi_system_id acpi_osl_dmi_table[];
+static struct __initdata dmi_system_id acpi_osl_dmi_table[];
#endif
static void __init acpi_request_region (struct acpi_generic_address *addr,
@@ -137,7 +137,7 @@ static int __init acpi_reserve_resources(void)
}
device_initcall(acpi_reserve_resources);
-acpi_status acpi_os_initialize(void)
+acpi_status __init acpi_os_initialize(void)
{
dmi_check_system(acpi_osl_dmi_table);
return AE_OK;
@@ -1243,7 +1243,7 @@ static int dmi_osi_linux(struct dmi_system_id *d)
}
#endif
-static struct dmi_system_id acpi_osl_dmi_table[] = {
+static struct dmi_system_id acpi_osl_dmi_table[] __initdata = {
#ifdef OSI_LINUX_ENABLED
/*
* Boxes that need NOT _OSI(Linux)
diff --git a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c
index e9a5780..2d49691 100644
--- a/drivers/acpi/utilities/utxface.c
+++ b/drivers/acpi/utilities/utxface.c
@@ -61,7 +61,7 @@ ACPI_MODULE_NAME("utxface")
* called, so any early initialization belongs here.
*
******************************************************************************/
-acpi_status acpi_initialize_subsystem(void)
+acpi_status __init acpi_initialize_subsystem(void)
{
acpi_status status;
@@ -108,8 +108,6 @@ acpi_status acpi_initialize_subsystem(void)
return_ACPI_STATUS(status);
}
-ACPI_EXPORT_SYMBOL(acpi_initialize_subsystem)
-
/*******************************************************************************
*
* FUNCTION: acpi_enable_subsystem
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index de26ee1..ca882b8 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -78,7 +78,7 @@ struct acpi_signal_fatal_info {
/*
* OSL Initialization and shutdown primitives
*/
-acpi_status acpi_os_initialize(void);
+acpi_status __initdata acpi_os_initialize(void);
acpi_status acpi_os_terminate(void);
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index e08f7df..b5cca5d 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -55,7 +55,7 @@ acpi_status
acpi_initialize_tables(struct acpi_table_desc *initial_storage,
u32 initial_table_count, u8 allow_resize);
-acpi_status acpi_initialize_subsystem(void);
+acpi_status __init acpi_initialize_subsystem(void);
acpi_status acpi_enable_subsystem(u32 flags);
--
1.5.2.146.gb75c6
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 6/8] ACPI: thinkpad-acpi: do not use named sysfs groups
[not found] ` <cc4c24e115ca7bc2e4ec74d70bcb8fda1d1a8df8.1180761191.git.len.brown@intel.com>
@ 2007-06-02 5:15 ` Len Brown
0 siblings, 0 replies; 13+ messages in thread
From: Len Brown @ 2007-06-02 5:15 UTC (permalink / raw)
To: linux-acpi; +Cc: Henrique de Moraes Holschuh, Len Brown
From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
The initial version of the thinkpad-acpi sysfs interface (not yet released
in any stable mainline kernel) made liberal use of named sysfs groups, in
order to get the attributes more organized.
This proved to be a really bad design decision. Maybe if attribute groups
were as flexible as a real directory, and if binary attributes were not
second-class citizens, the idea of subdirs and named groups would not have
been so bad.
This patch makes all the thinkpad-acpi sysfs groups anonymous (thus
removing the subdirs), adds the former group names as a prefix (so that
hotkey/enable becomes hotkey_enable for example), and updates the
documentation.
These changes will make the thinkpad-acpi sysfs ABI a lot easier to
maintain.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
---
Documentation/thinkpad-acpi.txt | 25 +++++++++++--------------
drivers/misc/thinkpad_acpi.c | 17 +++++++----------
drivers/misc/thinkpad_acpi.h | 6 ------
3 files changed, 18 insertions(+), 30 deletions(-)
diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt
index 2d48033..9e6b94f 100644
--- a/Documentation/thinkpad-acpi.txt
+++ b/Documentation/thinkpad-acpi.txt
@@ -138,7 +138,7 @@ Hot keys
--------
procfs: /proc/acpi/ibm/hotkey
-sysfs device attribute: hotkey/*
+sysfs device attribute: hotkey_*
Without this driver, only the Fn-F4 key (sleep button) generates an
ACPI event. With the driver loaded, the hotkey feature enabled and the
@@ -196,10 +196,7 @@ The following commands can be written to the /proc/acpi/ibm/hotkey file:
sysfs notes:
- The hot keys attributes are in a hotkey/ subdirectory off the
- thinkpad device.
-
- bios_enabled:
+ hotkey_bios_enabled:
Returns the status of the hot keys feature when
thinkpad-acpi was loaded. Upon module unload, the hot
key feature status will be restored to this value.
@@ -207,19 +204,19 @@ sysfs notes:
0: hot keys were disabled
1: hot keys were enabled
- bios_mask:
+ hotkey_bios_mask:
Returns the hot keys mask when thinkpad-acpi was loaded.
Upon module unload, the hot keys mask will be restored
to this value.
- enable:
+ hotkey_enable:
Enables/disables the hot keys feature, and reports
current status of the hot keys feature.
0: disables the hot keys feature / feature disabled
1: enables the hot keys feature / feature enabled
- mask:
+ hotkey_mask:
bit mask to enable ACPI event generation for each hot
key (see above). Returns the current status of the hot
keys mask, and allows one to modify it.
@@ -229,7 +226,7 @@ Bluetooth
---------
procfs: /proc/acpi/ibm/bluetooth
-sysfs device attribute: bluetooth/enable
+sysfs device attribute: bluetooth_enable
This feature shows the presence and current state of a ThinkPad
Bluetooth device in the internal ThinkPad CDC slot.
@@ -244,7 +241,7 @@ If Bluetooth is installed, the following commands can be used:
Sysfs notes:
If the Bluetooth CDC card is installed, it can be enabled /
- disabled through the "bluetooth/enable" thinkpad-acpi device
+ disabled through the "bluetooth_enable" thinkpad-acpi device
attribute, and its current status can also be queried.
enable:
@@ -252,7 +249,7 @@ Sysfs notes:
1: enables Bluetooth / Bluetooth is enabled.
Note: this interface will be probably be superseeded by the
- generic rfkill class.
+ generic rfkill class, so it is NOT to be considered stable yet.
Video output control -- /proc/acpi/ibm/video
--------------------------------------------
@@ -898,7 +895,7 @@ EXPERIMENTAL: WAN
-----------------
procfs: /proc/acpi/ibm/wan
-sysfs device attribute: wwan/enable
+sysfs device attribute: wwan_enable
This feature is marked EXPERIMENTAL because the implementation
directly accesses hardware registers and may not work as expected. USE
@@ -921,7 +918,7 @@ If the W-WAN card is installed, the following commands can be used:
Sysfs notes:
If the W-WAN card is installed, it can be enabled /
- disabled through the "wwan/enable" thinkpad-acpi device
+ disabled through the "wwan_enable" thinkpad-acpi device
attribute, and its current status can also be queried.
enable:
@@ -929,7 +926,7 @@ Sysfs notes:
1: enables WWAN card / WWAN card is enabled.
Note: this interface will be probably be superseeded by the
- generic rfkill class.
+ generic rfkill class, so it is NOT to be considered stable yet.
Multiple Commands, Module Parameters
------------------------------------
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 6c36a55..95c0b96 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -740,7 +740,7 @@ static ssize_t hotkey_enable_store(struct device *dev,
}
static struct device_attribute dev_attr_hotkey_enable =
- __ATTR(enable, S_IWUSR | S_IRUGO,
+ __ATTR(hotkey_enable, S_IWUSR | S_IRUGO,
hotkey_enable_show, hotkey_enable_store);
/* sysfs hotkey mask --------------------------------------------------- */
@@ -775,7 +775,7 @@ static ssize_t hotkey_mask_store(struct device *dev,
}
static struct device_attribute dev_attr_hotkey_mask =
- __ATTR(mask, S_IWUSR | S_IRUGO,
+ __ATTR(hotkey_mask, S_IWUSR | S_IRUGO,
hotkey_mask_show, hotkey_mask_store);
/* sysfs hotkey bios_enabled ------------------------------------------- */
@@ -787,7 +787,7 @@ static ssize_t hotkey_bios_enabled_show(struct device *dev,
}
static struct device_attribute dev_attr_hotkey_bios_enabled =
- __ATTR(bios_enabled, S_IRUGO, hotkey_bios_enabled_show, NULL);
+ __ATTR(hotkey_bios_enabled, S_IRUGO, hotkey_bios_enabled_show, NULL);
/* sysfs hotkey bios_mask ---------------------------------------------- */
static ssize_t hotkey_bios_mask_show(struct device *dev,
@@ -798,7 +798,7 @@ static ssize_t hotkey_bios_mask_show(struct device *dev,
}
static struct device_attribute dev_attr_hotkey_bios_mask =
- __ATTR(bios_mask, S_IRUGO, hotkey_bios_mask_show, NULL);
+ __ATTR(hotkey_bios_mask, S_IRUGO, hotkey_bios_mask_show, NULL);
/* --------------------------------------------------------------------- */
@@ -824,8 +824,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
str_supported(tp_features.hotkey));
if (tp_features.hotkey) {
- hotkey_dev_attributes = create_attr_set(4,
- TPACPI_HOTKEY_SYSFS_GROUP);
+ hotkey_dev_attributes = create_attr_set(4, NULL);
if (!hotkey_dev_attributes)
return -ENOMEM;
res = add_to_attr_set(hotkey_dev_attributes,
@@ -1050,7 +1049,7 @@ static ssize_t bluetooth_enable_store(struct device *dev,
}
static struct device_attribute dev_attr_bluetooth_enable =
- __ATTR(enable, S_IWUSR | S_IRUGO,
+ __ATTR(bluetooth_enable, S_IWUSR | S_IRUGO,
bluetooth_enable_show, bluetooth_enable_store);
/* --------------------------------------------------------------------- */
@@ -1061,7 +1060,6 @@ static struct attribute *bluetooth_attributes[] = {
};
static const struct attribute_group bluetooth_attr_group = {
- .name = TPACPI_BLUETH_SYSFS_GROUP,
.attrs = bluetooth_attributes,
};
@@ -1215,7 +1213,7 @@ static ssize_t wan_enable_store(struct device *dev,
}
static struct device_attribute dev_attr_wan_enable =
- __ATTR(enable, S_IWUSR | S_IRUGO,
+ __ATTR(wwan_enable, S_IWUSR | S_IRUGO,
wan_enable_show, wan_enable_store);
/* --------------------------------------------------------------------- */
@@ -1226,7 +1224,6 @@ static struct attribute *wan_attributes[] = {
};
static const struct attribute_group wan_attr_group = {
- .name = TPACPI_WAN_SYSFS_GROUP,
.attrs = wan_attributes,
};
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h
index 440145a..72d62f2 100644
--- a/drivers/misc/thinkpad_acpi.h
+++ b/drivers/misc/thinkpad_acpi.h
@@ -278,8 +278,6 @@ static int beep_write(char *buf);
* Bluetooth subdriver
*/
-#define TPACPI_BLUETH_SYSFS_GROUP "bluetooth"
-
enum {
/* ACPI GBDC/SBDC bits */
TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */
@@ -416,8 +414,6 @@ static int fan_write_cmd_watchdog(const char *cmd, int *rc);
* Hotkey subdriver
*/
-#define TPACPI_HOTKEY_SYSFS_GROUP "hotkey"
-
static int hotkey_orig_status;
static int hotkey_orig_mask;
@@ -553,8 +549,6 @@ static int volume_write(char *buf);
* Wan subdriver
*/
-#define TPACPI_WAN_SYSFS_GROUP "wwan"
-
enum {
/* ACPI GWAN/SWAN bits */
TP_ACPI_WANCARD_HWPRESENT = 0x01, /* Wan hw available */
--
1.5.2.146.gb75c6
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 7/8] ACPI: Section mismatch ... acpi_map_pxm_to_node
[not found] ` <8ff6f48d99a0351bcc9ceab422042ef9d3bad9aa.1180761191.git.len.brown@intel.com>
@ 2007-06-02 5:15 ` Len Brown
0 siblings, 0 replies; 13+ messages in thread
From: Len Brown @ 2007-06-02 5:15 UTC (permalink / raw)
To: linux-acpi; +Cc: Luck, Tony, Len Brown
From: Luck, Tony <tony.luck@intel.com>
Last of the "Section mismatch" errors from ia64 builds! acpi_map_pxm_to_node()
is defined with attribute __cpuinit, but is called by "normal" kernel functions
acpi_getnode() and acpi_map_cpu2node().
Commit f363d16fbb9374c0bd7f2757d412c287169094c9 moved the data structures on
which this routine operates from __cpuinitdata to regular memory, so this
routine can also move out of init space.
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/numa.c | 2 +-
include/acpi/acpi_numa.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index a2efae8..0c9f15c 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -59,7 +59,7 @@ int node_to_pxm(int node)
return node_to_pxm_map[node];
}
-int __cpuinit acpi_map_pxm_to_node(int pxm)
+int acpi_map_pxm_to_node(int pxm)
{
int node = pxm_to_node_map[pxm];
diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h
index b62cd36..e2fcee2 100644
--- a/include/acpi/acpi_numa.h
+++ b/include/acpi/acpi_numa.h
@@ -13,7 +13,7 @@
extern int pxm_to_node(int);
extern int node_to_pxm(int);
-extern int __cpuinit acpi_map_pxm_to_node(int);
+extern int acpi_map_pxm_to_node(int);
extern void __cpuinit acpi_unmap_pxm_to_node(int);
#endif /* CONFIG_ACPI_NUMA */
--
1.5.2.146.gb75c6
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 8/8] ACPICA: Support for external package objects as method arguments
[not found] ` <6287ee32952b502c23d54f12895c3895ddbe5013.1180761191.git.len.brown@intel.com>
@ 2007-06-02 5:15 ` Len Brown
2007-06-04 22:25 ` Myron Stowe
1 sibling, 0 replies; 13+ messages in thread
From: Len Brown @ 2007-06-02 5:15 UTC (permalink / raw)
To: linux-acpi; +Cc: Bob Moore, Len Brown
From: Bob Moore <robert.moore@intel.com>
Implemented support to allow Package objects to be passed as
method arguments to the acpi_evaluate_object interface. Previously,
this would return an AE_NOT_IMPLEMENTED exception.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/utilities/utcopy.c | 120 +++++++++++++++---------------------
drivers/acpi/utilities/utobject.c | 42 +++++++++++++
include/acpi/acutils.h | 2 +
3 files changed, 94 insertions(+), 70 deletions(-)
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 4c1e008..879eaa1 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -68,6 +68,10 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *user_obj,
union acpi_operand_object **return_obj);
static acpi_status
+acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
+ union acpi_operand_object **internal_object);
+
+static acpi_status
acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
union acpi_operand_object *dest_desc);
@@ -518,77 +522,73 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
return_ACPI_STATUS(AE_NO_MEMORY);
}
-#ifdef ACPI_FUTURE_IMPLEMENTATION
-/* Code to convert packages that are parameters to control methods */
-
/*******************************************************************************
*
* FUNCTION: acpi_ut_copy_epackage_to_ipackage
*
- * PARAMETERS: *internal_object - Pointer to the object we are returning
- * *Buffer - Where the object is returned
- * *space_used - Where the length of the object is returned
+ * PARAMETERS: external_object - The external object to be converted
+ * internal_object - Where the internal object is returned
*
* RETURN: Status
*
- * DESCRIPTION: This function is called to place a package object in a user
- * buffer. A package object by definition contains other objects.
- *
- * The buffer is assumed to have sufficient space for the object.
- * The caller must have verified the buffer length needed using the
- * acpi_ut_get_object_size function before calling this function.
+ * DESCRIPTION: Copy an external package object to an internal package.
+ * Handles nested packages.
*
******************************************************************************/
static acpi_status
-acpi_ut_copy_epackage_to_ipackage(union acpi_operand_object *internal_object,
- u8 * buffer, u32 * space_used)
+acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
+ union acpi_operand_object **internal_object)
{
- u8 *free_space;
- union acpi_object *external_object;
- u32 length = 0;
- u32 this_index;
- u32 object_space = 0;
- union acpi_operand_object *this_internal_obj;
- union acpi_object *this_external_obj;
+ acpi_status status = AE_OK;
+ union acpi_operand_object *package_object;
+ union acpi_operand_object **package_elements;
+ acpi_native_uint i;
ACPI_FUNCTION_TRACE(ut_copy_epackage_to_ipackage);
- /*
- * First package at head of the buffer
- */
- external_object = (union acpi_object *)buffer;
+ /* Create the package object */
- /*
- * Free space begins right after the first package
- */
- free_space = buffer + sizeof(union acpi_object);
+ package_object =
+ acpi_ut_create_package_object(external_object->package.count);
+ if (!package_object) {
+ return_ACPI_STATUS(AE_NO_MEMORY);
+ }
- external_object->type = ACPI_GET_OBJECT_TYPE(internal_object);
- external_object->package.count = internal_object->package.count;
- external_object->package.elements = (union acpi_object *)free_space;
+ package_elements = package_object->package.elements;
/*
- * Build an array of ACPI_OBJECTS in the buffer
- * and move the free space past it
+ * Recursive implementation. Probably ok, since nested external packages
+ * as parameters should be very rare.
*/
- free_space +=
- external_object->package.count * sizeof(union acpi_object);
+ for (i = 0; i < external_object->package.count; i++) {
+ status =
+ acpi_ut_copy_eobject_to_iobject(&external_object->package.
+ elements[i],
+ &package_elements[i]);
+ if (ACPI_FAILURE(status)) {
- /* Call walk_package */
+ /* Truncate package and delete it */
-}
+ package_object->package.count = i;
+ package_elements[i] = NULL;
+ acpi_ut_remove_reference(package_object);
+ return_ACPI_STATUS(status);
+ }
+ }
-#endif /* Future implementation */
+ *internal_object = package_object;
+ return_ACPI_STATUS(status);
+}
/*******************************************************************************
*
* FUNCTION: acpi_ut_copy_eobject_to_iobject
*
- * PARAMETERS: *internal_object - The external object to be converted
- * *buffer_ptr - Where the internal object is returned
+ * PARAMETERS: external_object - The external object to be converted
+ * internal_object - Where the internal object is returned
*
- * RETURN: Status - the status of the call
+ * RETURN: Status - the status of the call
*
* DESCRIPTION: Converts an external object to an internal object.
*
@@ -603,16 +603,10 @@ acpi_ut_copy_eobject_to_iobject(union acpi_object *external_object,
ACPI_FUNCTION_TRACE(ut_copy_eobject_to_iobject);
if (external_object->type == ACPI_TYPE_PACKAGE) {
- /*
- * Packages as external input to control methods are not supported,
- */
- ACPI_ERROR((AE_INFO,
- "Packages as parameters not implemented!"));
-
- return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
- }
-
- else {
+ status =
+ acpi_ut_copy_epackage_to_ipackage(external_object,
+ internal_object);
+ } else {
/*
* Build a simple object (no nested objects)
*/
@@ -803,33 +797,19 @@ acpi_ut_copy_ielement_to_ielement(u8 object_type,
* Create and build the package object
*/
target_object =
- acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE);
+ acpi_ut_create_package_object(source_object->package.count);
if (!target_object) {
return (AE_NO_MEMORY);
}
- target_object->package.count = source_object->package.count;
target_object->common.flags = source_object->common.flags;
- /*
- * Create the object array
- */
- target_object->package.elements =
- ACPI_ALLOCATE_ZEROED(((acpi_size) source_object->package.
- count + 1) * sizeof(void *));
- if (!target_object->package.elements) {
- status = AE_NO_MEMORY;
- goto error_exit;
- }
+ /* Pass the new package object back to the package walk routine */
- /*
- * Pass the new package object back to the package walk routine
- */
state->pkg.this_target_obj = target_object;
- /*
- * Store the object pointer in the parent package object
- */
+ /* Store the object pointer in the parent package object */
+
*this_target_ptr = target_object;
break;
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index 4696124..db0b9ba 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -146,6 +146,48 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name,
/*******************************************************************************
*
+ * FUNCTION: acpi_ut_create_package_object
+ *
+ * PARAMETERS: Count - Number of package elements
+ *
+ * RETURN: Pointer to a new Package object, null on failure
+ *
+ * DESCRIPTION: Create a fully initialized package object
+ *
+ ******************************************************************************/
+
+union acpi_operand_object *acpi_ut_create_package_object(u32 count)
+{
+ union acpi_operand_object *package_desc;
+ union acpi_operand_object **package_elements;
+
+ ACPI_FUNCTION_TRACE_U32(ut_create_package_object, count);
+
+ /* Create a new Package object */
+
+ package_desc = acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE);
+ if (!package_desc) {
+ return_PTR(NULL);
+ }
+
+ /*
+ * Create the element array. Count+1 allows the array to be null
+ * terminated.
+ */
+ package_elements = ACPI_ALLOCATE_ZEROED((acpi_size)
+ (count + 1) * sizeof(void *));
+ if (!package_elements) {
+ ACPI_FREE(package_desc);
+ return_PTR(NULL);
+ }
+
+ package_desc->package.count = count;
+ package_desc->package.elements = package_elements;
+ return_PTR(package_desc);
+}
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_ut_create_buffer_object
*
* PARAMETERS: buffer_size - Size of buffer to be created
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index 15a8388..a87ef1c 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -390,6 +390,8 @@ void acpi_ut_delete_object_desc(union acpi_operand_object *object);
u8 acpi_ut_valid_internal_object(void *object);
+union acpi_operand_object *acpi_ut_create_package_object(u32 count);
+
union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size);
union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size);
--
1.5.2.146.gb75c6
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 2/8] ACPI: thermal: Replace pointer with name in trip_points
[not found] ` <68ccfaa8222f2a26f0689fad9e8c0c3f4c19f599.1180761191.git.len.brown@intel.com>
2007-06-02 5:15 ` [PATCH 2/8] ACPI: thermal: Replace pointer with name in trip_points Len Brown
@ 2007-06-04 16:30 ` Thomas Renninger
2007-06-18 4:38 ` Len Brown
1 sibling, 1 reply; 13+ messages in thread
From: Thomas Renninger @ 2007-06-04 16:30 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi
[-- 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");
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 8/8] ACPICA: Support for external package objects as method arguments
[not found] ` <6287ee32952b502c23d54f12895c3895ddbe5013.1180761191.git.len.brown@intel.com>
2007-06-02 5:15 ` [PATCH 8/8] ACPICA: Support for external package objects as method arguments Len Brown
@ 2007-06-04 22:25 ` Myron Stowe
2007-06-18 4:53 ` Len Brown
1 sibling, 1 reply; 13+ messages in thread
From: Myron Stowe @ 2007-06-04 22:25 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, Bob Moore
>From : Myron Stowe <myron.stowe@hp.com>
I believe there is an issue with the new 'package' argument type support
just submitted upstream.
In the routine acpi_ut_create_package_object(), if the
ACPI_ALLOCATE_ZEROED() fails then ACPI_FREE(package_desc) is called as
part of the cleanup. This should instead be
acpi_ut_remove_reference(package_desc) in order to remove the reference
acquired from acpi_ut_create_internal_object() [see the routine
acpi_ut_create_buffer_object() as an example of proper functionality].
This patch is against the Linux-ized ACPI CA, since I don't have a good
way to modify or test the original Intel version. I hope it's small
enough that you can easily make the corresponding change to the Intel
version.
This modification may be used under either the GPL or the BSD-style
license used for the Intel ACPI CA.
Signed-off-by: Myron Stowe < myron.stowe@hp.com>
--- a/drivers/acpi/utilities/utobject.c 2007-06-04 15:49:19.000000000 -0600
+++ b/drivers/acpi/utilities/utobject.c 2007-06-04 15:52:17.000000000 -0600
@@ -177,7 +177,7 @@
package_elements = ACPI_ALLOCATE_ZEROED((acpi_size)
(count + 1) * sizeof(void *));
if (!package_elements) {
- ACPI_FREE(package_desc);
+ acpi_ut_remove_reference(package_desc);
return_PTR(NULL);
}
--
Myron Stowe HP Open Source & Linux Org
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/8] ACPI: thermal: Replace pointer with name in trip_points
2007-06-04 16:30 ` Thomas Renninger
@ 2007-06-18 4:38 ` Len Brown
0 siblings, 0 replies; 13+ messages in thread
From: Len Brown @ 2007-06-18 4:38 UTC (permalink / raw)
To: trenn; +Cc: linux-acpi
On Monday 04 June 2007 12:30, Thomas Renninger wrote:
> 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.
You'd not get those messages if CONFIG_ACPI_DEBUG=n ;-)
>
> 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_printf() with "%4.4s", NULL) will simply print "<NUL",
so this is a potential cosmetic issue only.
-Len
> }
> 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");
> }
>
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 8/8] ACPICA: Support for external package objects as method arguments
2007-06-04 22:25 ` Myron Stowe
@ 2007-06-18 4:53 ` Len Brown
0 siblings, 0 replies; 13+ messages in thread
From: Len Brown @ 2007-06-18 4:53 UTC (permalink / raw)
To: Myron Stowe; +Cc: linux-acpi, Bob Moore
Applied.
thanks Myron!
-Len
On Monday 04 June 2007 18:25, Myron Stowe wrote:
> >From : Myron Stowe <myron.stowe@hp.com>
>
> I believe there is an issue with the new 'package' argument type support
> just submitted upstream.
>
> In the routine acpi_ut_create_package_object(), if the
> ACPI_ALLOCATE_ZEROED() fails then ACPI_FREE(package_desc) is called as
> part of the cleanup. This should instead be
> acpi_ut_remove_reference(package_desc) in order to remove the reference
> acquired from acpi_ut_create_internal_object() [see the routine
> acpi_ut_create_buffer_object() as an example of proper functionality].
>
> This patch is against the Linux-ized ACPI CA, since I don't have a good
> way to modify or test the original Intel version. I hope it's small
> enough that you can easily make the corresponding change to the Intel
> version.
>
> This modification may be used under either the GPL or the BSD-style
> license used for the Intel ACPI CA.
>
> Signed-off-by: Myron Stowe < myron.stowe@hp.com>
>
> --- a/drivers/acpi/utilities/utobject.c 2007-06-04 15:49:19.000000000 -0600
> +++ b/drivers/acpi/utilities/utobject.c 2007-06-04 15:52:17.000000000 -0600
> @@ -177,7 +177,7 @@
> package_elements = ACPI_ALLOCATE_ZEROED((acpi_size)
> (count + 1) * sizeof(void *));
> if (!package_elements) {
> - ACPI_FREE(package_desc);
> + acpi_ut_remove_reference(package_desc);
> return_PTR(NULL);
> }
>
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-06-18 4:53 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-02 5:15 ACPI patches for 2.6.22-rc3 Len Brown
[not found] ` <0efabac9b7c8535eeb199d2f16d3eb44dc4761b2.1180761191.git.len.brown@intel.com>
2007-06-02 5:15 ` [PATCH 1/8] ACPICA: allow Load(OEMx) tables Len Brown
[not found] ` <ae00d812436dc968f4a5dea7757b6a94910b6dc4.1180761191.git.len.brown@intel.com>
2007-06-02 5:15 ` [PATCH 3/8] ACPI: extend "acpi_osi=" boot option Len Brown
[not found] ` <f507654d450d329c81a70eec0096d5dfe67802ec.1180761191.git.len.brown@intel.com>
2007-06-02 5:15 ` [PATCH 4/8] ACPI: Make _OSI(Linux) a special case Len Brown
[not found] ` <dd272b5716a54afa33a69f2241284d8ec60b7892.1180761191.git.len.brown@intel.com>
2007-06-02 5:15 ` [PATCH 5/8] ACPI: add __init to acpi_initialize_subsystem() Len Brown
[not found] ` <cc4c24e115ca7bc2e4ec74d70bcb8fda1d1a8df8.1180761191.git.len.brown@intel.com>
2007-06-02 5:15 ` [PATCH 6/8] ACPI: thinkpad-acpi: do not use named sysfs groups Len Brown
[not found] ` <8ff6f48d99a0351bcc9ceab422042ef9d3bad9aa.1180761191.git.len.brown@intel.com>
2007-06-02 5:15 ` [PATCH 7/8] ACPI: Section mismatch ... acpi_map_pxm_to_node Len Brown
[not found] ` <68ccfaa8222f2a26f0689fad9e8c0c3f4c19f599.1180761191.git.len.brown@intel.com>
2007-06-02 5:15 ` [PATCH 2/8] ACPI: thermal: Replace pointer with name in trip_points Len Brown
2007-06-04 16:30 ` Thomas Renninger
2007-06-18 4:38 ` Len Brown
[not found] ` <6287ee32952b502c23d54f12895c3895ddbe5013.1180761191.git.len.brown@intel.com>
2007-06-02 5:15 ` [PATCH 8/8] ACPICA: Support for external package objects as method arguments Len Brown
2007-06-04 22:25 ` Myron Stowe
2007-06-18 4:53 ` Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).