1. 22 7月, 2008 2 次提交
  2. 11 6月, 2008 1 次提交
    • R
      Introduce new top level suspend and hibernation callbacks · 1eede070
      Rafael J. Wysocki 提交于
      Introduce 'struct pm_ops' and 'struct pm_ext_ops' ('ext' meaning
      'extended') representing suspend and hibernation operations for bus
      types, device classes, device types and device drivers.
      
      Modify the PM core to use 'struct pm_ops' and 'struct pm_ext_ops'
      objects, if defined, instead of the ->suspend(), ->resume(),
      ->suspend_late(), and ->resume_early() callbacks (the old callbacks
      will be considered as legacy and gradually phased out).
      
      The main purpose of doing this is to separate suspend (aka S2RAM and
      standby) callbacks from hibernation callbacks in such a way that the
      new callbacks won't take arguments and the semantics of each of them
      will be clearly specified.  This has been requested for multiple
      times by many people, including Linus himself, and the reason is that
      within the current scheme if ->resume() is called, for example, it's
      difficult to say why it's been called (ie. is it a resume from RAM or
      from hibernation or a suspend/hibernation failure etc.?).
      
      The second purpose is to make the suspend/hibernation callbacks more
      flexible so that device drivers can handle more than they can within
      the current scheme.  For example, some drivers may need to prevent
      new children of the device from being registered before their
      ->suspend() callbacks are executed or they may want to carry out some
      operations requiring the availability of some other devices, not
      directly bound via the parent-child relationship, in order to prepare
      for the execution of ->suspend(), etc.
      
      Ultimately, we'd like to stop using the freezing of tasks for suspend
      and therefore the drivers' suspend/hibernation code will have to take
      care of the handling of the user space during suspend/hibernation.
      That, in turn, would be difficult within the current scheme, without
      the new ->prepare() and ->complete() callbacks.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      1eede070
  3. 30 5月, 2008 1 次提交
  4. 21 5月, 2008 1 次提交
    • G
      Driver core: add device_create_vargs and device_create_drvdata · 8882b394
      Greg Kroah-Hartman 提交于
      We want to have the drvdata field set properly when creating the device
      as sysfs callbacks can assume it is present and it can race the later
      setting of this field.
      
      So, create two new functions, deviec_create_vargs() and
      device_create_drvdata() that take this new field.
      
      device_create_drvdata() will go away in 2.6.27 as the drvdata field will
      just be moved to the device_create() call as it should be.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8882b394
  5. 15 5月, 2008 1 次提交
  6. 03 5月, 2008 1 次提交
  7. 01 5月, 2008 1 次提交
  8. 20 4月, 2008 4 次提交
    • 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
    • G
      Driver core: make device_is_registered() work for class devices · 3f62e570
      Greg Kroah-Hartman 提交于
      device_is_registered() can use the kobject value for this, so it will
      now work with devices that are associated with only a class, not a bus
      and a driver.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3f62e570
    • A
      PM: Convert wakeup flag accessors to inline functions · 9a3df1f7
      Alan Stern 提交于
      This patch (as1058) improves the wakeup macros in include/linux/pm.h.
      All but the trivial ones are converted to inline routines, which
      requires moving them to a separate header file since they depend on
      the definition of struct device.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9a3df1f7
    • J
      driver core: Convert debug functions declared inline __attribute__((format... · 1429db83
      Joe Perches 提交于
      driver core: Convert debug functions declared inline __attribute__((format (printf,x,y) to statement expression macros
      
      When DEBUG is not defined, pr_debug and dev_dbg and some
      other local debugging functions are specified as:
      
      "inline __attribute__((format (printf, x, y)))"
      
      This is done to validate printk arguments when not debugging.
      
      Converting these functions to macros or statement expressions
      "do { if (0) printk(fmt, ##arg); } while (0)"
      or
      "({ if (0) printk(fmt, ##arg); 0; })
      makes at least gcc 4.2.2 produce smaller objects.
      
      This has the additional benefit of allowing the optimizer to
      avoid calling functions like print_mac that might have been
      arguments to the printk.
      
      defconfig x86 current:
      
      $ size vmlinux
         text    data     bss     dec     hex filename
      4716770  474560  618496 5809826  58a6a2 vmlinux
      
      all converted: (More patches follow)
      
      $ size vmlinux
         text    data     bss     dec     hex filename
      4716642  474560  618496 5809698  58a622 vmlinux
      
      Even kernel/sched.o, which doesn't even use these
      functions, becomes smaller.
      
      It appears that merely having an indirect include
      of <linux/device.h> can cause bigger objects.
      
      $ size sched.inline.o sched.if0.o
         text    data     bss     dec     hex filename
        31385    2854     328   34567    8707 sched.inline.o
        31366    2854     328   34548    86f4 sched.if0.o
      
      The current preprocessed only kernel/sched.i file contains:
      
      # 612 "include/linux/device.h"
      static inline __attribute__((always_inline)) int __attribute__ ((format (printf, 2, 3)))
      dev_dbg(struct device *dev, const char *fmt, ...)
      {
       return 0;
      }
      # 628 "include/linux/device.h"
      static inline __attribute__((always_inline)) int __attribute__ ((format (printf, 2, 3)))
      dev_vdbg(struct device *dev, const char *fmt, ...)
      {
       return 0;
      }
      
      Removing these unused inlines from sched.i shrinks sched.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      1429db83
  9. 19 4月, 2008 1 次提交
  10. 06 2月, 2008 1 次提交
    • F
      iommu sg merging: add device_dma_parameters structure · 6b7b6510
      FUJITA Tomonori 提交于
      IOMMUs merges scatter/gather segments without considering a low level
      driver's restrictions. The problem is that IOMMUs can't access to the
      limitations because they are in request_queue.
      
      This patchset introduces a new structure, device_dma_parameters,
      including dma information. A pointer to device_dma_parameters is added
      to struct device. The bus specific structures (like pci_dev) includes
      device_dma_parameters. Low level drivers can use dma_set_max_seg_size
      to tell IOMMUs about the restrictions.
      
      We can move more dma stuff in struct device (like dma_mask) to struct
      device_dma_parameters later (needs some cleanups before that).
      
      This includes patches for all the IOMMUs that could merge sg (x86_64,
      ppc, IA64, alpha, sparc64, and parisc) though only the ppc patch was
      tested. The patches for other IOMMUs are only compile tested.
      
      This patch:
      
      Add a new structure, device_dma_parameters, including dma information.  A
      pointer to device_dma_parameters is added to struct device.
      
      - there are only max_segment_size and segment_boundary_mask there but we'll
        move more dma stuff in struct device (like dma_mask) to struct
        device_dma_parameters later.  segment_boundary_mask is not supported yet.
      
      - new accessors for the dma parameters are added.  So we can easily change
        where to place struct device_dma_parameters in the future.
      
      - dma_get_max_seg_size returns 64K if dma_parms in struct device isn't set
        up properly.  64K is the default max_segment_size in the block layer.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Acked-by: NJeff Garzik <jeff@garzik.org>
      Cc: James Bottomley <James.Bottomley@steeleye.com>
      Acked-by: NJens Axboe <jens.axboe@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6b7b6510
  11. 03 2月, 2008 1 次提交
  12. 28 1月, 2008 1 次提交
  13. 25 1月, 2008 14 次提交
  14. 01 11月, 2007 1 次提交
  15. 31 10月, 2007 1 次提交
  16. 13 10月, 2007 2 次提交
  17. 27 7月, 2007 1 次提交
  18. 19 7月, 2007 1 次提交
    • D
      dev_vdbg(), available with -DVERBOSE_DEBUG · aebdc3b4
      David Brownell 提交于
      This defines a dev_vdbg() call, which is enabled with -DVERBOSE_DEBUG.
      When enabled, dev_vdbg() acts just like dev_dbg().  When disabled, it is a
      NOP ...  just like dev_dbg() without -DDEBUG.  The specific code was moved
      out of a USB patch, but lots of drivers have similar support.
      
      That is, code can now be written to use an additional level of debug
      output, selected at compile time.  Many driver authors have found this
      idiom to be very useful.  A typical usage model is for "normal" debug
      messages to focus on fault paths and not be very "chatty", so that those
      messages can be left on during normal operation without much of a
      performance or syslog load.  On the other hand "verbose" messages would be
      noisy enough that they wouldn't normally be enabled; they might even affect
      timings enough to change system or driver behavior.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      aebdc3b4
  19. 12 7月, 2007 1 次提交
    • 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
  20. 09 5月, 2007 1 次提交
    • D
      fix hotplug for legacy platform drivers · 49a4ec18
      David Brownell 提交于
      We've had various reports of some legacy "probe the hardware" style
      platform drivers having nasty problems with hotplug support.
      
      The core issue is that those legacy drivers don't fully conform to the
      driver model.  They assume a role that should be the responsibility of
      infrastructure code: creating device nodes.
      
      The "modprobe" step in hotplugging relies on drivers to have split those
      roles into different modules.  The lack of this split causes the problems.
      When a driver creates nodes for devices that don't exist (sending a hotplug
      event), then exits (aborting one modprobe) before the "modprobe $MODALIAS"
      step completes (by failing, since it's in the middle of a modprobe), the
      result can be an endless loop of modprobe invocations ...  badness.
      
      This fix uses the newish per-device flag controlling issuance of "add"
      events.  (A previous version of this patch used a per-device "driver can
      hotplug" flag, which only scrubbed $MODALIAS from the environment rather
      than suppressing the entire hotplug event.) It also shrinks that flag to
      one bit, saving a word in "struct device".
      
      So the net of this patch is removing some nasty failures with legacy
      drivers, while retaining hotplug capability for the majority of platform
      drivers.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Greg KH <gregkh@suse.de>
      Cc: Andres Salomon <dilinger@debian.org>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      49a4ec18
  21. 03 5月, 2007 2 次提交