original_kernel/drivers/acpi
David Howells 65f27f3844 WorkStruct: Pass the work_struct pointer instead of context data
Pass the work_struct pointer to the work function rather than context data.
The work function can use container_of() to work out the data.

For the cases where the container of the work_struct may go away the moment the
pending bit is cleared, it is made possible to defer the release of the
structure by deferring the clearing of the pending bit.

To make this work, an extra flag is introduced into the management side of the
work_struct.  This governs auto-release of the structure upon execution.

Ordinarily, the work queue executor would release the work_struct for further
scheduling or deallocation by clearing the pending bit prior to jumping to the
work function.  This means that, unless the driver makes some guarantee itself
that the work_struct won't go away, the work function may not access anything
else in the work_struct or its container lest they be deallocated..  This is a
problem if the auxiliary data is taken away (as done by the last patch).

However, if the pending bit is *not* cleared before jumping to the work
function, then the work function *may* access the work_struct and its container
with no problems.  But then the work function must itself release the
work_struct by calling work_release().

In most cases, automatic release is fine, so this is the default.  Special
initiators exist for the non-auto-release case (ending in _NAR).


Signed-Off-By: David Howells <dhowells@redhat.com>
2006-11-22 14:55:48 +00:00
..
dispatcher
events Pull bugzilla-5534 into test branch 2006-10-14 02:26:42 -04:00
executer
hardware ACPI: Allow setting SCI_EN bit in PM1_CONTROL register 2006-10-10 17:14:44 -07:00
namespace
parser
resources
sleep
tables ACPI: fix printk format warnings 2006-10-14 01:59:46 -04:00
utilities
Kconfig fix drivers/acpi/Kconfig typos 2006-10-03 22:24:43 +02:00
Makefile
ac.c ACPI: fix boot with acpi=off 2006-08-15 23:16:43 -04:00
acpi_memhotplug.c [PATCH] acpi memory hotplug: remove strange add_memory fail message 2006-10-20 10:26:38 -07:00
asus_acpi.c ACPI: asus_acpi: don't printk on writing garbage to proc files 2006-10-14 02:03:49 -04:00
battery.c ACPI: check battery status on resume for un/plug events during sleep 2006-10-14 02:22:51 -04:00
blacklist.c
bus.c ACPI: add message if firmware_register() init fails 2006-08-15 23:27:38 -04:00
button.c
cm_sbs.c [PATCH] acpi NULL noise removal 2006-10-10 15:37:22 -07:00
container.c
debug.c
dock.c
ec.c ACPI: EC: export ec_transaction() for msi-laptop driver 2006-10-14 00:49:56 -04:00
event.c
fan.c
glue.c
hotkey.c ACPI: hotkey.c fixes, fix for potential crash of hotkey.c 2006-08-16 18:08:06 -04:00
i2c_ec.c i2c: Constify i2c_algorithm declarations, part 2 2006-09-26 15:38:52 -07:00
i2c_ec.h
ibm_acpi.c ACPI: ibm_acpi: Remove experimental status for brightness and volume. 2006-10-14 00:32:22 -04:00
motherboard.c ACPI: update comments in motherboard.c 2006-10-14 01:56:27 -04:00
numa.c
osl.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
pci_bind.c
pci_irq.c
pci_link.c ACPI: acpi_pci_link_set() can allocate with either GFP_ATOMIC or GFP_KERNEL 2006-10-14 01:54:21 -04:00
pci_root.c
power.c ACPI: fix potential OOPS in power driver with CONFIG_ACPI_DEBUG 2006-10-14 01:54:21 -04:00
processor_core.c ACPI: fix section for CPU init functions 2006-10-14 01:58:38 -04:00
processor_idle.c [PATCH] fix "ACPI: Processor native C-states using MWAIT" 2006-10-20 10:26:37 -07:00
processor_perflib.c
processor_thermal.c
processor_throttling.c
sbs.c ACPI: sbs: fix module_param() initializers 2006-10-14 00:34:00 -04:00
scan.c ACPI: verbose on kset/kobject_register errors 2006-08-15 23:32:24 -04:00
system.c
tables.c
thermal.c
toshiba_acpi.c
utils.c ACPI: avoid irqrouter_resume might_sleep oops on resume from S4 2006-08-16 19:23:00 -04:00
video.c