diff options
author | Zhang Rui <rui.zhang@intel.com> | 2008-04-10 11:06:44 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-22 23:01:36 -0400 |
commit | 514d18d79b1da052ed4553ceec1f7e1197a5bb51 (patch) | |
tree | b474e49f1614e73a2b7ad671b56c89c5e875d89a /drivers/acpi | |
parent | 66d3ca9ea28e1b3d591083772fd797b9b46410b8 (diff) |
ACPICA: Update for new Notify values
Implemented several changes for Notify handling: Added support
for new Notify values (ACPI 2.0+) and improved the Notify debug
output. Notify on PowerResource objects is no longer allowed,
as per the ACPI specification.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/events/evmisc.c | 59 | ||||
-rw-r--r-- | drivers/acpi/utilities/utglobal.c | 42 |
2 files changed, 65 insertions, 36 deletions
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c index 4e7a13afe80c..16cf2700c16f 100644 --- a/drivers/acpi/events/evmisc.c +++ b/drivers/acpi/events/evmisc.c | |||
@@ -49,22 +49,7 @@ | |||
49 | #define _COMPONENT ACPI_EVENTS | 49 | #define _COMPONENT ACPI_EVENTS |
50 | ACPI_MODULE_NAME("evmisc") | 50 | ACPI_MODULE_NAME("evmisc") |
51 | 51 | ||
52 | /* Names for Notify() values, used for debug output */ | ||
53 | #ifdef ACPI_DEBUG_OUTPUT | ||
54 | static const char *acpi_notify_value_names[] = { | ||
55 | "Bus Check", | ||
56 | "Device Check", | ||
57 | "Device Wake", | ||
58 | "Eject Request", | ||
59 | "Device Check Light", | ||
60 | "Frequency Mismatch", | ||
61 | "Bus Mode Mismatch", | ||
62 | "Power Fault" | ||
63 | }; | ||
64 | #endif | ||
65 | |||
66 | /* Pointer to FACS needed for the Global Lock */ | 52 | /* Pointer to FACS needed for the Global Lock */ |
67 | |||
68 | static struct acpi_table_facs *facs = NULL; | 53 | static struct acpi_table_facs *facs = NULL; |
69 | 54 | ||
70 | /* Local prototypes */ | 55 | /* Local prototypes */ |
@@ -94,7 +79,6 @@ u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node) | |||
94 | switch (node->type) { | 79 | switch (node->type) { |
95 | case ACPI_TYPE_DEVICE: | 80 | case ACPI_TYPE_DEVICE: |
96 | case ACPI_TYPE_PROCESSOR: | 81 | case ACPI_TYPE_PROCESSOR: |
97 | case ACPI_TYPE_POWER: | ||
98 | case ACPI_TYPE_THERMAL: | 82 | case ACPI_TYPE_THERMAL: |
99 | /* | 83 | /* |
100 | * These are the ONLY objects that can receive ACPI notifications | 84 | * These are the ONLY objects that can receive ACPI notifications |
@@ -139,17 +123,9 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
139 | * initiate soft-off or sleep operation? | 123 | * initiate soft-off or sleep operation? |
140 | */ | 124 | */ |
141 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 125 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
142 | "Dispatching Notify(%X) on node %p\n", notify_value, | 126 | "Dispatching Notify on [%4.4s] Node %p Value 0x%2.2X (%s)\n", |
143 | node)); | 127 | acpi_ut_get_node_name(node), node, notify_value, |
144 | 128 | acpi_ut_get_notify_name(notify_value))); | |
145 | if (notify_value <= 7) { | ||
146 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Notify value: %s\n", | ||
147 | acpi_notify_value_names[notify_value])); | ||
148 | } else { | ||
149 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
150 | "Notify value: 0x%2.2X **Device Specific**\n", | ||
151 | notify_value)); | ||
152 | } | ||
153 | 129 | ||
154 | /* Get the notify object attached to the NS Node */ | 130 | /* Get the notify object attached to the NS Node */ |
155 | 131 | ||
@@ -159,10 +135,12 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
159 | /* We have the notify object, Get the right handler */ | 135 | /* We have the notify object, Get the right handler */ |
160 | 136 | ||
161 | switch (node->type) { | 137 | switch (node->type) { |
138 | |||
139 | /* Notify allowed only on these types */ | ||
140 | |||
162 | case ACPI_TYPE_DEVICE: | 141 | case ACPI_TYPE_DEVICE: |
163 | case ACPI_TYPE_THERMAL: | 142 | case ACPI_TYPE_THERMAL: |
164 | case ACPI_TYPE_PROCESSOR: | 143 | case ACPI_TYPE_PROCESSOR: |
165 | case ACPI_TYPE_POWER: | ||
166 | 144 | ||
167 | if (notify_value <= ACPI_MAX_SYS_NOTIFY) { | 145 | if (notify_value <= ACPI_MAX_SYS_NOTIFY) { |
168 | handler_obj = | 146 | handler_obj = |
@@ -179,8 +157,13 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
179 | } | 157 | } |
180 | } | 158 | } |
181 | 159 | ||
182 | /* If there is any handler to run, schedule the dispatcher */ | 160 | /* |
183 | 161 | * If there is any handler to run, schedule the dispatcher. | |
162 | * Check for: | ||
163 | * 1) Global system notify handler | ||
164 | * 2) Global device notify handler | ||
165 | * 3) Per-device notify handler | ||
166 | */ | ||
184 | if ((acpi_gbl_system_notify.handler | 167 | if ((acpi_gbl_system_notify.handler |
185 | && (notify_value <= ACPI_MAX_SYS_NOTIFY)) | 168 | && (notify_value <= ACPI_MAX_SYS_NOTIFY)) |
186 | || (acpi_gbl_device_notify.handler | 169 | || (acpi_gbl_device_notify.handler |
@@ -190,6 +173,13 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
190 | return (AE_NO_MEMORY); | 173 | return (AE_NO_MEMORY); |
191 | } | 174 | } |
192 | 175 | ||
176 | if (!handler_obj) { | ||
177 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
178 | "Executing system notify handler for Notify (%4.4s, %X) node %p\n", | ||
179 | acpi_ut_get_node_name(node), | ||
180 | notify_value, node)); | ||
181 | } | ||
182 | |||
193 | notify_info->common.descriptor_type = | 183 | notify_info->common.descriptor_type = |
194 | ACPI_DESC_TYPE_STATE_NOTIFY; | 184 | ACPI_DESC_TYPE_STATE_NOTIFY; |
195 | notify_info->notify.node = node; | 185 | notify_info->notify.node = node; |
@@ -202,15 +192,12 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
202 | if (ACPI_FAILURE(status)) { | 192 | if (ACPI_FAILURE(status)) { |
203 | acpi_ut_delete_generic_state(notify_info); | 193 | acpi_ut_delete_generic_state(notify_info); |
204 | } | 194 | } |
205 | } | 195 | } else { |
206 | |||
207 | if (!handler_obj) { | ||
208 | /* | 196 | /* |
209 | * There is no per-device notify handler for this device. | 197 | * There is no notify handler (per-device or system) for this device. |
210 | * This may or may not be a problem. | ||
211 | */ | 198 | */ |
212 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 199 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
213 | "No notify handler for Notify(%4.4s, %X) node %p\n", | 200 | "No notify handler for Notify (%4.4s, %X) node %p\n", |
214 | acpi_ut_get_node_name(node), notify_value, | 201 | acpi_ut_get_node_name(node), notify_value, |
215 | node)); | 202 | node)); |
216 | } | 203 | } |
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c index d2097ded262d..d0226fedb004 100644 --- a/drivers/acpi/utilities/utglobal.c +++ b/drivers/acpi/utilities/utglobal.c | |||
@@ -602,6 +602,48 @@ char *acpi_ut_get_mutex_name(u32 mutex_id) | |||
602 | 602 | ||
603 | return (acpi_gbl_mutex_names[mutex_id]); | 603 | return (acpi_gbl_mutex_names[mutex_id]); |
604 | } | 604 | } |
605 | |||
606 | /******************************************************************************* | ||
607 | * | ||
608 | * FUNCTION: acpi_ut_get_notify_name | ||
609 | * | ||
610 | * PARAMETERS: notify_value - Value from the Notify() request | ||
611 | * | ||
612 | * RETURN: String corresponding to the Notify Value. | ||
613 | * | ||
614 | * DESCRIPTION: Translate a Notify Value to a notify namestring. | ||
615 | * | ||
616 | ******************************************************************************/ | ||
617 | |||
618 | /* Names for Notify() values, used for debug output */ | ||
619 | |||
620 | static const char *acpi_gbl_notify_value_names[] = { | ||
621 | "Bus Check", | ||
622 | "Device Check", | ||
623 | "Device Wake", | ||
624 | "Eject Request", | ||
625 | "Device Check Light", | ||
626 | "Frequency Mismatch", | ||
627 | "Bus Mode Mismatch", | ||
628 | "Power Fault", | ||
629 | "Capabilities Check", | ||
630 | "Device PLD Check", | ||
631 | "Reserved", | ||
632 | "System Locality Update" | ||
633 | }; | ||
634 | |||
635 | const char *acpi_ut_get_notify_name(u32 notify_value) | ||
636 | { | ||
637 | |||
638 | if (notify_value <= ACPI_NOTIFY_MAX) { | ||
639 | return (acpi_gbl_notify_value_names[notify_value]); | ||
640 | } else if (notify_value <= ACPI_MAX_SYS_NOTIFY) { | ||
641 | return ("Reserved"); | ||
642 | } else { /* Greater or equal to 0x80 */ | ||
643 | |||
644 | return ("**Device Specific**"); | ||
645 | } | ||
646 | } | ||
605 | #endif | 647 | #endif |
606 | 648 | ||
607 | /******************************************************************************* | 649 | /******************************************************************************* |