android_kernel_xiaomi_sm7250/drivers/pci
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
..
hotplug acpiphp: fix latch status 2006-10-27 11:20:32 -07:00
pcie WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
.gitignore Add some basic .gitignore files 2005-10-18 08:26:15 -07:00
access.c [PATCH] PCI: drivers/pci/: small cleanups 2005-11-10 16:09:18 -08:00
bus.c PCI: fix __must_check warnings 2006-09-26 17:43:53 -07:00
hotplug.c [PATCH] driver core: replace "hotplug" by "uevent" 2006-01-04 16:18:08 -08:00
htirq.c [PATCH] htirq: allow buggy drivers of buggy hardware to write the registers 2006-11-08 18:29:25 -08:00
Kconfig PCI: Let PCI_MULTITHREAD_PROBE depend on BROKEN 2006-11-03 11:49:04 -08:00
Makefile [PATCH] htirq: tidy up the htirq code 2006-10-04 07:55:30 -07:00
msi.c PCI: Improve pci_msi_supported() comments 2006-10-18 11:36:11 -07:00
msi.h [PATCH] msi: refactor and move the msi irq_chip into the arch code 2006-10-04 07:55:29 -07:00
pci-acpi.c [PATCH] PCI ACPI: Rename the functions to avoid multiple instances. 2006-06-21 11:59:59 -07:00
pci-driver.c PCI: reset pci device state to unknown state for resume 2006-10-27 11:20:33 -07:00
pci-sysfs.c [PATCH] pci: don't try to remove sysfs files before they are setup. 2006-11-13 07:40:42 -08:00
pci.c PCI: Restore PCI Express capability registers after PM event 2006-09-26 17:43:53 -07:00
pci.h MSI: Cleanup existing MSI quirks 2006-09-26 17:43:52 -07:00
probe.c PCI: optionally sort device lists breadth-first 2006-10-18 11:36:12 -07:00
proc.c [PATCH] 64bit resource: change pci core and arch code to use resource_size_t 2006-06-27 09:24:00 -07:00
quirks.c [PATCH] revert "PCI: quirk for IBM Dock II cardbus controllers" 2006-11-14 09:09:27 -08:00
remove.c PCI: add pci_stop_bus_device 2006-09-26 17:43:54 -07:00
rom.c PCI: fix pci_fixup_video as it blows up on sparc64 2006-10-27 11:20:33 -07:00
search.c pci: Additional search functions 2006-10-18 11:36:12 -07:00
setup-bus.c [PATCH] fix "PCI: assign ioapic resource at hotplug" 2006-10-04 07:55:14 -07:00
setup-irq.c
setup-res.c [PATCH] 64bit resource: change pci core and arch code to use resource_size_t 2006-06-27 09:24:00 -07:00
syscall.c [PATCH] PCI: Block config access during BIST 2005-10-28 15:36:58 -07:00