dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/drivers/input/keyboard
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
..
Kconfig [PATCH] m68k/HP300: Enable HIL configuration options 2006-10-09 14:54:45 -07:00
Makefile Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2006-10-02 08:20:33 -07:00
amikbd.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
atkbd.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
corgikbd.c [ARM] Fix Zaurii keyboard/touchscreen drivers 2006-10-15 13:50:02 +01:00
hil_kbd.c Build fixes for struct pt_regs removal 2006-10-06 20:47:23 -06:00
hilkbd.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
hpps2atkbd.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
lkkbd.c lkkbd: Remove my old snail-mail address 2006-11-17 10:32:04 +01:00
locomokbd.c [ARM] Fix Zaurii keyboard/touchscreen drivers 2006-10-15 13:50:02 +01:00
maple_keyb.c [PATCH] drivers/input/keyboard: convert to dynamic input_dev allocation 2005-10-28 09:52:52 -07:00
newtonkbd.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
omap-keypad.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
spitzkbd.c [ARM] Fix Zaurii keyboard/touchscreen drivers 2006-10-15 13:50:02 +01:00
stowaway.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
sunkbd.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
xtkbd.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00