1. 26 12月, 2011 4 次提交
    • R
      PM / QoS: Introduce dev_pm_qos_add_ancestor_request() · 40a5f8be
      Rafael J. Wysocki 提交于
      Some devices, like the I2C controller on SH7372, are not
      necessary for providing power to their children or forwarding
      wakeup signals (and generally interrupts) from them.  They are
      only needed by their children when there's some data to transfer,
      so they may be suspended for the majority of time and resumed
      on demand, when the children have data to send or receive.  For this
      purpose, however, their power.ignore_children flags have to be set,
      or the PM core wouldn't allow them to be suspended while their
      children were active.
      
      Unfortunately, in some situations it may take too much time to
      resume such devices so that they can assist their children in
      transferring data.  For example, if such a device belongs to a PM
      domain which goes to the "power off" state when that device is
      suspended, it may take too much time to restore power to the
      domain in response to the request from one of the device's
      children.  In that case, if the parent's resume time is critical,
      the domain should stay in the "power on" state, although it still may
      be desirable to power manage the parent itself (e.g. by manipulating
      its clock).
      
      In general, device PM QoS may be used to address this problem.
      Namely, if the device's children added PM QoS latency constraints
      for it, they would be able to prevent it from being put into an
      overly deep low-power state.  However, in some cases the devices
      needing to be serviced are not the immediate children of a
      "children-ignoring" device, but its grandchildren or even less
      direct descendants.  In those cases, the entity wanting to add a
      PM QoS request for a given device's ancestor that ignores its
      children will have to find it in the first place, so introduce a new
      helper function that may be used to achieve that.  This function,
      dev_pm_qos_add_ancestor_request(), will search for the first
      ancestor of the given device whose power.ignore_children flag is
      set and will add a device PM QoS latency request for that ancestor
      on behalf of the caller.  The request added this way may be removed
      with the help of dev_pm_qos_remove_request() in the future, like
      any other device PM QoS latency request.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      40a5f8be
    • R
      PM / shmobile: Remove the stay_on flag from SH7372's PM domains · 767c0f3a
      Rafael J. Wysocki 提交于
      SH7372 uses two independent mechanisms for ensuring that power
      domains will never be turned off: the stay_on flag and the "always
      on" domain governor.  Moreover, the "always on" governor is only taken
      into accout by runtime PM code paths, while the stay_on flag affects
      all attempts to turn the given domain off.  Thus setting the stay_on
      flag causes the "always on" governor to be unnecessary, which is
      quite confusing.
      
      However, the stay_on flag is currently only set for two domains: A3SP
      and A4S.  Moreover, it only is set for the A3SP domain if
      console_suspend_enabled is set, so stay_on won't be necessary for
      that domain any more if console_suspend_enabled is checked directly
      in its .suspend() routine.  [This requires domain .suspend() to
      return a result, but that is a minor modification.]  Analogously,
      stay_on won't be necessary for the A4S domain if it's .suspend()
      routine always returns an error code.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NMagnus Damm <damm@opensource.se>
      767c0f3a
    • R
      PM / shmobile: Don't include SH7372's INTCS in syscore suspend/resume · 0f966d74
      Rafael J. Wysocki 提交于
      Since the SH7372's INTCS in included into syscore suspend/resume,
      which causes the chip to be accessed when PM domains have been
      turned off during system suspend, the A4R domain containing the
      INTCS has to stay on during system sleep, which is suboptimal
      from the power consumption point of view.
      
      For this reason, add a new INTC flag, skip_syscore_suspend, to mark
      the INTCS for intc_suspend() and intc_resume(), so that they don't
      touch it.  This allows the A4R domain to be turned off during
      system suspend and the INTCS state is resrored during system
      resume by the A4R's "power on" code.
      Suggested-by: NMagnus Damm <damm@opensource.se>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NMagnus Damm <damm@opensource.se>
      0f966d74
    • M
      PM / shmobile: Add support for the sh7372 A4S power domain / sleep mode · f7dadb37
      Magnus Damm 提交于
      The sh7372 contains a power domain named A4S which in turn
      contains power domains for both I/O Devices and CPU cores.
      
      At this point only System wide Suspend-to-RAM is supported,
      but the the hardware can also support CPUIdle. With more
      efforts in the future CPUIdle can work with bot A4S and A3SM.
      
      Tested on the sh7372 Mackerel board.
      
      [rjw: Rebased on top of the current linux-pm tree.]
      Signed-off-by: NMagnus Damm <damm@opensource.se>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      f7dadb37
  2. 10 12月, 2011 3 次提交
  3. 09 12月, 2011 1 次提交
  4. 07 12月, 2011 1 次提交
  5. 02 12月, 2011 8 次提交
    • G
      PM / Domains: fix compilation failure for CONFIG_PM_GENERIC_DOMAINS unset · 4f042cda
      Guennadi Liakhovetski 提交于
      Fix the following compalitaion breakage:
      
      In file included from linux/drivers/sh/pm_runtime.c:15:
      linux/include/linux/pm_domain.h: In function 'dev_to_genpd':
      linux/include/linux/pm_domain.h:142: error: implicit declaration of function 'ERR_PTR'
      linux/include/linux/pm_domain.h:142: warning: return makes pointer from integer without a cast
      In file included from linux/include/linux/sh_clk.h:10,
                       from linux/drivers/sh/pm_runtime.c:19:
      linux/include/linux/err.h: At top level:
      linux/include/linux/err.h:22: error: conflicting types for 'ERR_PTR'
      linux/include/linux/pm_domain.h:142: note: previous implicit declaration of 'ERR_PTR' was here
      make[3]: *** [drivers/sh/pm_runtime.o] Error 1
      Reported-by: NNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Signed-off-by: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      4f042cda
    • R
      PM / Domains: Automatically update overoptimistic latency information · 0140d8bd
      Rafael J. Wysocki 提交于
      Measure the time of execution of the .stop(), .start(), .save_state()
      and .restore_state() PM domain device callbacks and if the result
      is greater than the corresponding latency value stored in the
      device's struct generic_pm_domain_data object, replace the inaccurate
      value with the measured time.
      
      Do analogously for the PM domains' .power_off() and .power_off()
      callbacks.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      0140d8bd
    • R
      PM / Domains: Add default power off governor function (v4) · 221e9b58
      Rafael J. Wysocki 提交于
      Add a function deciding whether or not a given PM domain should
      be powered off on the basis of the PM QoS constraints of devices
      belonging to it and their PM QoS timing data.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      221e9b58
    • R
      PM / Domains: Add device stop governor function (v4) · b02c999a
      Rafael J. Wysocki 提交于
      Add a function deciding whether or not devices should be stopped in
      pm_genpd_runtime_suspend() depending on their PM QoS constraints
      and stop/start timing values.  Make it possible to add information
      used by this function to device objects.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NMagnus Damm <damm@opensource.se>
      b02c999a
    • R
      PM / Domains: Rework system suspend callback routines (v2) · d23b9b00
      Rafael J. Wysocki 提交于
      The current generic PM domains code attempts to use the generic
      system suspend operations along with the domains' device stop/start
      routines, which requires device drivers to assume that their
      system suspend/resume (and hibernation/restore) callbacks will always
      be used with generic PM domains.  However, in theory, the same
      hardware may be used in devices that don't belong to any PM domain,
      in which case it would be necessary to add "fake" PM domains to
      satisfy the above assumption.  Also, the domain the hardware belongs
      to may not be handled with the help of the generic code.
      
      To allow device drivers that may be used along with the generic PM
      domains code of more flexibility, add new device callbacks,
      .suspend(), .suspend_late(), .resume_early(), .resume(), .freeze(),
      .freeze_late(), .thaw_early(), and .thaw(), that can be supplied by
      the drivers in addition to their "standard" system suspend and
      hibernation callbacks.  These new callbacks, if defined, will be used
      by the generic PM domains code for the handling of system suspend and
      hibernation instead of the "standard" ones.  This will allow drivers
      to be designed to work with generic PM domains as well as without
      them.
      
      For backwards compatibility, introduce default implementations of the
      new callbacks for PM domains that will execute pm_generic_suspend(),
      pm_generic_suspend_noirq(), pm_generic_resume_noirq(),
      pm_generic_resume(), pm_generic_freeze(), pm_generic_freeze_noirq(),
      pm_generic_thaw_noirq(), and pm_generic_thaw(), respectively, for the
      given device if its driver doesn't define those callbacks.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      d23b9b00
    • R
      PM / Domains: Introduce "save/restore state" device callbacks · ecf00475
      Rafael J. Wysocki 提交于
      The current PM domains code uses device drivers' .runtime_suspend()
      and .runtime_resume() callbacks as the "save device state" and
      "restore device state" operations, which may not be appropriate in
      general, because it forces drivers to assume that they always will
      be used with generic PM domains.  However, in theory, the same
      hardware may be used in devices that don't belong to any PM
      domain, in which case it would be necessary to add "fake" PM
      domains to satisfy the above assumption.  It also may be located in
      a PM domain that's not handled with the help of the generic code.
      
      To allow device drivers that may be used along with the generic PM
      domains code of more flexibility, introduce new device callbacks,
      .save_state() and .restore_state(), that can be supplied by the
      drivers in addition to their "standard" runtime PM callbacks.  This
      will allow the drivers to be designed to work with generic PM domains
      as well as without them.
      
      For backwards compatibility, introduce default .save_state() and
      .restore_state() callback routines for PM domains that will execute
      a device driver's .runtime_suspend() and .runtime_resume() callbacks,
      respectively, for the given device if the driver doesn't provide its
      own implementations of .save_state() and .restore_state().
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      ecf00475
    • R
      PM / Domains: Make it possible to use per-device domain callbacks · d5e4cbfe
      Rafael J. Wysocki 提交于
      The current generic PM domains code requires that the same .stop(),
      .start() and .active_wakeup() device callback routines be used for
      all devices in the given domain, which is inflexible and may not
      cover some specific use cases.  For this reason, make it possible to
      use device specific .start()/.stop() and .active_wakeup() callback
      routines by adding corresponding callback pointers to struct
      generic_pm_domain_data.  Add a new helper routine,
      pm_genpd_register_callbacks(), that can be used to populate
      the new per-device callback pointers.
      
      Modify the shmobile's power domains code to allow drivers to add
      their own code to be run during the device stop and start operations
      with the help of the new callback pointers.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NMagnus Damm <damm@opensource.se>
      d5e4cbfe
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · b930c264
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        Btrfs: fix meta data raid-repair merge problem
        Btrfs: skip allocation attempt from empty cluster
        Btrfs: skip block groups without enough space for a cluster
        Btrfs: start search for new cluster at the beginning
        Btrfs: reset cluster's max_size when creating bitmap
        Btrfs: initialize new bitmaps' list
        Btrfs: fix oops when calling statfs on readonly device
        Btrfs: Don't error on resizing FS to same size
        Btrfs: fix deadlock on metadata reservation when evicting a inode
        Fix URL of btrfs-progs git repository in docs
        btrfs scrub: handle -ENOMEM from init_ipath()
      b930c264
  6. 01 12月, 2011 15 次提交
  7. 30 11月, 2011 6 次提交
    • R
      a493f1a2
    • L
      Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 8cd79203
      Linus Torvalds 提交于
      * 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        PM: Update comments describing device power management callbacks
        PM / Sleep: Update documentation related to system wakeup
        PM / Runtime: Make documentation follow the new behavior of irq_safe
        PM / Sleep: Correct inaccurate information in devices.txt
        PM / Domains: Document how PM domains are used by the PM core
        PM / Hibernate: Do not leak memory in error/test code paths
      8cd79203
    • E
      IB: Fix RCU lockdep splats · 580da35a
      Eric Dumazet 提交于
      Commit f2c31e32 ("net: fix NULL dereferences in check_peer_redir()")
      forgot to take care of infiniband uses of dst neighbours.
      
      Many thanks to Marc Aurele who provided a nice bug report and feedback.
      Reported-by: NMarc Aurele La France <tsi@ualberta.ca>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: David Miller <davem@davemloft.net>
      Cc: <stable@kernel.org>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      580da35a
    • M
      IB/ipoib: Prevent hung task or softlockup processing multicast response · 3874397c
      Mike Marciniszyn 提交于
      This following can occur with ipoib when processing a multicast reponse:
      
          BUG: soft lockup - CPU#0 stuck for 67s! [ib_mad1:982]
          Modules linked in: ...
          CPU 0:
          Modules linked in: ...
          Pid: 982, comm: ib_mad1 Not tainted 2.6.32-131.0.15.el6.x86_64 #1 ProLiant DL160 G5
          RIP: 0010:[<ffffffff814ddb27>]  [<ffffffff814ddb27>] _spin_unlock_irqrestore+0x17/0x20
          RSP: 0018:ffff8802119ed860  EFLAGS: 00000246
          0000000000000004 RBX: ffff8802119ed860 RCX: 000000000000a299
          RDX: ffff88021086c700 RSI: 0000000000000246 RDI: 0000000000000246
          RBP: ffffffff8100bc8e R08: ffff880210ac229c R09: 0000000000000000
          R10: ffff88021278aab8 R11: 0000000000000000 R12: ffff8802119ed860
          R13: ffffffff8100be6e R14: 0000000000000001 R15: 0000000000000003
          FS:  0000000000000000(0000) GS:ffff880028200000(0000) knlGS:0000000000000000
          CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
          CR2: 00000000006d4840 CR3: 0000000209aa5000 CR4: 00000000000406f0
          DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
          DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
          Call Trace:
          [<ffffffffa032c247>] ? ipoib_mcast_send+0x157/0x480 [ib_ipoib]
          [<ffffffff8100bc8e>] ? apic_timer_interrupt+0xe/0x20
          [<ffffffff8100bc8e>] ? apic_timer_interrupt+0xe/0x20
          [<ffffffffa03283d4>] ? ipoib_path_lookup+0x124/0x2d0 [ib_ipoib]
          [<ffffffffa03286fc>] ? ipoib_start_xmit+0x17c/0x430 [ib_ipoib]
          [<ffffffff8141e758>] ? dev_hard_start_xmit+0x2c8/0x3f0
          [<ffffffff81439d0a>] ? sch_direct_xmit+0x15a/0x1c0
          [<ffffffff81423098>] ? dev_queue_xmit+0x388/0x4d0
          [<ffffffffa032d6b7>] ? ipoib_mcast_join_finish+0x2c7/0x510 [ib_ipoib]
          [<ffffffffa032dab8>] ? ipoib_mcast_sendonly_join_complete+0x1b8/0x1f0 [ib_ipoib]
          [<ffffffffa02a0946>] ? mcast_work_handler+0x1a6/0x710 [ib_sa]
          [<ffffffffa015f01e>] ? ib_send_mad+0xfe/0x3c0 [ib_mad]
          [<ffffffffa00f6c93>] ? ib_get_cached_lmc+0xa3/0xb0 [ib_core]
          [<ffffffffa02a0f9b>] ? join_handler+0xeb/0x200 [ib_sa]
          [<ffffffffa029e4fc>] ? ib_sa_mcmember_rec_callback+0x5c/0xa0 [ib_sa]
          [<ffffffffa029e79c>] ? recv_handler+0x3c/0x70 [ib_sa]
          [<ffffffffa01603a4>] ? ib_mad_completion_handler+0x844/0x9d0 [ib_mad]
          [<ffffffffa015fb60>] ? ib_mad_completion_handler+0x0/0x9d0 [ib_mad]
          [<ffffffff81088830>] ? worker_thread+0x170/0x2a0
          [<ffffffff8108e160>] ? autoremove_wake_function+0x0/0x40
          [<ffffffff810886c0>] ? worker_thread+0x0/0x2a0
          [<ffffffff8108ddf6>] ? kthread+0x96/0xa0
          [<ffffffff8100c1ca>] ? child_rip+0xa/0x20
      
      Coinciding with stack trace is the following message:
      
          ib0: ib_address_create failed
      
      The code below in ipoib_mcast_join_finish() will note the above
      failure in the address handle but otherwise continue:
      
                      ah = ipoib_create_ah(dev, priv->pd, &av);
                      if (!ah) {
                              ipoib_warn(priv, "ib_address_create failed\n");
                      } else {
      
      The while loop at the bottom of ipoib_mcast_join_finish() will attempt
      to send queued multicast packets in mcast->pkt_queue and eventually
      end up in ipoib_mcast_send():
      
              if (!mcast->ah) {
                      if (skb_queue_len(&mcast->pkt_queue) < IPOIB_MAX_MCAST_QUEUE)
                              skb_queue_tail(&mcast->pkt_queue, skb);
                      else {
                              ++dev->stats.tx_dropped;
                              dev_kfree_skb_any(skb);
                      }
      
      My read is that the code will requeue the packet and return to the
      ipoib_mcast_join_finish() while loop and the stage is set for the
      "hung" task diagnostic as the while loop never sees a non-NULL ah, and
      will do nothing to resolve.
      
      There are GFP_ATOMIC allocates in the provider routines, so this is
      possible and should be dealt with.
      
      The test that induced the failure is associated with a host SM on the
      same server during a shutdown.
      
      This patch causes ipoib_mcast_join_finish() to exit with an error
      which will flush the queued mcast packets.  Nothing is done to unwind
      the QP attached state so that subsequent sends from above will retry
      the join.
      Reviewed-by: NRam Vepa <ram.vepa@qlogic.com>
      Reviewed-by: NGary Leshner <gary.leshner@qlogic.com>
      Signed-off-by: NMike Marciniszyn <mike.marciniszyn@qlogic.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      3874397c
    • L
      Merge branch 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux · 57db53b0
      Linus Torvalds 提交于
      * 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux:
        slub: avoid potential NULL dereference or corruption
        slub: use irqsafe_cpu_cmpxchg for put_cpu_partial
        slub: move discard_slab out of node lock
        slub: use correct parameter to add a page to partial list tail
      57db53b0
    • L
      Merge branch 'dev' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 883381d9
      Linus Torvalds 提交于
      * 'dev' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: fix racy use-after-free in ext4_end_io_dio()
      883381d9
  8. 29 11月, 2011 2 次提交