1
0
Fork 0
Commit Graph

17946 Commits (2f27ce03628acdb81ead4abe914c713e04a3229e)

Author SHA1 Message Date
Alan Cox 2f27ce0362 [PATCH] pci_module_init-convertion-in-ata_genericc fix
Acked-by: Alan Cox <alan@redhat.com> but please apply as follows to keep
revision id straight

Cc: Henrik Kretzschmar <henne@nachtwindheim.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-12-01 22:40:25 -05:00
Henrik Kretzschmar 3f03c6713a [PATCH] pci_module_init convertion in ata_generic.c
pci_module_init convertion in ata_generic.c.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-12-01 22:40:25 -05:00
Alan Cox 7e45b0e5f6 [PATCH] libata: Winbond support
Winbond 83759A support in non-multichip mode (afaik nobody ever used
multichip mode anyway). The 83759 is not supported by this driver as it
is already handled elsewhere and doens't use the same interfaces.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-12-01 22:40:24 -05:00
Linus Torvalds b6ef977b60 Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
* master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  [WATCHDOG] MIPS RM9000 on-chip watchdog device - patch 4
  [WATCHDOG] MIPS RM9000 on-chip watchdog device - patch 3
  [WATCHDOG] MIPS RM9000 on-chip watchdog device - patch 2
  [WATCHDOG] MIPS RM9000 on-chip watchdog device - patch 1
  [WATCHDOG] MIPS RM9000 on-chip watchdog device
  [WATCHDOG] Add iTCO vendor specific support
  [WATCHDOG] sc1200wdt.c pnp unregister fix.
  [WATCHDOG] config.h removal
  [WATCHDOG] NS pc87413-wdt Watchdog driver - fixes
  [WATCHDOG] NS pc87413-wdt Watchdog driver v1.1
  [WATCHDOG] NS pc87413-wdt Watchdog driver
2006-12-01 16:47:26 -08:00
Linus Torvalds 9ba5aa3126 Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  [PATCH] libata: add missing sht->slave_destroy
  [PATCH] ahci: ignore PORT_IRQ_IF_ERR on JMB controllers
2006-12-01 16:46:22 -08:00
Linus Torvalds 5f56bbdf1e Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (25 commits)
  IB/ucm: Fix deadlock in cleanup
  IB/cm: Fix automatic path migration support
  IPoIB: Fix skb leak when freeing neighbour
  IB/srp: Fix memory leak on reconnect
  RDMA/addr: list_move() cleanups
  RDMA/addr: Fix some cancellation problems in process_req()
  RDMA/amso1100: Prevent deadlock in destroy QP
  IB/mthca: Fix initial SRQ logsize for mem-free HCAs
  IB/ehca: Use WQE offset instead of WQE addr for pending work reqs
  RDMA/iwcm: Fix comment for iwcm_deref_id() to match code
  RDMA/iwcm: Remove unnecessary function argument
  RDMA/iwcm: Remove unnecessary initializations
  RDMA/iwcm: Fix memory leak
  RDMA/iwcm: Fix memory corruption bug in cm_work_handler()
  IB: Convert kmem_cache_t -> struct kmem_cache
  IB/ipath: Fix typo in pma_counter_select subscript
  RDMA/amso1100: Fix section mismatches
  IB/mthca: Fix section mismatches
  IB/srp: Increase supported CDB size
  RDMA/cm: Remove setting local write as part of QP access flags
  ...
