aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAge
* [PATCH] smp_processor_id() cleanupIngo Molnar2005-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements a number of smp_processor_id() cleanup ideas that Arjan van de Ven and I came up with. The previous __smp_processor_id/_smp_processor_id/smp_processor_id API spaghetti was hard to follow both on the implementational and on the usage side. Some of the complexity arose from picking wrong names, some of the complexity comes from the fact that not all architectures defined __smp_processor_id. In the new code, there are two externally visible symbols: - smp_processor_id(): debug variant. - raw_smp_processor_id(): nondebug variant. Replaces all existing uses of _smp_processor_id() and __smp_processor_id(). Defined by every SMP architecture in include/asm-*/smp.h. There is one new internal symbol, dependent on DEBUG_PREEMPT: - debug_smp_processor_id(): internal debug variant, mapped to smp_processor_id(). Also, i moved debug_smp_processor_id() from lib/kernel_lock.c into a new lib/smp_processor_id.c file. All related comments got updated and/or clarified. I have build/boot tested the following 8 .config combinations on x86: {SMP,UP} x {PREEMPT,!PREEMPT} x {DEBUG_PREEMPT,!DEBUG_PREEMPT} I have also build/boot tested x64 on UP/PREEMPT/DEBUG_PREEMPT. (Other architectures are untested, but should work just fine.) Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] coverity: ipmi: avoid overrun of ipmi_interfaces[]Zaur Kambarov2005-06-21
| | | | | | | | | | | | | | Fix overrun of static array "ipmi_interfaces" of size 4 at position 4 with index variable "if_num". Definitions involved: 297 #define MAX_IPMI_INTERFACES 4 298 static ipmi_smi_t ipmi_interfaces[MAX_IPMI_INTERFACES]; Signed-off-by: Zaur Kambarov <zkambarov@coverity.com> Cc: Corey Minyard <minyard@acm.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] megaraid build fixbobl2005-06-21
| | | | | Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6Linus Torvalds2005-06-20
|\
| * [PATCH] PCI: fix show_modalias() function due to attribute changeGreg Kroah-Hartman2005-06-20
| | | | | | | | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] USB: fix show_modalias() function due to attribute changeGreg Kroah-Hartman2005-06-20
| | | | | | | | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Driver core: Don't "lose" devices on suspend on failureBenjamin Herrenschmidt2005-06-20
| | | | | | | | | | | | | | | | I think we need this patch or we might "lose" devices to the dpm_irq_off list if a failure occurs during the suspend process. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] I2C: drivers/i2c/chips/adm1026.c: use dynamic sysfs callbacksYani Ioannou2005-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | Finally (phew!) this patch demonstrates how to adapt the adm1026 to take advantage of the new callbacks, and the i2c-sysfs.h defined structure/macros. Most of the other sensor/hwmon drivers could be updated in the same way. The odd few exceptions (bmcsensors for example) however might be better off with their own custom attribute structure. Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Driver Core: drivers/usb/input/aiptek.c - ↵Yani Ioannou2005-06-20
| | | | | | | | | | | | | | drivers/zorro/zorro-sysfs.c: update device attribute callbacks Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Driver Core: drivers/s390/net/qeth_sys.c - ↵Yani Ioannou2005-06-20
| | | | | | | | | | | | | | drivers/usb/gadget/pxa2xx_udc.c: update device attribute callbacks Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Driver Core: drivers/char/raw3270.c - drivers/net/netiucv.c: update ↵Yani Ioannou2005-06-20
| | | | | | | | | | | | | | device attribute callbacks Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Driver Core: drivers/i2c/chips/w83781d.c - ↵Yani Ioannou2005-06-20
| | | | | | | | | | | | | | drivers/s390/block/dcssblk.c: update device attribute callbacks Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Driver Core: drivers/i2c/chips/pc87360.c - w83627hf.c: update device ↵Yani Ioannou2005-06-20
| | | | | | | | | | | | | | attribute callbacks Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Driver Core: drivers/i2c/chips/lm77.c - max1619.c: update device ↵Yani Ioannou2005-06-20
| | | | | | | | | | | | | | attribute callbacks Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Driver Core: drivers/i2c/chips/adm1031.c - lm75.c: update device ↵Yani Ioannou2005-06-20
| | | | | | | | | | | | | | attribute callbacks Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Driver Core: drivers/base - drivers/i2c/chips/adm1026.c: update ↵Yani Ioannou2005-06-20
| | | | | | | | | | | | | | device attribute callbacks Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Driver core: change device_attribute callbacksYani Ioannou2005-06-20
| | | | | | | | | | | | | | | | | | This patch adds the device_attribute paramerter to the device_attribute store and show sysfs callback functions, and passes a reference to the attribute when the callbacks are called. Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] driver core: fix error handling in bus_add_deviceHannes Reinecke2005-06-20
| | | | | | | | | | | | | | | | | | The error handling in bus_add_device() and device_attach() is simply non-existing. This patch propagates any error from device_attach to the upper layers to allow for a proper recovery. From: Hannes Reinecke <hare@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Driver core: unregister_node() for hotplug useKeiichiro Tokunaga2005-06-20
| | | | | | | | | | | | | | | | | | | | | | | | This adds a generic function 'unregister_node()'. It is used to remove objects of a node going away for hotplug. All the devices on the node must be unregistered before calling this function. Signed-off-by: Keiichiro Tokunaga <tokunaga.keiich@jp.fujitsu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> diff -puN drivers/base/node.c~numa_hp_base drivers/base/node.c
| * [PATCH] usbcore: Don't call device_release_driver recursivelyAlan Stern2005-06-20
| | | | | | | | | | | | | | | | | | | | This patch fixes usb_driver_release_interface() to make it avoid calling device_release_driver() recursively, i.e., when invoked from within the disconnect routine for the same device. The patch applies to your "driver" tree. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] driver core: Fix races in driver_detach()Alan Stern2005-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is intended for your "driver" tree. It fixes several subtle races in driver_detach() and device_release_driver() in the driver-model core. The major change is to use klist_remove() rather than klist_del() when taking a device off its driver's list. There's no other way to guarantee that the list pointers will be updated before some other driver binds to the device. For this to work driver_detach() can't use a klist iterator, so the loop over the devices must be written out in full. In addition the patch protects against the possibility that, when a driver and a device are unregistered at the same time, one may be unloaded from memory before the other is finished using it. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] usb: klist_node_attached() fixPatrick Mochel2005-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original code looks like this: /* if interface was already added, bind now; else let * the future device_add() bind it, bypassing probe() */ if (!list_empty (&dev->bus_list)) device_bind_driver(dev); IOW, it's checking to see if the device is attached to the bus or not and binding the driver if it is. It's checking the device's bus list, which will only appear empty when the device has been initialized, but not added. It depends way too much on the driver model internals, but it seems to be the only way to do the weird crap they want to do with interfaces. When I converted it to use klists, I accidentally inverted the logic, which led to bad things happening. This patch returns the check to its orginal value. From: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Index: gregkh-2.6/drivers/usb/core/usb.c ===================================================================
| * [PATCH] Fix typo in scdrv_init()Jason Uhlenkott2005-06-20
| | | | | | | | | | | | | | | | Fix a typo in scdrv_init() which was breaking the build for SGI sn2. Signed-off-by: Jason Uhlenkott <jasonuhl@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Driver Core: fix bk-driver-core kills ppc64Patrick Mochel2005-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no check to see if the device is already bound to a driver, which could do bad things. The first thing to go wrong is that it will try to match a driver with a device already bound to one. In some cases (it appears with USB with drivers/usb/core/usb.c::usb_match_id()), some drivers will match a device based on the class type, so it would be common (especially for HID devices) to match a device that is already bound. The fun comes when ->probe() is called, it fails, then driver_probe_device() does this: dev->driver = NULL; Later on, that pointer could be be dereferenced without checking and cause hell to break loose. This problem could be nasty. It's very hardware dependent, since some devices could have a different set of matching qualifiers than others. Now, I don't quite see exactly where/how you were getting that crash. You're dereferencing bad memory, but I'm not sure which pointer was bad and where it came from, but it could have come from a couple of different places. The patch below will hopefully fix it all up for you. It's against 2.6.12-rc2-mm1, and does the following: - Move logic to driver_probe_device() and comments uncommon returns: 1 - If device is bound 0 - If device not bound, and no error error - If there was an error. - Move locking to caller of that function, since we want to lock a device for the entire time we're trying to bind it to a driver (to prevent against a driver being loaded at the same time). - Update __device_attach() and __driver_attach() to do that locking. - Check if device is already bound in __driver_attach() - Update the converse device_release_driver() so it locks the device around all of the operations. - Mark driver_probe_device() as static and remove export. It's an internal function, it should stay that way, and there are no other callers. If there is ever a need to export it, we can audit it as necessary. Signed-off-by: Andrew Morton <akpm@osdl.org>
| * [PATCH] Driver core: Fix up the driver and device iterators to be quietergregkh@suse.de2005-06-20
| | | | | | | | | | | | Also stops looping over the lists when a match is found. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de
| * [PATCH] use device_for_each_child() to properly access child devices.long2005-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On Friday, March 25, 2005 8:47 PM Greg KH wrote: >Here's a fix for pci express. For some reason I don't think they are >using the driver model properly here, but I could be wrong... Thanks for making the changes. However, changes in functions: void pcie_port_device_remove(struct pci_dev *dev) and static int remove_iter(struct device *dev, void *data) are not correct. Please use the patch, which is based on kernel 2.6.12-rc1, below for a fix for these. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Use device_for_each_child() to unregister devices in ↵gregkh@suse.de2005-06-20
| | | | | | | | | | | | | | | | nodemgr_remove_host_dev() Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> diff -Nru a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
| * [PATCH] USB: fix build warning in usb core as pointed out by Andrew.gregkh@suse.de2005-06-20
| | | | | | | | | | | | | | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Index: gregkh-2.6/drivers/usb/core/usb.c ===================================================================
| * [PATCH] driver core: change export symbol for driver_for_each_device()gregkh@suse.de2005-06-20
| | | | | | | | | | | | | | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Index: linux-2.6.12-rc2/drivers/base/driver.c ===================================================================
| * [PATCH] Fix up bogus comment.mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> diff -Nru a/drivers/base/driver.c b/drivers/base/driver.c
| * [PATCH] Use a klist for device child lists.mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | | | | | - Use klist iterator in device_for_each_child(), making it safe to use for removing devices. - Remove unused list_to_dev() function. - Kills all usage of devices_subsys.rwsem. Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] use device_for_each_child() to properly access child devices.gregkh@suse.de2005-06-20
| | | | | | | | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Use device_for_each_child() to unregister devices in ↵mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | | | | | scsi_remove_target(). Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Index: gregkh-2.6/drivers/scsi/scsi_sysfs.c ===================================================================
| * [PATCH] Call klist_del() instead of klist_remove().mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | - Can't wait on removing the current item in the list (the positive refcount *because* we are using it causes it to deadlock). Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Remove struct device::driver_list.mochel@digitalimplant.org2005-06-20
| | | | | | | | | | Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Remove struct device::bus_list.mochel@digitalimplant.org2005-06-20
| | | | | | | | | | Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Fix up bus code and remove use of rwsem.mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | | | - Don't add devices to bus's embedded kset, since it's not used by anyone anymore. - Don't need to take the bus rwsem when calling {device,driver}_attach(), since those functions use the klists and the klists' spinlocks. Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Fix up USB to use klist_node_attached() instead of list_empty() on ↵mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | | | | | lists that will go away. Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Index: gregkh-2.6/drivers/usb/core/usb.c ===================================================================
| * [PATCH] Use bus_for_each_{dev,drv} for driver binding.mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | - Now possible, since the lists are locked using the klist lock and not the global rwsem. Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Remove the unused device_find().mochel@digitalimplant.org2005-06-20
| | | | | | | | | | Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Add a klist to struct device_driver for the devices bound to it.mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | - Use it in driver_for_each_device() instead of the regular list_head and stop using the bus's rwsem for protection. - Use driver_for_each_device() in driver_detach() so we don't deadlock on the bus's rwsem. - Remove ->devices. - Move klist access and sysfs link access out from under device's semaphore, since they're synchronized through other means. Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Add a klist to struct bus_type for its drivers.mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | - Use it in bus_for_each_drv(). - Use the klist spinlock instead of the bus rwsem. Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Add a klist to struct bus_type for its devices.mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | - Use it for bus_for_each_dev(). - Use the klist spinlock instead of the bus rwsem. Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Use driver_for_each_device() instead of manually walking list.mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Index: gregkh-2.6/drivers/usb/core/usb.c ===================================================================
| * [PATCH] Use driver_for_each_device() in drivers/pnp/driver.c instead of ↵mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | | | manually walking list. Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> diff -Nru a/drivers/pnp/driver.c b/drivers/pnp/driver.c
| * [PATCH] Add driver_for_each_device().mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | | | | | Now there's an iterator for accessing each device bound to a driver. Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Index: linux-2.6.12-rc2/drivers/base/driver.c ===================================================================
| * [PATCH] Move device/driver code to drivers/base/dd.cmochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | | | | | This relocates the driver binding/unbinding code to drivers/base/dd.c. This is done for two reasons: One, it's not code related to the bus_type itself; it uses some from that, some from devices, and some from drivers. And Two, it will make it easier to do some of the upcoming lock removal on that code.. Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] Add a semaphore to struct device to synchronize calls to its driver.mochel@digitalimplant.org2005-06-20
| | | | | | | | | | | | | | | | | | | | | | | | This adds a per-device semaphore that is taken before every call from the core to a driver method. This prevents e.g. simultaneous calls to the ->suspend() or ->resume() and ->probe() or ->release(), potentially saving a whole lot of headaches. It also moves us a step closer to removing the bus rwsem, since it protects the fields in struct device that are modified by the core. Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] fix up ipmi code after class_simple.c removalAndrew Morton2005-06-20
| | | | | | | | | | | | Cc: Corey Minyard <minyard@acm.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * [PATCH] class: remove class_simple code, as no one in the tree is using it ↵gregkh@suse.de2005-06-20
| | | | | | | | | | | | anymore. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>