1. 15 4月, 2006 1 次提交
    • R
      [PATCH] driver core: driver_bind attribute returns incorrect value · 37225401
      Ryan Wilson 提交于
      The manual driver <-> device binding attribute in sysfs doesn't return
      the correct value on failure or success of driver_probe_device.
      driver_probe_device returns 1 on success (the driver accepted the
      device) or 0 on probe failure (when the driver didn't accept the
      device but no real error occured). However, the attribute can't just
      return 0 or 1, it must return the number of bytes consumed from buf
      or an error value. Returning 0 indicates to userspace that nothing
      was written (even though the kernel has tried to do the bind/probe and
      failed). Returning 1 indicates that only one character was accepted in
      which case userspace will re-try the write with a partial string.
      
      A more correct version of driver_bind would return count (to indicate
      the entire string was consumed) when driver_probe_device returns 1
      and -ENODEV when driver_probe_device returns 0. This patch makes that
      change.
      Signed-off-by: NRyan Wilson <hap9@epoch.ncsc.mil>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      37225401
  2. 15 3月, 2006 1 次提交
  3. 08 2月, 2006 1 次提交
  4. 07 2月, 2006 1 次提交
  5. 05 1月, 2006 2 次提交
    • G
      [PATCH] Driver core: only all userspace bind/unbind if CONFIG_HOTPLUG is enabled · 874c6241
      Greg Kroah-Hartman 提交于
      Thanks to drivers making their id tables __devinit, we can't allow
      userspace to bind or unbind drivers from devices manually through sysfs.
      So we only allow this if CONFIG_HOTPLUG is enabled.
      
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      874c6241
    • A
      [PATCH] Hold the device's parent's lock during probe and remove · bf74ad5b
      Alan Stern 提交于
      This patch (as604) makes the driver core hold a device's parent's lock
      as well as the device's lock during calls to the probe and remove
      methods in a driver.  This facility is needed by USB device drivers,
      owing to the peculiar way USB devices work:
      
      	A device provides multiple interfaces, and drivers are bound
      	to interfaces rather than to devices;
      
      	Nevertheless a reset, reset-configuration, suspend, or resume
      	affects the entire device and requires the caller to hold the
      	lock for the device, not just a lock for one of the interfaces.
      
      Since a USB driver's probe method is always called with the interface
      lock held, the locking order rules (always lock parent before child)
      prevent these methods from acquiring the device lock.  The solution
      provided here is to call all probe and remove methods, for all devices
      (not just USB), with the parent lock already acquired.
      
      Although currently only the USB subsystem requires these changes, people
      have mentioned in prior discussion that the overhead of acquiring an
      extra semaphore in all the prove/remove sequences is not overly large.
      
      Up to now, the USB core has been using its own set of private
      semaphores.  A followup patch will remove them, relying entirely on the
      device semaphores provided by the driver core.
      
      The code paths affected by this patch are:
      
      	device_add and device_del: The USB core already holds the parent
      	lock, so no actual change is needed.
      
      	driver_register and driver_unregister: The driver core will now
      	lock both the parent and the device before probing or removing.
      
      	driver_bind and driver_unbind (in sysfs): These routines will
      	now lock both the parent and the device before binding or
      	unbinding.
      
      	bus_rescan_devices: The helper routine will lock the parent
      	before probing a device.
      
      I have not tested this patch for conflicts with other subsystems.  As
      far as I can see, the only possibility of conflict would lie in the
      bus_rescan_devices pathway, and it seems pretty remote.  Nevertheless,
      it would be good for this to get a lot of testing in -mm.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bf74ad5b
  6. 24 11月, 2005 1 次提交
  7. 08 9月, 2005 1 次提交
  8. 06 9月, 2005 2 次提交
  9. 18 8月, 2005 1 次提交
  10. 30 6月, 2005 4 次提交
  11. 23 6月, 2005 1 次提交
  12. 21 6月, 2005 7 次提交
  13. 18 5月, 2005 1 次提交
    • D
      [PATCH] Driver Core: remove driver model detach_state · 0b405a0f
      David Brownell 提交于
      The driver model has a "detach_state" mechanism that:
      
       - Has never been used by any in-kernel drive;
       - Is superfluous, since driver remove() methods can do the same thing;
       - Became buggy when the suspend() parameter changed semantics and type;
       - Could self-deadlock when called from certain suspend contexts;
       - Is effectively wasted documentation, object code, and headspace.
      
      This removes that "detach_state" mechanism; net code shrink, as well
      as a per-device saving in the driver model and sysfs.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0b405a0f
  14. 05 5月, 2005 1 次提交
    • R
      [PATCH] drivers/base/bus.c: fix iteration in driver_detach() · b2d84f07
      Roman Kagan 提交于
      With 2.6.11 and 2.6.12-rc2 (and perhaps a few versions before) usb
      drivers for multi-interface devices, which do
      usb_driver_release_interface() in their disconnect(), make rmmod hang.
      
      It turns out to be due to a bug in drivers/base/bus.c:driver_detach(),
      that iterates over the list of attached devices with
      list_for_each_safe() under an assumption that device_release_driver()
      only releases the current device, while it may also call
      device_release_driver() for other devices on the same list.
      
      The following patch fixes it.  Please consider applying.
      Signed-off-by: NRoman Kagan <rkagan@mail.ru>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b2d84f07
  15. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4