2006-12-01 16:43:06 -08:00
Linus Torvalds 9641219825 Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (103 commits)
  usbcore: remove unused argument in autosuspend
  USB: keep count of unsuspended children
  USB hub: simplify remote-wakeup handling
  USB: struct usb_device: change flag to bitflag
  OHCI: make autostop conditional on CONFIG_PM
  USB: Add autosuspend support to the hub driver
  EHCI: Fix root-hub and port suspend/resume problems
  USB: create a new thread for every USB device found during the probe sequence
  USB: add driver for the USB debug devices
  USB: added dynamic major number for USB endpoints
  USB: pegasus error path not resetting task's state
  USB: endianness fix for asix.c
  USB: build the appledisplay driver
  USB serial: replace kmalloc+memset with kzalloc
  USB: hid-core: canonical defines for Apple USB device IDs
  USB: idmouse cleanup
  USB: make drivers/usb/core/driver.c:usb_device_match() static
  USB: lh7a40x_udc remove double declaration
  USB: pxa2xx_udc recognizes ixp425 rev b0 chip
  usbtouchscreen: add support for DMC TSC-10/25 devices
  ...
2006-12-01 16:41:58 -08:00
Linus Torvalds 72a73a69f6 Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (28 commits)
  PCI: make arch/i386/pci/common.c:pci_bf_sort static
  PCI: ibmphp_pci.c: fix NULL dereference
  pciehp: remove unnecessary pci_disable_msi
  pciehp: remove unnecessary free_irq
  PCI: rpaphp: change device tree examination
  PCI: Change memory allocation for acpiphp slots
  i2c-i801: SMBus patch for Intel ICH9
  PCI: irq: irq and pci_ids patch for Intel ICH9
  PCI: pci_{enable,disable}_device() nestable ports
  PCI: switch pci_{enable,disable}_device() to be nestable
  PCI: arch/i386/kernel/pci-dma.c: ioremap balanced with iounmap
  pci/i386: style cleanups
  PCI: Block on access to temporarily unavailable pci device
  pci: fix __pci_register_driver error handling
  pci: clear osc support flags if no _OSC method
  acpiphp: fix missing acpiphp_glue_exit()
  acpiphp: fix use of list_for_each macro
  Altix: Initial ACPI support - ROM shadowing.
  Altix: SN ACPI hotplug support.
  Altix: Add initial ACPI IO support
  ...
2006-12-01 16:41:27 -08:00
Linus Torvalds 4549df891a Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits)
  Driver core: show drivers in /sys/module/
  Documentation/driver-model/platform.txt update/rewrite
  Driver core: platform_driver_probe(), can save codespace
  driver core: Use klist_remove() in device_move()
  driver core: Introduce device_move(): move a device to a new parent.
  Driver core: make drivers/base/core.c:setup_parent() static
  driver core: Introduce device_find_child().
  sysfs: sysfs_write_file() writes zero terminated data
  cpu topology: consider sysfs_create_group return value
  Driver core: Call platform_notify_remove later
  ACPI: Change ACPI to use dev_archdata instead of firmware_data
  Driver core: add dev_archdata to struct device
  Driver core: convert sound core to use struct device
  Driver core: change mem class_devices to be real devices
  Driver core: convert fb code to use struct device
  Driver core: convert firmware code to use struct device
  Driver core: convert mmc code to use struct device
  Driver core: convert ppdev code to use struct device
  Driver core: convert PPP code to use struct device
  Driver core: convert cpuid code to use struct device
  ...
2006-12-01 16:41:07 -08:00
Linus Torvalds 1399ff5474 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
* git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial:
  Fix typos in drivers/isdn/hisax/isdnl2.c
  Fix typos in doc and comments
  BUG_ON conversion for fs/aio.c
  BUG_ON conversion for drivers/mmc/omap.c
  BUG_ON conversion for drivers/media/video/pwc/pwc-if.c
  Fix misc .c/.h comment typos
  Fix misc Kconfig typos
  Fix typos in /Documentation : Misc
  Fix typos in /Documentation : 'U-Z'
  Fix typos in /Documentation : 'T''
  Fix jiffies.h comment
  tabify MAINTAINERS
  fix spelling error in include/linux/kernel.h
  mqueue.h: don't include linux/types.h
