1. 20 4月, 2008 3 次提交
    • R
      PM: Remove destroy_suspended_device() · b844eba2
      Rafael J. Wysocki 提交于
      After 2.6.24 there was a plan to make the PM core acquire all device
      semaphores during a suspend/hibernation to protect itself from
      concurrent operations involving device objects.  That proved to be
      too heavy-handed and we found a better way to achieve the goal, but
      before it happened, we had introduced the functions
      device_pm_schedule_removal() and destroy_suspended_device() to allow
      drivers to "safely" destroy a suspended device and we had adapted some
      drivers to use them.  Now that these functions are no longer necessary,
      it seems reasonable to remove them and modify their users to use the
      normal device unregistration instead.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b844eba2
    • R
      Driver core: Call device_pm_add() after bus_add_device() in device_add() · 57eee3d2
      Rafael J. Wysocki 提交于
      Include dpm_sysfs_add() into device_pm_add(), in analogy with
      device_pm_remove(), and modify device_add() to call the latter after
      bus_add_device(), to avoid situations in which the PM core may
      attempt to suspend a device the registration of which has not been
      successful.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      57eee3d2
    • R
      PM: Handle device registrations during suspend/resume · 58aca232
      Rafael J. Wysocki 提交于
      Modify the PM core to protect its data structures, specifically the
      dpm_active list, from being corrupted if a child of the currently
      suspending device is registered concurrently with its ->suspend()
      callback.  In that case, since the new device (the child) is added
      to dpm_active after its parent, the PM core will attempt to
      suspend it after the parent, which is wrong.
      
      Introduce a new member of struct dev_pm_info, called 'sleeping',
      and use it to check if the parent of the device being added to
      dpm_active has been suspended, in which case the device registration
      fails.  Also, use 'sleeping' for checking if the ordering of devices
      on dpm_active is correct.
      
      Introduce variable 'all_sleeping' that will be set to 'true' once all
      devices have been suspended and make new device registrations fail
      until 'all_sleeping' is reset to 'false', in order to avoid having
      unsuspended devices around while the system is going into a sleep state.
      
      Remove pm_sleep_rwsem which is not necessary any more.
      
      Special thanks to Alan Stern for discussions and suggestions that
      lead to the creation of this patch.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      58aca232
  2. 25 3月, 2008 1 次提交
  3. 05 3月, 2008 3 次提交
  4. 03 2月, 2008 2 次提交
  5. 28 1月, 2008 1 次提交
    • G
      Driver core: Fix up build when CONFIG_BLOCK=N · 4e886c29
      Greg Kroah-Hartman 提交于
      This fixes up the driver core build errors when CONFIG_BLOCK=N
      
      Thanks to Alexander van Heukelum <heukelum@mailshack.com> for the basis
      of this patch, and to Jeremy Fitzhardinge <jeremy@goop.org> for
      reporting the problem.
      
      
      Cc: Alexander van Heukelum <heukelum@mailshack.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4e886c29
  6. 25 1月, 2008 16 次提交
  7. 29 11月, 2007 1 次提交
  8. 31 10月, 2007 1 次提交
    • K
      Driver Core: fix bug in device_rename() for SYSFS_DEPRECATED=y · 60b8cabd
      Kay Sievers 提交于
      This should fix the sysfs warnings that renaming network devices is
      causing to show up with CONFIG_SYSFS_DEPRECATED=y
      
      The code just shouldn't run if class devices are real directories, it's
      an update for the symlink in the class directory. Nobody noticed that as
      long as the creation of sysfs files silently failed, and we both missed
      it before the merge, because we don't run SYSFS_DEPRECATED=y.        
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Cc: Larry Finger <Larry.Finger@lwfinger.net>
      Cc: David Miller <davem@davemloft.net>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      60b8cabd
  9. 13 10月, 2007 3 次提交
  10. 08 10月, 2007 1 次提交
  11. 27 9月, 2007 1 次提交
  12. 20 9月, 2007 1 次提交
  13. 31 7月, 2007 2 次提交
  14. 19 7月, 2007 2 次提交
  15. 12 7月, 2007 2 次提交
    • T
      driver-core: make devt_attr and uevent_attr static · ad6a1e1c
      Tejun Heo 提交于
      devt_attr and uevent_attr are either allocated dynamically with or
      embedded in device and class_device as they needed their owner field
      set to the module implementing the driver.  Now that sysfs implements
      immediate disconnect and owner field removed from struct attribute,
      there is no reason to do this.  Remove these attributes from
      [class_]device and use static attribute structures instead.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ad6a1e1c
    • T
      sysfs: kill unnecessary attribute->owner · 7b595756
      Tejun Heo 提交于
      sysfs is now completely out of driver/module lifetime game.  After
      deletion, a sysfs node doesn't access anything outside sysfs proper,
      so there's no reason to hold onto the attribute owners.  Note that
      often the wrong modules were accounted for as owners leading to
      accessing removed modules.
      
      This patch kills now unnecessary attribute->owner.  Note that with
      this change, userland holding a sysfs node does not prevent the
      backing module from being unloaded.
      
      For more info regarding lifetime rule cleanup, please read the
      following message.
      
        http://article.gmane.org/gmane.linux.kernel/510293
      
      (tweaked by Greg to not delete the field just yet, to make it easier to
      merge things properly.)
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7b595756