1. 15 3月, 2011 22 次提交
    • A
      PM: Documentation/power/states.txt: fix repetition · a8b7228c
      Alexandre Courbot 提交于
      Remove repetition of "called swsusp".
      Signed-off-by: NAlexandre Courbot <gnurou@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      a8b7228c
    • R
      PM: Make system-wide PM and runtime PM treat subsystems consistently · 9659cc06
      Rafael J. Wysocki 提交于
      The code handling system-wide power transitions (eg. suspend-to-RAM)
      can in theory execute callbacks provided by the device's bus type,
      device type and class in each phase of the power transition.  In
      turn, the runtime PM core code only calls one of those callbacks at
      a time, preferring bus type callbacks to device type or class
      callbacks and device type callbacks to class callbacks.
      
      It seems reasonable to make them both behave in the same way in that
      respect.  Moreover, even though a device may belong to two subsystems
      (eg. bus type and device class) simultaneously, in practice power
      management callbacks for system-wide power transitions are always
      provided by only one of them (ie. if the bus type callbacks are
      defined, the device class ones are not and vice versa).  Thus it is
      possible to modify the code handling system-wide power transitions
      so that it follows the core runtime PM code (ie. treats the
      subsystem callbacks as mutually exclusive).
      
      On the other hand, the core runtime PM code will choose to execute,
      for example, a runtime suspend callback provided by the device type
      even if the bus type's struct dev_pm_ops object exists, but the
      runtime_suspend pointer in it happens to be NULL.  This is confusing,
      because it may lead to the execution of callbacks from different
      subsystems during different operations (eg. the bus type suspend
      callback may be executed during runtime suspend of the device, while
      the device type callback will be executed during system suspend).
      
      Make all of the power management code treat subsystem callbacks in
      a consistent way, such that:
      (1) If the device's type is defined (eg. dev->type is not NULL)
          and its pm pointer is not NULL, the callbacks from dev->type->pm
          will be used.
      (2) If dev->type is NULL or dev->type->pm is NULL, but the device's
          class is defined (eg. dev->class is not NULL) and its pm pointer
          is not NULL, the callbacks from dev->class->pm will be used.
      (3) If dev->type is NULL or dev->type->pm is NULL and dev->class is
          NULL or dev->class->pm is NULL, the callbacks from dev->bus->pm
          will be used provided that both dev->bus and dev->bus->pm are
          not NULL.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NKevin Hilman <khilman@ti.com>
      Reasoning-sounds-sane-to: Grant Likely <grant.likely@secretlab.ca>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9659cc06
    • J
      PM: Simplify kernel/power/Kconfig · cf4fb80c
      Jan Beulich 提交于
      'n' defaults are pretty pointless and actually bogus when used with
      prompt-less config options.
      
      The "bool"/"default y" pair with no prompt can be expressed more
      compactly using def_bool.
      
      [rjw: Rebased on top of earlier patches modifying this file.]
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      cf4fb80c
    • R
      PM: Add support for device power domains · 7538e3db
      Rafael J. Wysocki 提交于
      The platform bus type is often used to handle Systems-on-a-Chip (SoC)
      where all devices are represented by objects of type struct
      platform_device.  In those cases the same "platform" device driver
      may be used with multiple different system configurations, but the
      actions needed to put the devices it handles into a low-power state
      and back into the full-power state may depend on the design of the
      given SoC.  The driver, however, cannot possibly include all the
      information necessary for the power management of its device on all
      the systems it is used with.  Moreover, the device hierarchy in its
      current form also is not suitable for representing this kind of
      information.
      
      The patch below attempts to address this problem by introducing
      objects of type struct dev_power_domain that can be used for
      representing power domains within a SoC.  Every struct
      dev_power_domain object provides a sets of device power
      management callbacks that can be used to perform what's needed for
      device power management in addition to the operations carried out by
      the device's driver and subsystem.
      
      Namely, if a struct dev_power_domain object is pointed to by the
      pwr_domain field in a struct device, the callbacks provided by its
      ops member will be executed in addition to the corresponding
      callbacks provided by the device's subsystem and driver during all
      power transitions.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Tested-and-acked-by: NKevin Hilman <khilman@ti.com>
      7538e3db
    • R
      PM: Drop pm_flags that is not necessary · 6831c6ed
      Rafael J. Wysocki 提交于
      The variable pm_flags is used to prevent APM from being enabled
      along with ACPI, which would lead to problems.  However, acpi_init()
      is always called before apm_init() and after acpi_init() has
      returned, it is known whether or not ACPI will be used.  Namely, if
      acpi_disabled is not set after acpi_init() has returned, this means
      that ACPI is enabled.  Thus, it is sufficient to check acpi_disabled
      in apm_init() to prevent APM from being enabled in parallel with
      ACPI.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NLen Brown <len.brown@intel.com>
      6831c6ed
    • R
      PM: Allow pm_runtime_suspend() to succeed during system suspend · e8665002
      Rafael J. Wysocki 提交于
      The dpm_prepare() function increments the runtime PM reference
      counters of all devices to prevent pm_runtime_suspend() from
      executing subsystem-level callbacks.  However, this was supposed to
      guard against a specific race condition that cannot happen, because
      the power management workqueue is freezable, so pm_runtime_suspend()
      can only be called synchronously during system suspend and we can
      rely on subsystems and device drivers to avoid doing that
      unnecessarily.
      
      Make dpm_prepare() drop the runtime PM reference to each device
      after making sure that runtime resume is not pending for it.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NKevin Hilman <khilman@ti.com>
      e8665002
    • R
      PM: Clean up PM_TRACE dependencies and drop unnecessary Kconfig option · 88a6f33e
      Rafael J. Wysocki 提交于
      CONFIG_PM_SLEEP_ADVANCED_DEBUG is not used any more, so drop it
      and CONFIG_CAN_PM_TRACE need not depend on EXPERIMENTAL, so remove
      that dependency.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      88a6f33e
    • R
      PM: Remove CONFIG_PM_OPS · aa338601
      Rafael J. Wysocki 提交于
      After redefining CONFIG_PM to depend on (CONFIG_PM_SLEEP ||
      CONFIG_PM_RUNTIME) the CONFIG_PM_OPS option is redundant and can be
      replaced with CONFIG_PM.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      aa338601
    • R
      PM: Reorder power management Kconfig options · 196ec243
      Rafael J. Wysocki 提交于
      Reorder configuration options in kernel/power/Kconfig so that
      the options depended on are at the top of the list.
      
      This patch doesn't introduce any functional changes.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      196ec243
    • R
      PM: Make CONFIG_PM depend on (CONFIG_PM_SLEEP || CONFIG_PM_RUNTIME) · 1eb208ae
      Rafael J. Wysocki 提交于
      From the users' point of view CONFIG_PM is really only used for
      making it possible to set CONFIG_SUSPEND, CONFIG_HIBERNATION,
      CONFIG_PM_RUNTIME and (surprisingly enough) CONFIG_XEN_SAVE_RESTORE
      (CONFIG_PM_OPP also depends on CONFIG_PM, but quite artificially).
      However, both CONFIG_SUSPEND and CONFIG_HIBERNATION require platform
      support (independent of CONFIG_PM) and it is not quite obvious that
      CONFIG_PM has to be set for CONFIG_XEN_SAVE_RESTORE to be available.
      Thus, from the users' point of view, it would be more logical to
      automatically select CONFIG_PM if any of the above options depending
      on it are set.
      
      Make CONFIG_PM depend on (CONFIG_PM_SLEEP || CONFIG_PM_RUNTIME),
      which will cause it to be selected when any of CONFIG_SUSPEND,
      CONFIG_HIBERNATION, CONFIG_PM_RUNTIME, CONFIG_XEN_SAVE_RESTORE is
      set and will clarify its meaning.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      1eb208ae
    • R
      PM / ACPI: Remove references to pm_flags from bus.c · cd51e61c
      Rafael J. Wysocki 提交于
      If direct references to pm_flags are removed from drivers/acpi/bus.c,
      CONFIG_ACPI will not need to depend on CONFIG_PM any more.  Make that
      happen.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NLen Brown <len.brown@intel.com>
      cd51e61c
    • R
      PM: Do not create wakeup sysfs files for devices that cannot wake up · cb8f51bd
      Rafael J. Wysocki 提交于
      Currently, wakeup sysfs attributes are created for all devices,
      regardless of whether or not they are wakeup-capable.  This is
      excessive and complicates wakeup device identification from user
      space (i.e. to identify wakeup-capable devices user space has to read
      /sys/devices/.../power/wakeup for all devices and see if they are not
      empty).
      
      Fix this issue by avoiding to create wakeup sysfs files for devices
      that cannot wake up the system from sleep states (i.e. whose
      power.can_wakeup flags are unset during registration) and modify
      device_set_wakeup_capable() so that it adds (or removes) the relevant
      sysfs attributes if a device's wakeup capability status is changed.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      cb8f51bd
    • R
      USB / Hub: Do not call device_set_wakeup_capable() under spinlock · 4681b171
      Rafael J. Wysocki 提交于
      A subsequent patch will modify device_set_wakeup_capable() in such
      a way that it will call functions which may sleep and therefore it
      shouldn't be called under spinlocks.  In preparation to that, modify
      usb_set_device_state() to avoid calling device_set_wakeup_capable()
      under device_state_lock.
      Tested-by: NMinchan Kim <minchan.kim@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4681b171
    • M
      PM: Use appropriate printk() priority level in trace.c · 0295a34d
      Mandeep Singh Baines 提交于
      printk()s without a priority level default to KERN_WARNING. To reduce
      noise at KERN_WARNING, this patch sets the priority level appriopriately
      for unleveled printks()s. This should be useful to folks that look at
      dmesg warnings closely.
      
      Changed these messages to pr_info().
      Signed-off-by: NMandeep Singh Baines <msb@chromium.org>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      0295a34d
    • R
      PM / Wakeup: Don't update events_check_enabled in pm_get_wakeup_count() · 790c7885
      Rafael J. Wysocki 提交于
      Since pm_save_wakeup_count() has just been changed to clear
      events_check_enabled unconditionally before checking if there are
      any new wakeup events registered since the last read from
      /sys/power/wakeup_count, the detection of wakeup events during
      suspend may be disabled, after it's been enabled, by writing a
      "wrong" value back to /sys/power/wakeup_count.  For this reason,
      it is not necessary to update events_check_enabled in
      pm_get_wakeup_count() any more.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      790c7885
    • R
      PM / Wakeup: Make pm_save_wakeup_count() work as documented · 378eef99
      Rafael J. Wysocki 提交于
      According to Documentation/ABI/testing/sysfs-power, the
      /sys/power/wakeup_count interface should only make the kernel react
      to wakeup events during suspend if the last write to it has been
      successful.  However, if /sys/power/wakeup_count is written to two
      times in a row, where the first write is successful and the second
      is not, the kernel will still react to wakeup events during suspend
      due to a bug in pm_save_wakeup_count().
      
      Fix the bug by making pm_save_wakeup_count() clear
      events_check_enabled unconditionally before checking if there are
      any new wakeup events registered since the previous read from
      /sys/power/wakeup_count.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      378eef99
    • R
      PM / Wakeup: Combine atomic counters to avoid reordering issues · 023d3779
      Rafael J. Wysocki 提交于
      The memory barrier in wakeup_source_deactivate() is supposed to
      prevent the callers of pm_wakeup_pending() and pm_get_wakeup_count()
      from seeing the new value of events_in_progress (0, in particular)
      and the old value of event_count at the same time.  However, if
      wakeup_source_deactivate() is executed by CPU0 and, for instance,
      pm_wakeup_pending() is executed by CPU1, where both processors can
      reorder operations, the memory barrier in wakeup_source_deactivate()
      doesn't affect CPU1 which can reorder reads.  In that case CPU1 may
      very well decide to fetch event_count before it's modified and
      events_in_progress after it's been updated, so pm_wakeup_pending()
      may fail to detect a wakeup event.  This issue can be addressed by
      using a single atomic variable to store both events_in_progress
      and event_count, so that they can be updated together in a single
      atomic operation.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      023d3779
    • O
      oom: oom_kill_process: fix the child_points logic · dc1b83ab
      Oleg Nesterov 提交于
      oom_kill_process() starts with victim_points == 0.  This means that
      (most likely) any child has more points and can be killed erroneously.
      
      Also, "children has a different mm" doesn't match the reality, we should
      check child->mm != t->mm.  This check is not exactly correct if t->mm ==
      NULL but this doesn't really matter, oom_kill_task() will kill them
      anyway.
      
      Note: "Kill all processes sharing p->mm" in oom_kill_task() is wrong
      too.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dc1b83ab
    • L
      Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6 · 5f40d420
      Linus Torvalds 提交于
      * 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
        NFS: NFSROOT should default to "proto=udp"
        nfs4: remove duplicated #include
        NFSv4: nfs4_state_mark_reclaim_nograce() should be static
        NFSv4: Fix the setlk error handler
        NFSv4.1: Fix the handling of the SEQUENCE status bits
        NFSv4/4.1: Fix nfs4_schedule_state_recovery abuses
        NFSv4.1 reclaim complete must wait for completion
        NFSv4: remove duplicate clientid in struct nfs_client
        NFSv4.1: Retry CREATE_SESSION on NFS4ERR_DELAY
        sunrpc: Propagate errors from xs_bind() through xs_create_sock()
        (try3-resend) Fix nfs_compat_user_ino64 so it doesn't cause problems if bit 31 or 63 are set in fileid
        nfs: fix compilation warning
        nfs: add kmalloc return value check in decode_and_add_ds
        SUNRPC: Remove resource leak in svc_rdma_send_error()
        nfs: close NFSv4 COMMIT vs. CLOSE race
        SUNRPC: Close a race in __rpc_wait_for_completion_task()
      5f40d420
    • L
      Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 · 215fd2fa
      Linus Torvalds 提交于
      * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
        drm/radeon: fix problem with changing active VRAM size. (v2)
      215fd2fa
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog · 786c58b7
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
        watchdog: hpwdt: eliminate section mismatch warning
        watchdog: w83697ug_wdt: Fix set bit 0 to activate GPIO2
        watchdog: sch311x_wdt: fix printk condition
        watchdog: sch311x_wdt: Fix LDN active check
        watchdog: cpwd: Fix buffer-overflow
      786c58b7
    • T
      Fix corrupted OSF partition table parsing · 1eafbfeb
      Timo Warns 提交于
      The kernel automatically evaluates partition tables of storage devices.
      The code for evaluating OSF partitions contains a bug that leaks data
      from kernel heap memory to userspace for certain corrupted OSF
      partitions.
      
      In more detail:
      
        for (i = 0 ; i < le16_to_cpu(label->d_npartitions); i++, partition++) {
      
      iterates from 0 to d_npartitions - 1, where d_npartitions is read from
      the partition table without validation and partition is a pointer to an
      array of at most 8 d_partitions.
      
      Add the proper and obvious validation.
      Signed-off-by: NTimo Warns <warns@pre-sense.de>
      Cc: stable@kernel.org
      [ Changed the patch trivially to not repeat the whole le16_to_cpu()
        thing, and to use an explicit constant for the magic value '8' ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1eafbfeb
  2. 14 3月, 2011 18 次提交