linux-stable/drivers
Bjorn Helgaas 1f32ca31e7 PNP: convert resource options to single linked list
ISAPNP, PNPBIOS, and ACPI describe the "possible resource settings" of
a device, i.e., the possibilities an OS bus driver has when it assigns
I/O port, MMIO, and other resources to the device.

PNP used to maintain this "possible resource setting" information in
one independent option structure and a list of dependent option
structures for each device.  Each of these option structures had lists
of I/O, memory, IRQ, and DMA resources, for example:

  dev
    independent options
      ind-io0  -> ind-io1  ...
      ind-mem0 -> ind-mem1 ...
      ...
    dependent option set 0
      dep0-io0  -> dep0-io1  ...
      dep0-mem0 -> dep0-mem1 ...
      ...
    dependent option set 1
      dep1-io0  -> dep1-io1  ...
      dep1-mem0 -> dep1-mem1 ...
      ...
    ...

This data structure was designed for ISAPNP, where the OS configures
device resource settings by writing directly to configuration
registers.  The OS can write the registers in arbitrary order much
like it writes PCI BARs.

However, for PNPBIOS and ACPI devices, the OS uses firmware interfaces
that perform device configuration, and it is important to pass the
desired settings to those interfaces in the correct order.  The OS
learns the correct order by using firmware interfaces that return the
"current resource settings" and "possible resource settings," but the
option structures above doesn't store the ordering information.

This patch replaces the independent and dependent lists with a single
list of options.  For example, a device might have possible resource
settings like this:

  dev
    options
      ind-io0 -> dep0-io0 -> dep1->io0 -> ind-io1 ...

All the possible settings are in the same list, in the order they
come from the firmware "possible resource settings" list.  Each entry
is tagged with an independent/dependent flag.  Dependent entries also
have a "set number" and an optional priority value.  All dependent
entries must be assigned from the same set.  For example, the OS can
use all the entries from dependent set 0, or all the entries from
dependent set 1, but it cannot mix entries from set 0 with entries
from set 1.

Prior to this patch PNP didn't keep track of the order of this list,
and it assigned all independent options first, then all dependent
ones.  Using the example above, that resulted in a "desired
configuration" list like this:

  ind->io0 -> ind->io1 -> depN-io0 ...

