From 4d2acd9ea539e0f59178b126f6750ccc41eefcdd Mon Sep 17 00:00:00 2001 From: Len Brown Date: Wed, 9 May 2007 22:56:38 -0400 Subject: Revert "ACPICA: revert "acpi_serialize" changes" This reverts commit a8f4af6dc6600980885c594f52eecd60edd62013. Thus restoring ACPICA's new acpi_serialize code. This commit by itself may cause a regression, but it is reverted in this order so that subsequent reverts reverts under this one can be made without conflict. Signed-off-by: Len Brown --- include/acpi/acinterp.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h index 4409830..73967c8 100644 --- a/include/acpi/acinterp.h +++ b/include/acpi/acinterp.h @@ -446,10 +446,14 @@ acpi_ex_copy_integer_to_buffer_field(union acpi_operand_object *source_desc, /* * exutils - interpreter/scanner utilities */ -acpi_status acpi_ex_enter_interpreter(void); +void acpi_ex_enter_interpreter(void); void acpi_ex_exit_interpreter(void); +void acpi_ex_reacquire_interpreter(void); + +void acpi_ex_relinquish_interpreter(void); + void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc); u8 acpi_ex_acquire_global_lock(u32 rule); -- cgit v1.1 From 262a7a28de060f3a63cae20035876d6f22fd7670 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Wed, 9 May 2007 23:01:59 -0400 Subject: Revert "ACPICA: fix AML mutex re-entrancy" This reverts commit c0d127b56937c3e72c2b1819161d2f6718eee877. These changes to AML locking were made to allow Notify handlers to be called on the stack and not deadlock. However, that scheme turns out to be flawed and was reverted by the previous commit, so this commit restores the locking to it previous design. Signed-off-by: Len Brown --- include/acpi/acinterp.h | 3 +-- include/acpi/acobject.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h index 73967c8..ce7c9d6 100644 --- a/include/acpi/acinterp.h +++ b/include/acpi/acinterp.h @@ -253,8 +253,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread); -void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc, - struct acpi_thread_state *thread); +void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc); /* * exprep - ACPI AML execution - prep utilities diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index 5206d61..04e9735 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h @@ -155,7 +155,7 @@ struct acpi_object_event { struct acpi_object_mutex { ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ u16 acquisition_depth; /* Allow multiple Acquires, same thread */ - acpi_thread_id owner_thread_id; /* Current owner of the mutex */ + struct acpi_thread_state *owner_thread; /* Current owner of the mutex */ acpi_mutex os_mutex; /* Actual OS synchronization object */ union acpi_operand_object *prev; /* Link for list of acquired mutexes */ union acpi_operand_object *next; /* Link for list of acquired mutexes */ -- cgit v1.1 From fd3509436fde38d4c854bf5a6b83d2c779904f8e Mon Sep 17 00:00:00 2001 From: Len Brown Date: Wed, 9 May 2007 23:34:35 -0400 Subject: ACPICA: Lindent Signed-off-by: Len Brown --- include/acpi/acdispat.h | 9 +++------ include/acpi/acglobal.h | 2 +- include/acpi/aclocal.h | 2 +- include/acpi/acnamesp.h | 6 ++---- include/acpi/acobject.h | 2 +- include/acpi/acpi_bus.h | 9 +++++---- include/acpi/acpi_drivers.h | 6 ++++-- include/acpi/acpi_numa.h | 2 +- include/acpi/acpiosxf.h | 3 ++- include/acpi/actypes.h | 2 +- include/acpi/acutils.h | 3 ++- include/acpi/platform/aclinux.h | 21 ++++++++++++++------- include/acpi/processor.h | 18 +++++++++++------- 13 files changed, 48 insertions(+), 37 deletions(-) (limited to 'include') diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index cb8d286..7f690bb 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h @@ -290,12 +290,9 @@ acpi_ds_obj_stack_push(void *object, struct acpi_walk_state *walk_state); acpi_status acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state *walk_state); -struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, - union acpi_parse_object - *origin, - union acpi_operand_object - *mth_desc, - struct acpi_thread_state +struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, union acpi_parse_object + *origin, union acpi_operand_object + *mth_desc, struct acpi_thread_state *thread); acpi_status diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index 24c3f05..347a911 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h @@ -319,7 +319,7 @@ ACPI_EXTERN struct acpi_fixed_event_handler acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]; ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; ACPI_EXTERN struct acpi_gpe_block_info - *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; +*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; /***************************************************************************** * diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 6f83ddb..202cd42 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -630,7 +630,7 @@ ACPI_PARSE_COMMON}; * and bytelists. */ struct acpi_parse_obj_named { - ACPI_PARSE_COMMON u8 * path; + ACPI_PARSE_COMMON u8 *path; u8 *data; /* AML body or bytelist data */ u32 length; /* AML length */ u32 name; /* 4-byte name or zero if no name */ diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h index 535b7e1..5ef38a6 100644 --- a/include/acpi/acnamesp.h +++ b/include/acpi/acnamesp.h @@ -100,10 +100,8 @@ acpi_ns_walk_namespace(acpi_object_type type, acpi_walk_callback user_function, void *context, void **return_value); -struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, - struct acpi_namespace_node - *parent, - struct acpi_namespace_node +struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct acpi_namespace_node + *parent, struct acpi_namespace_node *child); /* diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index 04e9735..7e1211a 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h @@ -216,7 +216,7 @@ struct acpi_object_processor { /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */ u8 proc_id; u8 length; - ACPI_COMMON_NOTIFY_INFO acpi_io_address address; + ACPI_COMMON_NOTIFY_INFO acpi_io_address address; }; struct acpi_object_thermal_zone { diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 9cfd5b1..c6fa5e0 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -91,7 +91,8 @@ typedef int (*acpi_op_remove) (struct acpi_device * device, int type); typedef int (*acpi_op_lock) (struct acpi_device * device, int type); typedef int (*acpi_op_start) (struct acpi_device * device); typedef int (*acpi_op_stop) (struct acpi_device * device, int type); -typedef int (*acpi_op_suspend) (struct acpi_device * device, pm_message_t state); +typedef int (*acpi_op_suspend) (struct acpi_device * device, + pm_message_t state); typedef int (*acpi_op_resume) (struct acpi_device * device); typedef int (*acpi_op_scan) (struct acpi_device * device); typedef int (*acpi_op_bind) (struct acpi_device * device); @@ -296,7 +297,7 @@ struct acpi_device { void *driver_data; struct device dev; struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */ - enum acpi_bus_removal_type removal_type; /* indicate for different removal type */ + enum acpi_bus_removal_type removal_type; /* indicate for different removal type */ }; #define acpi_driver_data(d) ((d)->driver_data) @@ -338,7 +339,7 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, acpi_handle handle, int type); int acpi_bus_trim(struct acpi_device *start, int rmdevice); int acpi_bus_start(struct acpi_device *device); -acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd); +acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); int acpi_match_ids(struct acpi_device *device, char *ids); int acpi_create_dir(struct acpi_device *); void acpi_remove_dir(struct acpi_device *); @@ -363,6 +364,6 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer); acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) -#endif /* CONFIG_ACPI */ +#endif /* CONFIG_ACPI */ #endif /*__ACPI_BUS_H__*/ diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index f6275b0..5535159 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -113,7 +113,8 @@ extern int is_dock_device(acpi_handle handle); extern int register_dock_notifier(struct notifier_block *nb); extern void unregister_dock_notifier(struct notifier_block *nb); extern int register_hotplug_dock_device(acpi_handle handle, - acpi_notify_handler handler, void *context); + acpi_notify_handler handler, + void *context); extern void unregister_hotplug_dock_device(acpi_handle handle); #else static inline int is_dock_device(acpi_handle handle) @@ -128,7 +129,8 @@ static inline void unregister_dock_notifier(struct notifier_block *nb) { } static inline int register_hotplug_dock_device(acpi_handle handle, - acpi_notify_handler handler, void *context) + acpi_notify_handler handler, + void *context) { return -ENODEV; } diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h index 1049f2a..f9d2bde 100644 --- a/include/acpi/acpi_numa.h +++ b/include/acpi/acpi_numa.h @@ -8,7 +8,7 @@ #if MAX_NUMNODES > 256 #define MAX_PXM_DOMAINS MAX_NUMNODES #else -#define MAX_PXM_DOMAINS (256) /* Old pxm spec is defined 8 bit */ +#define MAX_PXM_DOMAINS (256) /* Old pxm spec is defined 8 bit */ #endif extern int __cpuinitdata pxm_to_node_map[MAX_PXM_DOMAINS]; diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 2785058..5e07db0 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -143,7 +143,8 @@ void acpi_os_release_mutex(acpi_mutex handle); */ void *acpi_os_allocate(acpi_size size); -void __iomem *acpi_os_map_memory(acpi_physical_address where, acpi_native_uint length); +void __iomem *acpi_os_map_memory(acpi_physical_address where, + acpi_native_uint length); void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 56bf492..fe8abc2 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -344,7 +344,7 @@ typedef u32 acpi_integer; /* 64-bit integers */ -typedef unsigned long long acpi_integer; +typedef unsigned long long acpi_integer; #define ACPI_INTEGER_MAX ACPI_UINT64_MAX #define ACPI_INTEGER_BIT_SIZE 64 #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 883ffe9..15a8388 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -498,7 +498,8 @@ acpi_ut_display_init_pathname(u8 type, acpi_status acpi_ut_walk_aml_resources(u8 * aml, acpi_size aml_length, - acpi_walk_aml_callback user_function, void **context); + acpi_walk_aml_callback user_function, + void **context); acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index); diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 5f532d2..a568717 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -103,7 +103,10 @@ #define acpi_thread_id struct task_struct * -static inline acpi_thread_id acpi_os_get_thread_id(void) { return current; } +static inline acpi_thread_id acpi_os_get_thread_id(void) +{ + return current; +} /* * The irqs_disabled() check is for resume from RAM. @@ -112,15 +115,19 @@ static inline acpi_thread_id acpi_os_get_thread_id(void) { return current; } * to quiet __might_sleep() in kmalloc() and resume does not. */ #include -static inline void *acpi_os_allocate(acpi_size size) { - return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); +static inline void *acpi_os_allocate(acpi_size size) +{ + return kmalloc(size, irqs_disabled()? GFP_ATOMIC : GFP_KERNEL); } -static inline void *acpi_os_allocate_zeroed(acpi_size size) { - return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); +static inline void *acpi_os_allocate_zeroed(acpi_size size) +{ + return kzalloc(size, irqs_disabled()? GFP_ATOMIC : GFP_KERNEL); } -static inline void *acpi_os_acquire_object(acpi_cache_t * cache) { - return kmem_cache_zalloc(cache, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); +static inline void *acpi_os_acquire_object(acpi_cache_t * cache) +{ + return kmem_cache_zalloc(cache, + irqs_disabled()? GFP_ATOMIC : GFP_KERNEL); } #define ACPI_ALLOCATE(a) acpi_os_allocate(a) diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 916c010..b4b0ffd 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -18,7 +18,7 @@ #define ACPI_PDC_REVISION_ID 0x1 -#define ACPI_PSD_REV0_REVISION 0 /* Support for _PSD as in ACPI 3.0 */ +#define ACPI_PSD_REV0_REVISION 0 /* Support for _PSD as in ACPI 3.0 */ #define ACPI_PSD_REV0_ENTRIES 5 /* @@ -189,8 +189,9 @@ struct acpi_processor_errata { } piix4; }; -extern int acpi_processor_preregister_performance( - struct acpi_processor_performance **performance); +extern int acpi_processor_preregister_performance(struct + acpi_processor_performance + **performance); extern int acpi_processor_register_performance(struct acpi_processor_performance *performance, unsigned int cpu); @@ -213,7 +214,8 @@ void arch_acpi_processor_init_pdc(struct acpi_processor *pr); void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, unsigned int cpu); int acpi_processor_ffh_cstate_probe(unsigned int cpu, - struct acpi_processor_cx *cx, struct acpi_power_register *reg); + struct acpi_processor_cx *cx, + struct acpi_power_register *reg); void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx *cstate); #else static inline void acpi_processor_power_init_bm_check(struct @@ -224,12 +226,14 @@ static inline void acpi_processor_power_init_bm_check(struct return; } static inline int acpi_processor_ffh_cstate_probe(unsigned int cpu, - struct acpi_processor_cx *cx, struct acpi_power_register *reg) + struct acpi_processor_cx *cx, + struct acpi_power_register + *reg) { return -1; } -static inline void acpi_processor_ffh_cstate_enter( - struct acpi_processor_cx *cstate) +static inline void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx + *cstate) { return; } -- cgit v1.1 From 00eb43a1897a8845d0edb198cec69ac5f1f299dd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 4 May 2007 14:16:19 +0200 Subject: acpi,msi-laptop: Fall back to EC polling mode for MSI laptop specific EC commands The ACPI EC that is used in MSI laptops knows some non-standard commands for changing the screen brighntess and a few other things, which are used by the msi-laptop.c driver. Unfortunately for these commands no GPE events for IBF and OBF are triggered. Since nowadays the EC code uses the ec_intr=1 mode by default, this causes these operations to timeout, although they don't fail. In result, all operations that you can do with the msi-laptop.c driver take more or less 1s to complete, which is awfully slow. In one of the more recent kernels (2.6.20?) the EC subsystem has been revamped. With that change the EC timeout has been increased. before that increase the MSI EC accesses were slow -- but not *that* slow, hence I took notice of this limitation of the MSI EC hardware only very recently. The standard EC operations on the MSI EC as defined in the ACPI spec support GPE events properly. The following patch adds a new argument "force_poll" to the ec_transaction() function (and friends). If set to 1, the function will poll for IBF/OBF even if ec_intr=1 is enabled. If set to 0 the current behaviour is used. The msi-laptop driver is modified to make use of this new flag, so that OBF/IBF is polled for the special MSI EC transactions -- but only for them. Signed-off-by: Lennart Poettering Acked-by: Alexey Starikovskiy Signed-off-by: Len Brown --- include/linux/acpi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 8bcfaa4..fccd8b5 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -182,7 +182,8 @@ extern int ec_read(u8 addr, u8 *val); extern int ec_write(u8 addr, u8 val); extern int ec_transaction(u8 command, const u8 *wdata, unsigned wdata_len, - u8 *rdata, unsigned rdata_len); + u8 *rdata, unsigned rdata_len, + int force_poll); #endif /*CONFIG_ACPI_EC*/ -- cgit v1.1