aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base (follow)
AgeCommit message (Collapse)AuthorFilesLines
2005-09-10[PATCH] dmapool: Fix "nocast type" warningsVictor Fusco1-1/+2
Fix the sparse warning "implicit cast to nocast type" Signed-off-by: Victor Fusco <victor@cetuc.puc-rio.br> Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-07[SCSI] Re-do "final klist fixes"Linus Torvalds1-4/+20
With the previous commit that introduces the klist enhancements, we can now re-do 2b7d6a8cb9718fc1d9e826201b64909c44a915f4 again.
2005-09-07[PATCH] fix klist semantics for lists which have elements removed on traversalJames Bottomley3-4/+62
The problem is that klists claim to provide semantics for safe traversal of lists which are being modified. The failure case is when traversal of a list causes element removal (a fairly common case). The issue is that although the list node is refcounted, if it is embedded in an object (which is universally the case), then the object will be freed regardless of the klist refcount leading to slab corruption because the klist iterator refers to the prior element to get the next. The solution is to make the klist take and release references to the embedding object meaning that the embedding object won't be released until the list relinquishes the reference to it. (akpm: fast-track this because it's needed for the 2.6.13 scsi merge) Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-07[SCSI] Revert "final klist fixes"Linus Torvalds1-20/+4
Revert commit 2b7d6a8cb9718fc1d9e826201b64909c44a915f4. The "fix" was known to not even compile. Duh. That's not a fix. That's just stupid. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-07Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-for-linus-2.6 Linus Torvalds2-17/+88
2005-09-07[PATCH] modified firmware_class.c to support no hotplugAbhay Salunke1-29/+50
Upgrade the request_firmware_nowait function to not start the hotplug action on a firmware update. This patch is tested along with dell_rbu driver on i386 and x86-64 systems. Signed-off-by: Abhay Salunke <Abhay_Salunke@dell.com> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-06Merge by hand (conflicts in sd.c)James Bottomley1-22/+45
2005-09-05[PATCH] klist: fix klist to have the same klist_add semantics as list_headJames Bottomley3-4/+4
at the moment, the list_head semantics are list_add(node, head) whereas current klist semantics are klist_add(head, node) This is bound to cause confusion, and since klist is the newcomer, it should follow the list_head semantics. I also added missing include guards to klist.h Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05[PATCH] Driver core: small cleanup; remove check for NULL before kfree() in driver coreJesper Juhl1-4/+2
Remove needless checking of variable for NULL before calling kfree() on it. Applies to 2.6.13-rc6-git9 Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05[PATCH] Driver core: hande sysdev suspend failureShaohua Li1-25/+85
This patch adds the return value check for sysdev suspend and does restore in failure case. Send the patch to pm-list, but seems lost, so I resend it. Signed-off-by: Shaohua Li<shaohua.li@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05[PATCH] Driver core: link device and all class devices derived from it.Dmitry Torokhov1-2/+31
Driver core: link device and all class devices derived from it. To ease the task of locating class devices derived from a certain device create symlinks from parent device to its class devices. Change USB host class device name from usbX to usb_hostX to avoid conflict when creating aforementioned links. Tweaked by Greg to have the symlink be "class_name:class_device_name" in order to prevent duplicate links. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05[PATCH] Fix manual binding infinite loopGreg Kroah-Hartman1-1/+3
Fix for manual binding of drivers to devices. Problem is if you pass in a valid device id, but the driver refuses to bind. Infinite loop as write() tries to resubmit the data it just sent. Thanks to Michal Ostrowski <mostrows@watson.ibm.com> for pointing the problem out. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-05[PATCH] swsusp: switch pm_message_t to structPavel Machek4-18/+18
This adds type-checking to pm_message_t, so that people can't confuse it with int or u32. It also allows us to fix "disk yoyo" during suspend (disk spinning down/up/down). [We've tried that before; since that cpufreq problems were fixed and I've tried make allyes config and fixed resulting damage.] Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Alexander Nyberg <alexn@telia.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-05[PATCH] VM: add page_state info to per-node meminfoMartin Hicks1-2/+22
Add page_state info to the per-node meminfo file in sysfs. This is mostly just for informational purposes. The lack of this information was brought up recently during a discussion regarding pagecache clearing, and I put this patch together to test out one of the suggestions. It seems like interesting info to have, so I'm submitting the patch. Signed-off-by: Martin Hicks <mort@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-08-30[SCSI] attribute container final klist fixesJames Bottomley1-4/+20
Since the attribute container deletes from a klist while it's walking it, it is vulnerable to the problem (and fix) here: http://marc.theaimsgroup.com/?l=linux-scsi&m=112485448830217 The attached fixes this (but won't compile without the above). It also fixes the logical reversal in the traversal loop which meant that we were never actually traversing the loop to hit this bug in the first place. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-08-30[SCSI] correct attribute_container list usageJames Bottomley1-22/+29
One of the changes in the attribute_container code in the scsi-misc tree was to add a lock to protect the list of devices per container. This, unfortunately, leads to potential scheduling while atomic problems if there's a sleep in the function called by a trigger. The correct solution is to use the kernel klist infrastructure instead which allows lockless traversal of a list. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-08-28Merge HEAD from ../scsi-misc-2.6-tmp James Bottomley2-7/+55
2005-08-28[SCSI] fix transport class corner case after reworkJames Bottomley2-1/+6
If your transport class sets the ATTRIBUTE_CONTAINER_NO_CLASSDEVS flag, then its configure method never gets called. This patch fixes that so that the configure method is called with a NULL classdev. Also remove a spurious inverted comma in the transport_class comments. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-08-17[PATCH] Fix manual binding infinite loopGreg KH1-1/+3
Fix for manual binding of drivers to devices. Problem is if you pass in a valid device id, but the driver refuses to bind. Infinite loop as write() tries to resubmit the data it just sent. Thanks to Michal Ostrowski <mostrows@watson.ibm.com> for pointing the problem out. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-08-16[PATCH] Driver core: potentially fix use after free in class_device_attr_showManeesh Soni1-4/+6
This moves the code to free devt_attr from class_device_del() to class_dev_release() which is called after the last reference to the corresponding kobject() is gone. This allows us to keep the devt_attr alive while the corresponding sysfs file is open. Signed-off-by: Maneesh Soni <maneesh@in.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-08-14[SCSI] correct transport class abstraction to work outside SCSIJames Bottomley2-6/+49
I recently tried to construct a totally generic transport class and found there were certain features missing from the current abstract transport class. Most notable is that you have to hang the data on the class_device but most of the API is framed in terms of the generic device, not the class_device. These changes are two fold - Provide the class_device to all of the setup and configure APIs - Provide and extra API to take the device and the attribute class and return the corresponding class_device Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-12[ACPI] merge acpi-2.6.12 branch into latest Linux 2.6.13-rc...Len Brown1-1/+0
Signed-off-by: Len Brown <len.brown@intel.com>
2005-07-11[ACPI] ACPI poweroff fixAlexey Starikovskiy1-1/+0
Register an "acpi" system device to be notified of shutdown preparation. This depends on CONFIG_PM http://bugzilla.kernel.org/show_bug.cgi?id=4041 Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2005-06-29[PATCH] Driver core: Use klist_del() instead of klist_remove().Patrick Mochel1-1/+1
Use klist_del() instead of klist_remove() when unregistering devices. This will prevent a deadlock when executing a recursive unregister using device_for_each_child(). Signed-off-by Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-29[PATCH] driver core: change bus_rescan_devices to return voidGreg Kroah-Hartman1-18/+9
No one was looking at the return value of bus_rescan_devices, and it really wasn't anything that anyone in the kernel would ever care about. So change it which enabled some counting code to be removed also. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-29[PATCH] driver core: Add the ability to bind drivers to devices from userspaceGreg Kroah-Hartman3-1/+28
This adds a single file, "bind", to the sysfs directory of every driver registered with the driver core. To bind a device to a driver, write the bus id of the device you wish to bind to that specific driver to the "bind" file (remember to not add a trailing \n). If that bus id matches a device on that bus, and it does not currently have a driver bound to it, the probe sequence will be initiated with that driver and device. Note, this requires that the driver itself be willing and able to accept that device (usually through a device id type table). This patch does not make it possible to override the driver's id table. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-29[PATCH] driver core: Add the ability to unbind drivers to devices from userspaceGreg Kroah-Hartman1-0/+30
This adds a single file, "unbind", to the sysfs directory of every device that is currently bound to a driver. To unbind the driver from the device, write anything to this file and they will be disconnected from each other. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-29[PATCH] driver core: add bus_find_device & driver_find_device functionsCornelia Huck2-0/+69
Add bus_find_device() and driver_find_device() which allow searching for a device in the bus's resp. the driver's klist and obtain a reference on it. Signed-off-by: Cornelia Huck <cohuck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-28[PATCH] request_firmware(): avoid race conditionsStanislaw W. Gruszka1-3/+10
Avoid race occurs when some process have open file descriptor for class device attributes and already firmware allocated memory are freed. Don't allow negative loading timeout. Signed-off-by: Stanislaw W. Gruszka <stf_xl@wp.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-25[PATCH] generate hotplug events for cpu onlineNathan Lynch1-0/+2
We already do kobject_hotplug for cpu offline; this adds a kobject_hotplug call for the online case. This is being requested by developers of an application which wants to be notified about both kinds of events. Signed-off-by: Nathan Lynch <ntl@pobox.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-25[PATCH] make smp_prepare_cpu to a weak functionAshok Raj1-4/+5
I really wish smp_prepare_cpu() would disappear eventually. In the interim this is ideally a weak function, so we dont end up changing several places to define this dummy in headers. Today since the dummy declaration is done only in drivers/base/cpu.c but the function is called in kernel/power/smp.c i get undefined reference in my cpu hotplug code for x86_64 under development. Signed-off-by: Ashok Raj <ashok.raj@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-25[PATCH] cpu state clean after hot removeLi Shaohua1-1/+7
Clean CPU states in order to reuse smp boot code for CPU hotplug. Signed-off-by: Li Shaohua<shaohua.li@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-22[PATCH] driver core: Fix up the device_attach() error handling in bus_add_device()Greg Kroah-Hartman1-3/+2
Don't error out if something "bad" happens when trying to bind a driver to a device. We want the sysfs attributes to be present for later when we try to tear down the device. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-21[PATCH] node local per-cpu-pagesChristoph Lameter1-1/+1
This patch modifies the way pagesets in struct zone are managed. Each zone has a per-cpu array of pagesets. So any particular CPU has some memory in each zone structure which belongs to itself. Even if that CPU is not local to that zone. So the patch relocates the pagesets for each cpu to the node that is nearest to the cpu instead of allocating the pagesets in the (possibly remote) target zone. This means that the operations to manage pages on remote zone can be done with information available locally. We play a macro trick so that non-NUMA pmachines avoid the additional pointer chase on the page allocator fastpath. AIM7 benchmark on a 32 CPU SGI Altix w/o patches: Tasks jobs/min jti jobs/min/task real cpu 1 484.68 100 484.6769 12.01 1.97 Fri Mar 25 11:01:42 2005 100 27140.46 89 271.4046 21.44 148.71 Fri Mar 25 11:02:04 2005 200 30792.02 82 153.9601 37.80 296.72 Fri Mar 25 11:02:42 2005 300 32209.27 81 107.3642 54.21 451.34 Fri Mar 25 11:03:37 2005 400 34962.83 78 87.4071 66.59 588.97 Fri Mar 25 11:04:44 2005 500 31676.92 75 63.3538 91.87 742.71 Fri Mar 25 11:06:16 2005 600 36032.69 73 60.0545 96.91 885.44 Fri Mar 25 11:07:54 2005 700 35540.43 77 50.7720 114.63 1024.28 Fri Mar 25 11:09:49 2005 800 33906.70 74 42.3834 137.32 1181.65 Fri Mar 25 11:12:06 2005 900 34120.67 73 37.9119 153.51 1325.26 Fri Mar 25 11:14:41 2005 1000 34802.37 74 34.8024 167.23 1465.26 Fri Mar 25 11:17:28 2005 with slab API changes and pageset patch: Tasks jobs/min jti jobs/min/task real cpu 1 485.00 100 485.0000 12.00 1.96 Fri Mar 25 11:46:18 2005 100 28000.96 89 280.0096 20.79 150.45 Fri Mar 25 11:46:39 2005 200 32285.80 79 161.4290 36.05 293.37 Fri Mar 25 11:47:16 2005 300 40424.15 84 134.7472 43.19 438.42 Fri Mar 25 11:47:59 2005 400 39155.01 79 97.8875 59.46 590.05 Fri Mar 25 11:48:59 2005 500 37881.25 82 75.7625 76.82 730.19 Fri Mar 25 11:50:16 2005 600 39083.14 78 65.1386 89.35 872.79 Fri Mar 25 11:51:46 2005 700 38627.83 77 55.1826 105.47 1022.46 Fri Mar 25 11:53:32 2005 800 39631.94 78 49.5399 117.48 1169.94 Fri Mar 25 11:55:30 2005 900 36903.70 79 41.0041 141.94 1310.78 Fri Mar 25 11:57:53 2005 1000 36201.23 77 36.2012 160.77 1458.31 Fri Mar 25 12:00:34 2005 Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Shobhit Dayal <shobhit@calsoftinc.com> Signed-off-by: Shai Fultheim <Shai@Scalex86.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-20[PATCH] Driver core: Don't "lose" devices on suspend on failureBenjamin Herrenschmidt1-1/+12
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>
2005-06-20[PATCH] Driver Core: drivers/base - drivers/i2c/chips/adm1026.c: update device attribute callbacksYani Ioannou2-3/+3
Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-20[PATCH] Driver core: change device_attribute callbacksYani Ioannou1-2/+2
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>
2005-06-20[PATCH] driver core: fix error handling in bus_add_deviceHannes Reinecke2-6/+10
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>
2005-06-20[PATCH] Driver core: unregister_node() for hotplug useKeiichiro Tokunaga1-2/+18
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
2005-06-20[PATCH] driver core: Fix races in driver_detach()Alan Stern1-13/+38
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>
2005-06-20[PATCH] Driver Core: fix bk-driver-core kills ppc64Patrick Mochel1-68/+74
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>
2005-06-20[PATCH] Driver core: Fix up the driver and device iterators to be quietergregkh@suse.de1-13/+19
Also stops looping over the lists when a match is found. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de
2005-06-20[PATCH] driver core: change export symbol for driver_for_each_device()gregkh@suse.de1-1/+1
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Index: linux-2.6.12-rc2/drivers/base/driver.c ===================================================================
2005-06-20[PATCH] Fix up bogus comment.mochel@digitalimplant.org1-2/+1
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
2005-06-20[PATCH] Use a klist for device child lists.mochel@digitalimplant.org1-15/+15
- 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>
2005-06-20[PATCH] Call klist_del() instead of klist_remove().mochel@digitalimplant.org1-1/+1
- 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>
2005-06-20[PATCH] Remove struct device::driver_list.mochel@digitalimplant.org1-1/+0
Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-20[PATCH] Remove struct device::bus_list.mochel@digitalimplant.org1-1/+0
Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-20[PATCH] Fix up bus code and remove use of rwsem.mochel@digitalimplant.org1-12/+0
- 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>
2005-06-20[PATCH] Use bus_for_each_{dev,drv} for driver binding.mochel@digitalimplant.org1-33/+39
- 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>