2006-12-01 16:38:18 -08:00
David Brownell c67334fbdf Driver core: platform_driver_probe(), can save codespace
This defines a new platform_driver_probe() method allowing the driver's
probe() method, and its support code+data, to safely live in __init
sections for typical system configurations.

Many system-on-chip processors could benefit from this API, to the tune
of recovering hundreds to thousands of bytes per driver.  That's memory
which is currently wasted holding code which can never be called after
system startup, yet can not be removed.   It can't be removed because of
the linkage requirement that pointers to init section code (like, ideally,
probe support) must not live in other sections (like driver method tables)
after those pointers would be invalid.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:02 -08:00
Cornelia Huck acf02d23b9 driver core: Use klist_remove() in device_move()
As pointed out by Alan Stern, device_move needs to use klist_remove which waits
until removal is complete.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:02 -08:00
Cornelia Huck 8a82472f86 driver core: Introduce device_move(): move a device to a new parent.
Provide a function device_move() to move a device to a new parent device. Add
auxilliary functions kobject_move() and sysfs_move_dir().
kobject_move() generates a new uevent of type KOBJ_MOVE, containing the
previous path (DEVPATH_OLD) in addition to the usual values. For this, a new
interface kobject_uevent_env() is created that allows to add further
environmental data to the uevent at the kobject layer.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:01 -08:00
Adrian Bunk af9e076536 Driver core: make drivers/base/core.c:setup_parent() static
This patch makes the needlessly global setup_parent() static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:01 -08:00
Cornelia Huck 5ab699810d driver core: Introduce device_find_child().
Introduce device_find_child() to match device_for_each_child().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:01 -08:00
Heiko Carstens 06a4bcae1f cpu topology: consider sysfs_create_group return value
Take return value of sysfs_create_group() into account.  That function got
called in case of CPU_ONLINE notification.  Since callbacks are not allowed
to fail on CPU_ONLINE notification do the sysfs group creation on
CPU_UP_PREPARE notification.

Also remember if creation succeeded in a bitmask.  So it's possible to know
whether it's legal to call sysfs_remove_group or not.

In addition some other minor stuff:

- since CPU_UP_PREPARE might fail add CPU_UP_CANCELED handling as well.
- use hotcpu_notifier instead of register_hotcpu_notifier.
- #ifdef code that isn't needed in the !CONFIG_HOTPLUG_CPU case.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:01 -08:00
Benjamin Herrenschmidt 2895353346 Driver core: Call platform_notify_remove later
Move the call to platform_notify_remove() to after the call to
bus_remove_device(), where it belongs.  It's bogus to notify the platform
of removal while drivers are still attached to the device and possibly
still operating since the platform might use this callback to tear down
some resources used by the driver (ACPI bits, iommu table, ...)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "Brown, Len" <len.brown@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:01 -08:00
Benjamin Herrenschmidt 465ae641e4 ACPI: Change ACPI to use dev_archdata instead of firmware_data
Change ACPI to use dev_archdata instead of firmware_data

This patch changes ACPI to use the new dev_archdata on i386, x86_64
and ia64 (is there any other arch using ACPI ?) to store it's
acpi_handle.

It also removes the firmware_data field from struct device as this
was the only user.

Only build-tested on x86

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:01 -08:00
Greg Kroah-Hartman ebf644c462 Driver core: change mem class_devices to be real devices
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:00 -08:00
Greg Kroah-Hartman 78cde08879 Driver core: convert fb code to use struct device
Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:00 -08:00
Greg Kroah-Hartman e55c8790d4 Driver core: convert firmware code to use struct device
Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:00 -08:00
Greg Kroah-Hartman fcaf71fd51 Driver core: convert mmc code to use struct device
Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:00 -08:00
Greg Kroah-Hartman 04880edae5 Driver core: convert ppdev code to use struct device
Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:00 -08:00
Greg Kroah-Hartman 9a6a2a5e0b Driver core: convert PPP code to use struct device
Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:52:00 -08:00
Greg Kroah-Hartman ac11d0601b I2C: convert i2c-dev to use struct device instead of struct class_device
As class_device is going away eventually...

Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:59 -08:00
Greg Kroah-Hartman 38ca6c34d3 Driver core: convert raw device code to use struct device
Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:59 -08:00
Greg Kroah-Hartman 01107d3430 Driver core: convert tty core to use struct device
Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.

