1. 11 1月, 2006 2 次提交
  2. 07 1月, 2006 2 次提交
  3. 06 1月, 2006 1 次提交
  4. 05 1月, 2006 7 次提交
    • A
      [PATCH] drivers/base/power/runtime.c: #if 0 dpm_set_power_state() · 1f1bf132
      Adrian Bunk 提交于
      This patch #if 0's an unused global function.
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1f1bf132
    • 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
    • D
      [PATCH] Driver Core: Rearrange exports in platform.c · a96b2042
      Dmitry Torokhov 提交于
      Driver core: rearrange exports in platform.c
      
      The new way is to specify export right after symbol definition.
      Rearrange exports to follow new style to avoid mixing two styles
      in one file.
      Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a96b2042
    • D
      [PATCH] Driver Core: Add platform_device_del() · 93ce3061
      Dmitry Torokhov 提交于
      Driver core: add platform_device_del function
      
      Having platform_device_del90 allows more straightforward error
      handling code in drivers registering platform devices.
      Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      93ce3061
    • K
      [PATCH] Allow overlapping resources for platform devices · d960bb4d
      Kumar Gala 提交于
      There are cases in which a device's memory mapped registers overlap
      with another device's memory mapped registers.  On several PowerPC
      devices this occurs for the MDIO bus, whose registers tended to overlap
      with one of the ethernet controllers.
      
      By switching from request_resource to insert_resource we can register
      the MDIO bus as a proper platform device and not hack around how we
      handle its memory mapped registers.
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d960bb4d
    • 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
    • K
      [PATCH] driver core: replace "hotplug" by "uevent" · 312c004d
      Kay Sievers 提交于
      Leave the overloaded "hotplug" word to susbsystems which are handling
      real devices. The driver core does not "plug" anything, it just exports
      the state to userspace and generates events.
      Signed-off-by: NKay Sievers <kay.sievers@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      312c004d
  5. 16 12月, 2005 1 次提交
  6. 24 11月, 2005 1 次提交
  7. 14 11月, 2005 1 次提交
  8. 10 11月, 2005 1 次提交
    • R
      [DRIVER MODEL] Add platform_driver · 00d3dcdd
      Russell King 提交于
      Introduce struct platform_driver.  This allows the platform device
      driver methods to be passed a platform_device structure instead of
      instead of a plain device structure, and therefore requiring casting
      in every platform driver.
      
      We introduce this in such a way that any existing platform drivers
      registered directly via driver_register continue to work as before,
      thereby allowing a gradual conversion to the new platform_driver
      methods.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      00d3dcdd
  9. 07 11月, 2005 1 次提交
  10. 06 11月, 2005 1 次提交
  11. 31 10月, 2005 3 次提交
  12. 30 10月, 2005 3 次提交
  13. 29 10月, 2005 11 次提交
    • A
      [PATCH] USB: fix pm patches with CONFIG_PM off part 2 · 9a7834d0
      Andrew Morton 提交于
      With CONFIG_PM=n:
      
      drivers/built-in.o(.text+0x1098c): In function `hub_thread':
      drivers/usb/core/hub.c:2673: undefined reference to `.dpm_runtime_resume'
      drivers/built-in.o(.text+0x10998):drivers/usb/core/hub.c:2674: undefined reference to `.dpm_runtime_resume'
      
      Please, never ever ever put extern decls into .c files.  Use the darn header
      files :(
      
      Cc: David Brownell <david-b@pacbell.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9a7834d0
    • D
      [PATCH] root hub changes (lesser half) · 979d5199
      David Brownell 提交于
      This patch collects various small updates related to root hubs, to shrink
      later patches which build on them.
      
        - For root hub suspend/resume support:
           * Make the existing usb_hcd_resume_root_hub() routine respect pmcore
             locking, exporting and using the dpm_runtime_resume() method.
           * Add a new usb_hcd_suspend_root_hub() to pair with that routine.
             (Essential to make OHCI autosuspend behave again...)
           * HC_SUSPENDED by itself only refers to the root hub's downstream ports.
             So let HCDs see root hub URBs unless the parent device is suspended.
      
        - Remove an assertion we no longer need (and now, also don't want).
      
        - Generic suspend/resume updates to work better with swsusp.
           * Ignore the FREEZE vs SUSPEND distinction for hardware; trying to
             use it breaks the swsusp snapshots it's supposed to help (sigh).
           * On resume, mark devices as resumed right away, but then
             do nothing else if the device is marked NOTATTACHED.
      
      These changes shouldn't be very noticable by themselves.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/base/power/runtime.c |    1
       drivers/usb/core/hcd.c       |   64 ++++++++++++++++++++++++++++++++++++++-----
       drivers/usb/core/hcd.h       |    1
       drivers/usb/core/hub.c       |   45 ++++++++++++++++++++++++------
       drivers/usb/core/usb.c       |   20 +++++++++----
       drivers/usb/core/usb.h       |    1
       6 files changed, 111 insertions(+), 21 deletions(-)
      979d5199
    • D
      [PATCH] one less word in struct device · e9b7bd4e
      David Brownell 提交于
      This saves a word from "struct device" ... there's a refcounting mechanism
      stub that's rather ineffective (the values are never even tested!), which
      can safely be deleted.  With this patch it uses normal device refcounting,
      so any potential users of the pm_parent mechanism will be more correct.
      (That mechanism is actually unusable for now though; it does nothing.)
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/base/power/main.c |   26 +++-----------------------
       include/linux/pm.h        |    1 -
       2 files changed, 3 insertions(+), 24 deletions(-)
      e9b7bd4e
    • R
      [PATCH] kernel-doc: drivers/base fixes · c41455fb
      Randy Dunlap 提交于
      driver/base: add missing function parameters; eliminate all warnings.
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c41455fb
    • R
      [PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks · 9480e307
      Russell King 提交于
      In PM v1, all devices were called at SUSPEND_DISABLE level.  Then
      all devices were called at SUSPEND_SAVE_STATE level, and finally
      SUSPEND_POWER_DOWN level.  However, with PM v2, to maintain
      compatibility for platform devices, I arranged for the PM v2
      suspend/resume callbacks to call the old PM v1 suspend/resume
      callbacks three times with each level in order so that existing
      drivers continued to work.
      
      Since this is obsolete infrastructure which is no longer necessary,
      we can remove it.  Here's an (untested) patch to do exactly that.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9480e307
    • B
      [PATCH] drivers/base - fix sparse warnings · a1bdc7aa
      Ben Dooks 提交于
      There are a number of sparse warnings from the latest sparse
      snapshot being generated from the drivers/base build. The
      main culprits are due to the initialisation functions not
      being declared in a header file.
      
      Also, the firmware.c file should include <linux/device.h>
      to get the prototype of  firmware_register() and
      firmware_unregister().
      
      This patch moves the init function declerations from the
      init.c file to the base.h, and ensures it is included in
      all the relevant c sources. It also adds <linux/device.h>
      to the included headers for firmware.c.
      
      The patch does not solve all the sparse errors generated,
      but reduces the count significantly.
      
      drivers/base/core.c:161:1: warning: symbol 'devices_subsys' was not declared. Should it be static?
      drivers/base/core.c:417:12: warning: symbol 'devices_init' was not declared. Should it be static?
      drivers/base/sys.c:253:6: warning: symbol 'sysdev_shutdown' was not declared. Should it be static?
      drivers/base/sys.c:326:5: warning: symbol 'sysdev_suspend' was not declared. Should it be static?
      drivers/base/sys.c:428:5: warning: symbol 'sysdev_resume' was not declared. Should it be static?
      drivers/base/sys.c:450:12: warning: symbol 'system_bus_init' was not declared. Should it be static?
      drivers/base/bus.c:133:1: warning: symbol 'bus_subsys' was not declared. Should it be static?
      drivers/base/bus.c:667:12: warning: symbol 'buses_init' was not declared. Should it be static?
      drivers/base/class.c:759:12: warning: symbol 'classes_init' was not declared. Should it be static?
      drivers/base/platform.c:313:12: warning: symbol 'platform_bus_init' was not declared. Should it be static?
      drivers/base/cpu.c:110:12: warning: symbol 'cpu_dev_init' was not declared. Should it be static?
      drivers/base/firmware.c:17:5: warning: symbol 'firmware_register' was not declared. Should it be static?
      drivers/base/firmware.c:23:6: warning: symbol 'firmware_unregister' was not declared. Should it be static?
      drivers/base/firmware.c:28:12: warning: symbol 'firmware_init' was not declared. Should it be static?
      drivers/base/init.c:28:13: warning: symbol 'driver_init' was not declared. Should it be static?
      drivers/base/dmapool.c:174:10: warning: implicit cast from nocast type
      drivers/base/attribute_container.c:439:1: warning: symbol 'attribute_container_init' was not declared. Should it be static?
      drivers/base/power/runtime.c:76:6: warning: symbol 'dpm_set_power_state' was not declared. Should it be static?
      Signed-off-by: NBen Dooks <ben-linux@fluff.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a1bdc7aa
    • G
      [PATCH] Driver Core: add the ability for class_device structures to be nested · 51d172d5
      Greg Kroah-Hartman 提交于
      This patch allows struct class_device to be nested, so that another
      struct class_device can be the parent of a new one, instead of only
      having the struct class be the parent.  This will allow us to
      (hopefully) fix up the input and video class subsystem mess.
      
      But please people, don't go crazy and start making huge trees of class
      devices, you should only need 2 levels deep to get everything to work
      (remember to use a class_interface to get notification of a new class
      device being added to the system.)
      
      Oh, this also allows us to have the possibility of potentially, someday,
      moving /sys/block into /sys/class.  The main hindrance is that pesky
      /dev numberspace issue...
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      51d172d5
    • K
      [PATCH] add sysfs attr to re-emit device hotplug event · a7fd6706
      Kay Sievers 提交于
      A "coldplug + udevstart" can be simple like this:
        for i in /sys/block/*/*/uevent; do echo 1 > $i; done
        for i in /sys/class/*/*/uevent; do echo 1 > $i; done
        for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done
      Signed-off-by: NKay Sievers <kay.sievers@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a7fd6706
    • D
      [PATCH] Driver core: pass interface to class interface methods · d8539d81
      Dmitry Torokhov 提交于
      Driver core: pass interface to class intreface methods
      
      Pass interface as argument to add() and remove() class interface
      methods. This way a subsystem can implement generic add/remove
      handlers and then call interface-specific ones.
      Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d8539d81
    • D
      [PATCH] Driver core: send hotplug event before adding class interfaces · dbe9035d
      Dmitry Torokhov 提交于
      Move call to kobject_hotplug() above code that adds interfaces
      to a class device, otherwise children's hotplug events may reach
      userspace first.
      Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      dbe9035d
    • D
      [PATCH] driver model wakeup flags · 0ac85241
      David Brownell 提交于
      This is a refresh of an earlier patch to add "wakeup" support to the
      PM core model.  This provides per-device bus-neutral control of the
      use of wakeup events.
      
        * "struct device_pm_info" has two bits that are initialized as
          part of setting up the enclosing struct device:
            - "can_wakeup", reflecting hardware capabilities
            - "may_wakeup", the policy setting (when CONFIG_PM)
      
        * There's a writeable sysfs "wakeup" file, with one of two values:
            - "enabled", when the policy is to allow wakeup
            - "disabled", when the policy is not to allow it
            - "" if the device can't currently issue wakeups
      
      By default, wakeup is enabled on all devices that support it.  If its
      driver doesn't support it ... treat it as a bug.  :)
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0ac85241
  14. 09 10月, 2005 1 次提交
  15. 22 9月, 2005 2 次提交
    • B
      [PATCH] fix class symlinks in sysfs · 3e51377d
      Bill Nottingham 提交于
      The class symlinks in sysfs don't properly handle changing device names.
      
      To demonstrate, rename your network device from eth0 to eth1. Your
      pci (or usb, or whatever) device will still have a 'net:eth0' link,
      except now it points to /sys/class/net/eth1.
      
      The attached patch makes sure the class symlink name changes when
      the class device name changes. It isn't 100% correct, it should be
      using sysfs_rename_link. Unfortunately, sysfs_rename_link doesn't exist.
      Signed-off-by: NBill Nottingham <notting@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3e51377d
    • D
      [PATCH] Driver Core: fis bus rescan devices race · 4c898c7f
      Daniel Ritz 提交于
      bus_rescan_devices_helper() does not hold the dev->sem when it checks for
      !dev->driver().  device_attach() holds the sem, but calls again
      device_bind_driver() even when dev->driver is set.
      
      What happens is that a first device_attach() call (module insertion time)
      is on the way binding the device to a driver.  Another thread calls
      bus_rescan_devices().  Now when bus_rescan_devices_helper() checks for
      dev->driver it is still NULL 'cos the the prior device_attach() is not yet
      finished.  But as soon as the first one releases the dev->sem the second
      device_attach() tries to rebind the already bound device again.
      device_bind_driver() does this blindly which leads to a corrupt
      driver->klist_devices list (the device links itself, the head points to the
      device).  Later a call to device_release_driver() sets dev->driver to NULL
      and breaks the link it has to itself on knode_driver.  Rmmoding the driver
      later calls driver_detach() which leads to an endless loop 'cos the list
      head in klist_devices still points to the device.  And since dev->driver is
      NULL it's stuck with the same device forever.  Boom.  And rmmod hangs.
      
      Very easy to reproduce with new-style pcmcia and a 16bit card.  Just loop
      modprobe <pcmcia-modules> ;cardctl eject; rmmod <card driver, pcmcia
      modules>.
      
      Easiest fix is to check if the device is already bound to a driver in
      device_bind_driver().  This avoids the double binding.
      Signed-off-by: NDaniel Ritz <daniel.ritz@gmx.ch>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4c898c7f
  16. 13 9月, 2005 1 次提交
  17. 11 9月, 2005 1 次提交