1. 11 7月, 2015 1 次提交
    • L
      Merge tag 'powerpc-4.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 3cdeb9d1
      Linus Torvalds 提交于
      Pull powerpc fixes from Michael Ellerman:
       - opal-prd mmap fix from Vaidy
       - set kernel taint for MCEs from Daniel
       - alignment exception description from Anton
       - ppc4xx_hsta_msi build fix from Daniel
       - opal-elog interrupt fix from Alistair
       - core_idle_state race fix from Shreyas
       - hv-24x7 lockdep fix from Sukadev
       - multiple cxl fixes from Daniel, Ian, Mikey & Maninder
       - update MAINTAINERS to point at shared tree
      
      * tag 'powerpc-4.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        cxl: Check if afu is not null in cxl_slbia
        powerpc: Update MAINTAINERS to point at shared tree
        powerpc/perf/24x7: Fix lockdep warning
        cxl: Fix off by one error allowing subsequent mmap page to be accessed
        cxl: Fail mmap if requested mapping is larger than assigned problem state area
        cxl: Fix refcounting in kernel API
        powerpc/powernv: Fix race in updating core_idle_state
        powerpc/powernv: Fix opal-elog interrupt handler
        powerpc/ppc4xx_hsta_msi: Include ppc-pci.h to fix reference to hose_list
        powerpc: Add plain English description for alignment exception oopses
        cxl: Test the correct mmio space before unmapping
        powerpc: Set the correct kernel taint on machine check errors
        cxl/vphb.c: Use phb pointer after NULL check
        powerpc/powernv: Fix vma page prot flags in opal-prd driver
      3cdeb9d1
  2. 10 7月, 2015 14 次提交
  3. 09 7月, 2015 6 次提交
    • L
      Merge tag 'pm+acpi-4.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 883a2dfd
      Linus Torvalds 提交于
      Pull power management and ACPI updates from Rafael Wysocki:
       "These are fixes on top of the previous PM+ACPI pull requests
        (including one fix for a 4.1 regression) and two commits adding
        _CLS-based device enumeration support to the ACPI core and the ATA
        subsystem that waited for the latest ACPICA changes to be merged.
      
        Specifics:
      
         - Fix for an ACPI resources management regression introduced during
           the 4.1 cycle (that unfortunately went into -stable) effectively
           reverting the bad commit along with the recent fixups on top of it
           and using an alternative approach to address the underlying issue
           (Rafael J Wysocki).
      
         - Fix for a memory leak and an incorrect return value in an error
           code path in the ACPI LPSS (Low-Power Subsystem) driver (Rafael J
           Wysocki).
      
         - Fix for a leftover dangling pointer in an error code path in the
           new wakeup IRQ support code (Rafael J Wysocki).
      
         - Fix to prevent infinite loops (due to errors in other places) from
           happening in the core generic PM domains support code (Geert
           Uytterhoeven).
      
         - Hibernation documentation update/clarification (Uwe Geuder).
      
         - Support for _CLS-based device enumeration in the ACPI core and in
           the ATA subsystem (Suravee Suthikulpanit)"
      
      * tag 'pm+acpi-4.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        PM / wakeirq: Avoid setting power.wakeirq too hastily
        ata: ahci_platform: Add ACPI _CLS matching
        ACPI / scan: Add support for ACPI _CLS device matching
        PM / hibernate: clarify resume documentation
        PM / Domains: Avoid infinite loops in attach/detach code
        ACPI / LPSS: Fix up acpi_lpss_create_device()
        ACPI / PNP: Reserve ACPI resources at the fs_initcall_sync stage
      883a2dfd
    • L
      Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile · 331c5841
      Linus Torvalds 提交于
      Pull arch/tile fix from Chris Metcalf:
       "This fix eliminates a "section mismatch" warning caused by the new
        __ex_table checking code in modpost"
      
      * 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
        modpost: work correctly with tile coldtext sections
      331c5841
    • L
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux · 9d993ccb
      Linus Torvalds 提交于
      Pull module fix from Rusty Russell:
       "Single fix: missing rbtree removal in the module load failure path.
        Easy to trigger with bad params.
      
        Thanks to Peter Zijlstra and Arthur Marsh for going around on this
        one"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
        module: Fix load_module() error path
      9d993ccb
    • C
      modpost: work correctly with tile coldtext sections · 673c2c34
      Chris Metcalf 提交于
      The tilegx and tilepro compilers use .coldtext for their unlikely
      executed text section name, so an __attribute__((cold)) function
      will (when compiled with higher optimization levels) land in
      the .coldtext section.
      
      Modify modpost to add .coldtext to the set of OTHER_TEXT_SECTIONS
      so we don't get warnings about referencing such a section in an
      __ex_table block, and then also modify arch/tile/lib/memcpy_user_64.c
      so that it uses plain ".coldtext" instead of ".coldtext.memcpy".
      The latter naming is a relic of an earlier use of -ffunction-sections,
      which we no longer use by default.
      Signed-off-by: NChris Metcalf <cmetcalf@ezchip.com>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      673c2c34
    • P
      module: Fix load_module() error path · 758556bd
      Peter Zijlstra 提交于
      The load_module() error path frees a module but forgot to take it out
      of the mod_tree, leaving a dangling entry in the tree, causing havoc.
      
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Reported-by: NArthur Marsh <arthur.marsh@internode.on.net>
      Tested-by: NArthur Marsh <arthur.marsh@internode.on.net>
      Fixes: 93c2e105 ("module: Optimize __module_address() using a latched RB-tree")
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      758556bd
    • L
      Fix broken audit tests for exec arg len · 45820c29
      Linus Torvalds 提交于
      The "fix" in commit 0b08c5e5 ("audit: Fix check of return value of
      strnlen_user()") didn't fix anything, it broke things.  As reported by
      Steven Rostedt:
      
       "Yes, strnlen_user() returns 0 on fault, but if you look at what len is
        set to, than you would notice that on fault len would be -1"
      
      because we just subtracted one from the return value.  So testing
      against 0 doesn't test for a fault condition, it tests against a
      perfectly valid empty string.
      
      Also fix up the usual braindamage wrt using WARN_ON() inside a
      conditional - make it part of the conditional and remove the explicit
      unlikely() (which is already part of the WARN_ON*() logic, exactly so
      that you don't have to write unreadable code.
      Reported-and-tested-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Paul Moore <pmoore@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      45820c29
  4. 08 7月, 2015 9 次提交
  5. 07 7月, 2015 10 次提交
    • R
      Merge branches 'fixes' and 'ioremap' into for-linus · 06be5eef
      Russell King 提交于
      06be5eef
    • R
      PM / wakeirq: Avoid setting power.wakeirq too hastily · 6d3dab7d
      Rafael J. Wysocki 提交于
      If dev_pm_attach_wake_irq() fails, the device's power.wakeirq field
      should not be set to point to the struct wake_irq passed to that
      function, as that object will be freed going forward.
      
      For this reason, make dev_pm_attach_wake_irq() first call
      device_wakeup_attach_irq() and only set the device's power.wakeirq
      field if that's successful.
      
      That requires device_wakeup_attach_irq() to be called under the
      device's power.lock lock, but since dev_pm_attach_wake_irq() is
      the only caller of it, the requisite changes are easy to make.
      
      Fixes: 4990d4fe (PM / Wakeirq: Add automated device wake IRQ handling)
      Reported-by: NFelipe Balbi <balbi@ti.com>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6d3dab7d
    • M
      cxl: Fix refcounting in kernel API · 3f8dc44d
      Michael Neuling 提交于
      Currently the kernel API AFU dev refcounting is done on context start and stop.
      This patch moves this refcounting to context init and release, bringing it
      inline with how the userspace API does it.
      
      Without this we've seen the refcounting on the AFU get out of whack between the
      user and kernel API usage.  This causes the AFU structures to be freed when
      they are actually still in use.
      
      This fixes some kref warnings we've been seeing and spurious ErrIVTE IRQs.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Acked-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      3f8dc44d
    • S
      powerpc/powernv: Fix race in updating core_idle_state · b32aadc1
      Shreyas B. Prabhu 提交于
      core_idle_state is maintained for each core. It uses 0-7 bits to track
      whether a thread in the core has entered fastsleep or winkle. 8th bit is
      used as a lock bit.
      The lock bit is set in these 2 scenarios-
       - The thread is first in subcore to wakeup from sleep/winkle.
       - If its the last thread in the core about to enter sleep/winkle
      
      While the lock bit is set, if any other thread in the core wakes up, it
      loops until the lock bit is cleared before proceeding in the wakeup
      path. This helps prevent race conditions w.r.t fastsleep workaround and
      prevents threads from switching to process context before core/subcore
      resources are restored.
      
      But, in the path to sleep/winkle entry, we currently don't check for
      lock-bit. This exposes us to following race when running with subcore
      on-
      
      First thread in the subcorea		Another thread in the same
      waking up		   		core entering sleep/winkle
      
      lwarx   r15,0,r14
      ori     r15,r15,PNV_CORE_IDLE_LOCK_BIT
      stwcx.  r15,0,r14
      [Code to restore subcore state]
      
      						lwarx   r15,0,r14
      						[clear thread bit]
      						stwcx.  r15,0,r14
      
      andi.   r15,r15,PNV_CORE_IDLE_THREAD_BITS
      stw     r15,0(r14)
      
      Here, after the thread entering sleep clears its thread bit in
      core_idle_state, the value is overwritten by the thread waking up.
      In such cases when the core enters fastsleep, code mistakes an idle
      thread as running. Because of this, the first thread waking up from
      fastsleep which is supposed to resync timebase skips it. So we can
      end up having a core with stale timebase value.
      
      This patch fixes the above race by looping on the lock bit even while
      entering the idle states.
      Signed-off-by: NShreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
      Fixes: 7b54e9f213f76 'powernv/powerpc: Add winkle support for offline cpus'
      Cc: stable@vger.kernel.org # 3.19+
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      b32aadc1
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c7e9ad7d
      Linus Torvalds 提交于
      Pull perf fixes from Ingo Molnar:
      
       - fix the perf build, by fixing the rbtree.c sharing bug between kernel
         and tools/perf by creating a local copy of rbtree.c (more will be
         done for v4.3)
      
       - fix an AUX buffer (Intel-PT support) refcounting bug
      
       - fix copy_from_user_nmi() return value"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86: Fix copy_from_user_nmi() return if range is not ok
        perf: Fix AUX buffer refcounting
        tools: Copy rbtree_augmented.h from the kernel
        tools: Move rbtree.h from tools/perf/
        tools: Copy lib/rbtree.c to tools/lib/
        perf tools: Copy rbtree.h from the kernel
        tools: Adopt {READ,WRITE_ONCE} from the kernel
      c7e9ad7d
    • S
      ata: ahci_platform: Add ACPI _CLS matching · 2051e924
      Suthikulpanit, Suravee 提交于
      This patch adds ACPI supports for AHCI platform driver, which uses _CLS
      method to match the device.
      
      The following is an example of ASL structure in DSDT for a SATA controller,
      which contains _CLS package to be matched by the ahci_platform driver:
      
        Device (AHC0) // AHCI Controller
        {
          Name(_HID, "AMDI0600")
          Name (_CCA, 1)
          Name (_CLS, Package (3)
          {
            0x01, // Base Class: Mass Storage
            0x06, // Sub-Class: serial ATA
            0x01, // Interface: AHCI
          })
          Name (_CRS, ResourceTemplate ()
          {
            Memory32Fixed (ReadWrite, 0xE0300000, 0x00010000)
            Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive,,,) { 387 }
          })
        }
      
      Also, since ATA driver should not require PCI support for ATA_ACPI,
      this patch removes dependency in the driver/ata/Kconfig.
      Acked-by: NTejun Heo <tj@kernel.org>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NSuravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2051e924
    • S
      ACPI / scan: Add support for ACPI _CLS device matching · 26095a01
      Suthikulpanit, Suravee 提交于
      Device drivers typically use ACPI _HIDs/_CIDs listed in struct device_driver
      acpi_match_table to match devices. However, for generic drivers, we do not
      want to list _HID for all supported devices. Also, certain classes of devices
      do not have _CID (e.g. SATA, USB). Instead, we can leverage ACPI _CLS,
      which specifies PCI-defined class code (i.e. base-class, subclass and
      programming interface). This patch adds support for matching ACPI devices using
      the _CLS method.
      
      To support loadable module, current design uses _HID or _CID to match device's
      modalias. With the new way of matching with _CLS this would requires modification
      to the current ACPI modalias key to include _CLS. This patch appends PCI-defined
      class-code to the existing ACPI modalias as following.
      
          acpi:<HID>:<CID1>:<CID2>:..:<CIDn>:<bbsspp>:
      E.g:
          # cat /sys/devices/platform/AMDI0600:00/modalias
          acpi:AMDI0600:010601:
      
      where bb is th base-class code, ss is te sub-class code, and pp is the
      programming interface code
      
      Since there would not be _HID/_CID in the ACPI matching table of the driver,
      this patch adds a field to acpi_device_id to specify the matching _CLS.
      
          static const struct acpi_device_id ahci_acpi_match[] = {
              { ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) },
              {},
          };
      
      In this case, the corresponded entry in modules.alias file would be:
      
          alias acpi*:010601:* ahci_platform
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NSuravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      26095a01
    • U
      PM / hibernate: clarify resume documentation · b51f9b10
      Uwe Geuder 提交于
      it was not the whole truth that kernel mode cannot be used with swap on LVM
      Signed-off-by: NUwe Geuder <linuxkernel2015-ugeuder@snkmail.com>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b51f9b10
    • G
      PM / Domains: Avoid infinite loops in attach/detach code · 93af5e93
      Geert Uytterhoeven 提交于
      If pm_genpd_{add,remove}_device() keeps on failing with -EAGAIN, we end
      up with an infinite loop in genpd_dev_pm_{at,de}tach().
      
      This may happen due to a genpd.prepared_count imbalance.  This is a bug
      elsewhere, but it will result in a system lock up, possibly during
      reboot of an otherwise functioning system.
      
      To avoid this, put a limit on the maximum number of loop iterations,
      using an exponential back-off mechanism.  If the limit is reached, the
      operation will just fail.  An error message is already printed.
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      93af5e93
    • R
      ACPI / LPSS: Fix up acpi_lpss_create_device() · d3e13ff3
      Rafael J. Wysocki 提交于
      Fix a return value (which should be a negative error code) and a
      memory leak (the list allocated by acpi_dev_get_resources() needs
      to be freed on ioremap() errors too) in acpi_lpss_create_device()
      introduced by commit 4483d59e 'ACPI / LPSS: check the result
      of ioremap()'.
      
      Fixes: 4483d59e 'ACPI / LPSS: check the result of ioremap()'
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Cc: 4.0+ <stable@vger.kernel.org> # 4.0+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d3e13ff3