Also fixes up the isdn drivers that were putting something in the class
device's directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:59 -08:00
Greg Kroah-Hartman 94fbcded4e Driver core: change misc class_devices to be real devices
This also ment that some of the misc drivers had to also be fixed
up as they were assuming the device was a class_device.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:59 -08:00
Greg Kroah-Hartman cd15422b9f Driver core: convert vc code to use struct device
Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:59 -08:00
Greg Kroah-Hartman 805952a889 Driver core: convert vt code to use struct device
Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:59 -08:00
Kay Sievers 805fab474e CONFIG_SYSFS_DEPRECATED - class symlinks
Turn off class symlinks CONFIG_SYSFS_DEPRECATED is enabled.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:59 -08:00
Kay Sievers a87cb2ac4a CONFIG_SYSFS_DEPRECATED - PHYSDEV* uevent variables
Disable the PHYSDEV* uevent variables if CONFIG_SYSFS_DEPRECATED is
enabled.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:59 -08:00
Kay Sievers 99ef3ef8d5 CONFIG_SYSFS_DEPRECATED - device symlinks
Turn off device symlinks CONFIG_SYSFS_DEPRECATED is enabled.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:59 -08:00
Kay Sievers b9cafc7d5b CONFIG_SYSFS_DEPRECATED - bus symlinks
Turn off the bus symlinks if CONFIG_SYSFS_DEPRECATED is enabled

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:58 -08:00
Greg Kroah-Hartman 40fa54226f Driver core: make old versions of udev work properly
If CONFIG_SYSFS_DEPRECATED is enabled, old versions of udev will work
properly with devices that are associated with a class.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:58 -08:00
Greg Kroah-Hartman f0ee61a6ce Driver Core: Move virtual_device_parent() to core.c
It doesn't need to be global or in device.h


Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:58 -08:00
Kay Sievers 1901fb2604 Driver core: fix "driver" symlink timing
Create the "driver" link before the child device may be created by
the probing logic. This makes it possible for userspace (udev), to
determine the driver property of the parent device, at the time the
child device is created.

Signed-off-by: Kay Sievers <kay.sievers@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:58 -08:00
Benjamin Herrenschmidt 116af37820 Driver core: add notification of bus events
I finally did as you suggested and added the notifier to the struct
bus_type itself. There are still problems to be expected is something
attaches to a bus type where the code can hook in different struct
device sub-classes (which is imho a big bogosity but I won't even try to
argue that case now) but it will solve nicely a number of issues I've
had so far.

That also means that clients interested in registering for such
notifications have to do it before devices are added and after bus types
are registered. Fortunately, most bus types that matter for the various
usage scenarios I have in mind are registerd at postcore_initcall time,
which means I have a really nice spot at arch_initcall time to add my
notifiers.

There are 4 notifications provided. Device being added (before hooked to
the bus) and removed (failure of previous case or after being unhooked
from the bus), along with driver being bound to a device and about to be
unbound.

The usage I have for these are:

 - The 2 first ones are used to maintain a struct device_ext that is
hooked to struct device.firmware_data. This structure contains for now a
pointer to the Open Firmware node related to the device (if any), the
NUMA node ID (for quick access to it) and the DMA operations pointers &
iommu table instance for DMA to/from this device. For bus types I own
(like IBM VIO or EBUS), I just maintain that structure directly from the
bus code when creating the devices. But for bus types managed by generic
code like PCI or platform (actually, of_platform which is a variation of
platform linked to Open Firmware device-tree), I need this notifier.

 - The other two ones have a completely different usage scenario. I have