instead of the list the firmware expects, which looks like this:

  ind->io0 -> depN-io0 -> ind-io1 ...

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-07-16 23:27:07 +02:00
..
accessibility
acpi ACPI: video: fix brightness allocation 2008-07-16 23:27:05 +02:00
amba
ata Merge commit 'origin/master' 2008-07-16 11:07:59 +10:00
atm firmware: convert Ambassador ATM driver to request_firmware() 2008-07-10 14:49:39 +01:00
auxdisplay Miguel Ojeda has moved 2008-07-04 10:40:05 -07:00
base Merge branch 'core/topology' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-07-15 10:32:39 -07:00
block block: convert pd_special_command to use blk_execute_rq 2008-07-15 21:21:45 +02:00
bluetooth Merge branch 'for-2.6.27' of git://git.infradead.org/users/dwmw2/firmware-2.6 2008-07-14 16:54:07 -07:00
cdrom cdrom: revert commit 22a9189 (cdrom: use kmalloced buffers instead of buffers on stack) 2008-07-04 09:52:14 +02:00
char APM emulation: Notify about all suspend events, not just APM invoked ones (v2) 2008-07-16 23:27:02 +02:00
clocksource Fix printk format warning in clocksource/acpi_pm.c 2008-07-15 11:01:39 -07:00
connector CONNECTOR: add a proc entry to list connectors 2008-06-27 20:03:24 -07:00
cpufreq
cpuidle smp_call_function: get rid of the unused nonatomic/retry argument 2008-06-26 11:24:35 +02:00
crypto crypto: ixp4xx - Select CRYPTO_AUTHENC 2008-07-13 20:12:11 +08:00
dca
dio
dma
edac
eisa
firewire Merge branch 'sbp2-spindown' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2008-07-15 12:39:44 -07:00
firmware Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 2008-07-14 15:51:11 -07:00
gpio gpio: pca953x (i2c) handles max7310 too 2008-07-04 10:40:06 -07:00
gpu drm/radeon: fixup issue with radeon and PAT support. 2008-07-15 15:48:05 +10:00
hid Merge commit 'v2.6.26' into bkl-removal 2008-07-14 15:29:34 -06:00
hwmon hwmon: (w83l786ng) Convert to a new-style i2c driver 2008-07-16 19:30:18 +02:00
i2c i2c: Convert the max6875 driver to a new-style i2c driver 2008-07-16 19:30:07 +02:00
ide ide-floppy: fix unfortunate function naming 2008-07-15 21:22:03 +02:00
ieee1394 Merge branch 'sbp2-spindown' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2008-07-15 12:39:44 -07:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-15 18:58:04 -07:00
input Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6 2008-07-14 14:48:31 -07:00
isdn Merge commit 'v2.6.26' into bkl-removal 2008-07-14 15:29:34 -06:00
leds
lguest Merge branch 'generic-ipi' into generic-ipi-for-linus 2008-07-15 21:55:59 +02:00
macintosh Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build 2008-07-15 15:44:51 +10:00
mca
md Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-15 18:58:04 -07:00
media Merge branch 'for-2.6.27' of git://git.infradead.org/users/dwmw2/firmware-2.6 2008-07-14 16:54:07 -07:00
memstick
message Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-15 18:58:04 -07:00
mfd
misc fujitsu-laptop: depends on INPUT 2008-07-16 23:27:03 +02:00
mmc Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-07-14 16:06:58 -07:00
mtd [MIPS] MTX-1 flash partition setup move to platform devices registration 2008-07-15 18:44:38 +01:00
net Merge commit 'origin/master' 2008-07-16 11:07:59 +10:00
nubus
of OpenFirmware: Include <linux/of_i2c.h> from of_i2c.c. 2008-07-12 12:10:52 -06:00
oprofile
parisc parisc-eisa_eeprom: BKL pushdown 2008-07-02 15:06:24 -06:00
parport
pci PCI ACPI: Drop the second argument of platform_pci_choose_state 2008-07-16 23:27:02 +02:00
pcmcia Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build 2008-07-15 15:44:51 +10:00
pnp PNP: convert resource options to single linked list 2008-07-16 23:27:07 +02:00
power
ps3
rapidio rapidio: fix device reference counting 2008-07-10 18:04:43 -07:00
rtc Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-07-14 16:06:58 -07:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-15 18:58:04 -07:00
sbus Merge commit 'v2.6.26' into bkl-removal 2008-07-14 15:29:34 -06:00
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-15 18:58:04 -07:00
serial PNP: add pnp_possible_config() -- can a device could be configured this way? 2008-07-16 23:27:06 +02:00
sh
sn
spi Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build 2008-07-15 15:44:51 +10:00
ssb ssb-pcicore: Fix IRQ-vector init on embedded devices 2008-07-07 15:31:40 -04:00
tc
telephony
thermal
uio Merge commit 'v2.6.26' into bkl-removal 2008-07-14 15:29:34 -06:00
usb Merge branch 'for-2.6.27' of git://git.infradead.org/users/dwmw2/firmware-2.6 2008-07-14 16:54:07 -07:00
video Merge commit 'origin/master' 2008-07-16 11:07:59 +10:00
virtio
w1 w1/ds2482: Convert to a new-style driver 2008-07-16 19:30:07 +02:00
watchdog Merge commit 'origin/master' 2008-07-16 11:07:59 +10:00
xen Merge branch 'x86/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-07-14 13:43:24 -07:00
zorro
Kconfig
Makefile drm: reorganise drm tree to be more future proof. 2008-07-14 10:45:01 +10:00