1. 21 Oct, 2011 1 commit
    • Rafael J. Wysocki's avatar
      PM / Sleep: Mark devices involved in wakeup signaling during suspend · 4ca46ff3
      Rafael J. Wysocki authored
      The generic PM domains code in drivers/base/power/domain.c has
      to avoid powering off domains that provide power to wakeup devices
      during system suspend.  Currently, however, this only works for
      wakeup devices directly belonging to the given domain and not for
      their children (or the children of their children and so on).
      Thus, if there's a wakeup device whose parent belongs to a power
      domain handled by the generic PM domains code, the domain will be
      powered off during system suspend preventing the device from
      signaling wakeup.
      
      To address this problem introduce a device flag, power.wakeup_path,
      that will be set during system suspend for all wakeup devices,
      their parents, the parents of their parents and so on.  This way,
      all wakeup paths in the device hierarchy will be marked and the
      generic PM domains code will only need to avoid powering off
      domains containing devices whose power.wakeup_path is set.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      4ca46ff3
  2. 26 Sep, 2011 3 commits
    • Rafael J. Wysocki's avatar
      PM / Domains: Split device PM domain data into base and need_restore · cd0ea672
      Rafael J. Wysocki authored
      The struct pm_domain_data data type is defined in such a way that
      adding new fields specific to the generic PM domains code will
      require include/linux/pm.h to be modified.  As a result, data types
      used only by the generic PM domains code will be defined in two
      headers, although they all should be defined in pm_domain.h and
      pm.h will need to include more headers, which won't be very nice.
      
      For this reason change the definition of struct pm_subsys_data
      so that its domain_data member is a pointer, which will allow
      struct pm_domain_data to be subclassed by various PM domains
      implementations.  Remove the need_restore member from
      struct pm_domain_data and make the generic PM domains code
      subclass it by adding the need_restore member to the new data type.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      cd0ea672
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-fixes' into pm-domains · 0d41da2e
      Rafael J. Wysocki authored
      Merge commit e8b364b8
      (PM / Clocks: Do not acquire a mutex under a spinlock) fixing
      a regression in drivers/base/power/clock_ops.c.
      
      Conflicts:
      	drivers/base/power/clock_ops.c
      0d41da2e
    • Rafael J. Wysocki's avatar
      PM / Clocks: Do not acquire a mutex under a spinlock · e8b364b8
      Rafael J. Wysocki authored
      Commit b7ab83ed (PM: Use spinlock instead of mutex in clock
      management functions) introduced a regression causing clocks_mutex
      to be acquired under a spinlock.  This happens because
      pm_clk_suspend() and pm_clk_resume() call pm_clk_acquire() under
      pcd->lock, but pm_clk_acquire() executes clk_get() which causes
      clocks_mutex to be acquired.  Similarly, __pm_clk_remove(),
      executed under pcd->lock, calls clk_put(), which also causes
      clocks_mutex to be acquired.
      
      To fix those problems make pm_clk_add() call pm_clk_acquire(), so
      that pm_clk_suspend() and pm_clk_resume() don't have to do that.
      Change pm_clk_remove() and pm_clk_destroy() to separate
      modifications of the pcd->clock_list list from the actual removal of
      PM clock entry objects done by __pm_clk_remove().
      Reported-and-tested-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      e8b364b8
  3. 25 Sep, 2011 4 commits
  4. 23 Sep, 2011 26 commits
  5. 22 Sep, 2011 6 commits
    • Peter Huewe's avatar
      TPM: Zero buffer after copying to userspace · 3321c07a
      Peter Huewe authored
      Since the buffer might contain security related data it might be a good idea to
      zero the buffer after we have copied it to userspace.
      
      This got assigned CVE-2011-1162.
      Signed-off-by: default avatarRajiv Andrade <srajiv@linux.vnet.ibm.com>
      Cc: Stable Kernel <stable@kernel.org>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      3321c07a
    • Peter Huewe's avatar
      TPM: Call tpm_transmit with correct size · 6b07d30a
      Peter Huewe authored
      This patch changes the call of tpm_transmit by supplying the size of the
      userspace buffer instead of TPM_BUFSIZE.
      
      This got assigned CVE-2011-1161.
      
      [The first hunk didn't make sense given one could expect
       way less data than TPM_BUFSIZE, so added tpm_transmit boundary
       check over bufsiz instead
       The last parameter of tpm_transmit() reflects the amount
       of data expected from the device, and not the buffer size
       being supplied to it. It isn't ideal to parse it directly,
       so we just set it to the maximum the input buffer can handle
       and let the userspace API to do such job.]
      Signed-off-by: default avatarRajiv Andrade <srajiv@linux.vnet.ibm.com>
      Cc: Stable Kernel <stable@kernel.org>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      6b07d30a
    • Axel Lin's avatar
      TPM: tpm_nsc: Fix a double free of pdev in cleanup_nsc · de69113e
      Axel Lin authored
      platform_device_unregister() will release all resources
      and remove it from the subsystem, then drop reference count by
      calling platform_device_put().
      
      We should not call kfree(pdev) after platform_device_unregister(pdev).
      Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
      Signed-off-by: default avatarRajiv Andrade <srajiv@linux.vnet.ibm.com>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      de69113e
    • Geert Uytterhoeven's avatar
      TPM: TCG_ATMEL should depend on HAS_IOPORT · 5ce5ed35
      Geert Uytterhoeven authored
      On m68k, I get:
      
      drivers/char/tpm/tpm_atmel.h: In function ‘atmel_get_base_addr’:
      drivers/char/tpm/tpm_atmel.h:129: error: implicit declaration of function ‘ioport_map’
      drivers/char/tpm/tpm_atmel.h:129: warning: return makes pointer from integer without a cast
      
      The code in tpm_atmel.h supports PPC64 (using the device tree and ioremap())
      and "anything else" (using ioport_map()). However, ioportmap() is only
      available on platforms that set HAS_IOPORT.
      
      Although PC64 seems to have HAS_IOPORT, a "depends on HAS_IOPORT" should work,
      but I think it's better to expose the special PPC64 handling explicit using
      "depends on PPC64 || HAS_IOPORT".
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarRajiv Andrade <srajiv@linux.vnet.ibm.com>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      5ce5ed35
    • David Rientjes's avatar
      thp: fix khugepaged defrag tunable documentation · e369fde1
      David Rientjes authored
      Commit e27e6151 ("mm/thp: use conventional format for boolean
      attributes") changed
      
        /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
      
      to be tuned by using 1 (enabled) or 0 (disabled) instead of "yes" and
      "no", respectively.
      
      Update the documentation.
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e369fde1
    • Geert Uytterhoeven's avatar
      zorro: Defer device_register() until all devices have been identified · a7f4d00a
      Geert Uytterhoeven authored
      As the Amiga Zorro II address space is limited to 8.5 MiB and Zorro
      devices can contain only one BAR, several Amiga Zorro II expansion
      boards (mainly graphics cards) contain multiple Zorro devices: a small
      one for the control registers and one (or more) for the graphics memory.
      
      The conversion of cirrusfb to the new driver framework introduced a
      regression: the driver contains a zorro_driver for the first Zorro
      device, and uses the (old) zorro_find_device() call to find the second
      Zorro device.
      
      However, as the Zorro core calls device_register() as soon as a Zorro
      device is identified, it may not have identified the second Zorro device
      belonging to the same physical Zorro expansion card.  Hence cirrusfb
      could no longer find the second part of the Picasso II graphics card,
      causing a NULL pointer dereference.
      
      Defer the registration of Zorro devices with the driver framework until
      all Zorro devices have been identified to fix this.
      
      Note that the alternative solution (modifying cirrusfb to register a
      zorro_driver for all Zorro devices belonging to a graphics card, instead
      of only for the first one, and adding a synchronization mechanism to
      defer initialization until all have been found), is not an option, as on
      some cards one device may be optional (e.g.  the second bank of 2 MiB of
      graphics memory on the Picasso IV in Zorro II mode).
      Reported-by: default avatarIngo Jürgensmann <ij@2011.bluespice.org>
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a7f4d00a