cases where multiple devices and their drivers depend on each other. For
example, the IBM EMAC network driver needs to attach to a MAL DMA engine
which is a separate device, and a PHY interface which is also a separate
device. They are all of_platform_device's (well, about to be with my
upcoming patches) but there is no say in what precise order the core
will "probe" them and instanciate the various modules. The solution I
found for that is to have the drivers for emac to use multithread_probe,
and wait for a driver to be bound to the target MAL and PHY control
devices (the device-tree contains reference to the MAL and PHY interface
nodes, which I can then match to of_platform_devices). Right now, I've
been polling, but with that notifier, I can more cleanly wait (with a
timeout of course).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:51:58 -08:00
Adrian Bunk b0d974e90d PCI: ibmphp_pci.c: fix NULL dereference
The correct order is: NULL check before dereference

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:37:00 -08:00
Kenji Kaneshige 9d167dc367 pciehp: remove unnecessary pci_disable_msi
This patch fixes the problem that "irq XX: nobody cared" kernel oops
is reported when pciehp is once rmmoded and insmoded again. The cause
of this problem is pciehp driver calls pci_disable_msi() at controller
release time, even though it must be done by PCI Express Port Bus
driver. This patch removes unnecessary pci_disable_msi() call from
pciehp driver.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:37:00 -08:00
Kenji Kaneshige 407f452b05 pciehp: remove unnecessary free_irq
This patch fixes the problem that the following error messages is
reported when pciehp driver is rmmoded.

	Trying to free already-free IRQ XX

The cause of this problem is that pciehp driver is doing unknown 2nd
free_irq at driver unloading. This patch removes this unknown 2nd
free_irq call.

Note: The pciehp driver should be adapted to standard device driver
mode.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:36:59 -08:00
John Rose a57ed79ef1 PCI: rpaphp: change device tree examination
Change the criterion that RPA PCI Hotplug and RPA DLPAR use when
determining the hotplug capabilities of a given device node.  The
"device_type" property is less consistent than "name" across PCI nodes
on newer hardware.

Signed-off-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:36:59 -08:00
Rolf Eike Beer ac9e989187 PCI: Change memory allocation for acpiphp slots
Change memory allocation for acpiphp slots

Change the "struct slot" that acpiphp uses for managing it's slots to
directly contain the memory for the needed struct hotplug_slot_info and
the slot's name. This way we need only two memory allocations per slot
instead of four.

While we are at it: make_slot_name() is just a wrapper around snprintf()
knowing the right arguments to call it. Since the function makes just one
function call and is only called from one place I inlined it by hand.

Finally this fixes a possible bug waiting for someone to hit it. There were
two unused local variables in acpiphp_register_hotplug_slot(). gcc did not
find them because they were used in memory allocations with sizeof(*var).
They had the same types as the target of the allocation, but nevertheless
this was just weird.

Signed-off-by: Rolf Eike Beer <eike-hotplug@sf-tec.de>
Acked-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:36:59 -08:00
Jason Gaston adbc2a1022 i2c-i801: SMBus patch for Intel ICH9
This updated patch adds the Intel ICH9 LPC and SMBus Controller DID's.  Thi=
s patch relies on the irq ICH9 patch to pci_ids.h.

Signed-off-by: Jason Gaston <jason.d.gaston@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:36:59 -08:00
Inaky Perez-Gonzalez 95ddc5f255 PCI: pci_{enable,disable}_device() nestable ports
Change drivers/message/i20 pci driver to simply do a nestable
enable()/disable() instead of checking for it.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:36:59 -08:00
Inaky Perez-Gonzalez bae94d0237 PCI: switch pci_{enable,disable}_device() to be nestable
Changes the pci_{enable,disable}_device() functions to work in a
nested basis, so that eg, three calls to enable_device() require three
calls to disable_device().

The reason for this is to simplify PCI drivers for
multi-interface/capability devices. These are devices that cram more
than one interface in a single function. A relevant example of that is
the Wireless [USB] Host Controller Interface (similar to EHCI) [see
http://www.intel.com/technology/comms/wusb/whci.htm]. 

In these kind of devices, multiple interfaces are accessed through a
single bar and IRQ line. For that, the drivers map only the smallest
area of the bar to access their register banks and use shared IRQ
handlers. 

However, because the order at which those drivers load cannot be known
ahead of time, the sequence in which the calls to pci_enable_device()
and pci_disable_device() cannot be predicted. Thus:

1. driverA     starts     pci_enable_device()
2. driverB     starts     pci_enable_device()
3. driverA     shutdown   pci_disable_device()
4. driverB     shutdown   pci_disable_device()

between steps 3 and 4, driver B would loose access to it's device,
even if it didn't intend to.

By using this modification, the device won't be disabled until all the
callers to enable() have called disable().

This is implemented by replacing 'struct pci_dev->is_enabled' from a
bitfield to an atomic use count. Each caller to enable increments it,
each caller to disable decrements it. When the count increments from 0
to 1, __pci_enable_device() is called to actually enable the
device. When it drops to zero, pci_disable_device() actually does the
disabling.

We keep the backend __pci_enable_device() for pci_default_resume() to
use and also change the sysfs method implementation, so that userspace
enabling/disabling the device doesn't disable it one time too much.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:36:59 -08:00
Matthew Wilcox 7ea7e98fd8 PCI: Block on access to temporarily unavailable pci device
The existing implementation of pci_block_user_cfg_access() was recently
criticised for providing out of date information and for returning errors
on write, which applications won't be expecting.

This reimplementation uses a global wait queue and a bit per device.
I've open-coded prepare_to_wait() / finish_wait() as I could optimise
it significantly by knowing that the pci_lock protected us at all points.

It looked a bit funny to be doing a spin_unlock_irqsave(); schedule(),
so I used spin_lock_irq() for the _user versions of pci_read_config and
pci_write_config.  Not carrying a flags pointer around made the code
much less nasty.

Attempts to block an already blocked device hit a BUG() and attempts to
unblock an already unblocked device hit a WARN().  If we need to block
access to a device from userspace, it's because it's unsafe for even
another bit of the kernel to access the device.  An attempt to block
a device for a second time means we're about to access the device to
perform some other operation, which could provoke undefined behaviour
from the device.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Acked-by: Adam Belay <abelay@novell.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:36:58 -08:00
Akinobu Mita 50bf14b3ff pci: fix __pci_register_driver error handling
__pci_register_driver() error path forgot to unwind.
driver_unregister() needs to be called when pci_create_newid_file() failed.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:36:58 -08:00
Kristen Carlson Accardi 0dcb2b7e72 pci: clear osc support flags if no _OSC method
So it looks like pci aer code will call pci_osc_support_set to tell the
firmware about  OSC_EXT_PCI_CONFIG_SUPPORT flag.  that causes
ctrlset_buf[OSC_SUPPORT_TYPE] to evaluate to true when pciehp calls
pci_osc_control_set() is called (to attempt to use OSC to gain native
pcie control from firmware), regardless of whether or not _OSC was
actually successfully executed.  That causes this section of code:
 if (ctrlset_buf[OSC_SUPPORT_TYPE] &&
                ((global_ctrlsets & ctrlset) != ctrlset)) {
                return AE_SUPPORT;
        }
to be hit.

This patch will reset the OSC_SUPPORT_TYPE field if _OSC fails, and then
would allow pciehp to go ahead and try to run _OSC again.

Signed-off-by:  Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:36:58 -08:00
Akinobu Mita 0a9dee2739 acpiphp: fix missing acpiphp_glue_exit()
acpiphp_glue_exit() needs to be called to unwind when no slots found.
(It fixes data corruption when reloading acpiphp driver with no such devices)

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:36:58 -08:00