Skip to content
  1. Jul 11, 2015
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 1604f871
      Linus Torvalds authored
      Pull arm64 fixes and clean-up from Catalin Marinas:
       - ACPI fix when checking the validity of the GICC MADT subtable
       - handle debug exceptions in the el*_inv exception entries
       - remove pointless register assignment in two compat syscall wrappers
       - unnecessary include path
       - defconfig update
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: entry32: remove pointless register assignment
        arm64: entry: handle debug exceptions in el*_inv
        arm64: Keep the ARM64 Kconfig selects sorted
        ACPI / ARM64 : use the new BAD_MADT_GICC_ENTRY macro
        ACPI / ARM64: add BAD_MADT_GICC_ENTRY() macro
        arm64: defconfig: Add Ceva ahci to the defconfig
        arm64: remove another unnecessary libfdt include path
      1604f871
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 3cdeb9d1
      Linus Torvalds authored
      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. Jul 10, 2015
  3. Jul 09, 2015
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-4.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 883a2dfd
      Linus Torvalds authored
      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
    • Linus Torvalds's avatar
      Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile · 331c5841
      Linus Torvalds authored
      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
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux · 9d993ccb
      Linus Torvalds authored
      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
    • Chris Metcalf's avatar
      modpost: work correctly with tile coldtext sections · 673c2c34
      Chris Metcalf authored
      
      
      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: default avatarChris Metcalf <cmetcalf@ezchip.com>
      Acked-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      673c2c34
    • Peter Zijlstra's avatar
      module: Fix load_module() error path · 758556bd
      Peter Zijlstra authored
      
      
      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: default avatarArthur Marsh <arthur.marsh@internode.on.net>
      Tested-by: default avatarArthur Marsh <arthur.marsh@internode.on.net>
      Fixes: 93c2e105
      
       ("module: Optimize __module_address() using a latched RB-tree")
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      758556bd
    • Mark Rutland's avatar
      arm64: entry: handle debug exceptions in el*_inv · 1b42804d
      Mark Rutland authored
      
      
      Currently we enable debug exceptions before reading ESR_EL1 in both
      el0_inv and el1_inv. If a debug exception is taken before we read
      ESR_EL1, the value will have been corrupted.
      
      As el*_inv is typically fatal, an intervening debug exception results in
      misleading debug information being logged to the console, but is not
      otherwise harmful.
      
      As with the other entry paths, we can use the ESR_EL1 value stashed
      earlier in the exception entry (in x25 for el0_sync{,_compat}, and x1
      for el1_sync), giving us better error reporting in this case.
      
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      1b42804d
    • Linus Torvalds's avatar
      Fix broken audit tests for exec arg len · 45820c29
      Linus Torvalds authored
      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: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Paul Moore <pmoore@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      45820c29
  4. Jul 08, 2015
  5. Jul 07, 2015
    • Al Stone's avatar
      ACPI / ARM64 : use the new BAD_MADT_GICC_ENTRY macro · 99e3e3ae
      Al Stone authored
      For those parts of the arm64 ACPI code that need to check GICC subtables
      in the MADT, use the new BAD_MADT_GICC_ENTRY macro instead of the previous
      BAD_MADT_ENTRY.  The new macro takes into account differences in the size
      of the GICC subtable that the old macro did not; this caused failures even
      though the subtable entries are valid.
      
      Fixes: aeb823bb
      
       ("ACPICA: ACPI 6.0: Add changes for FADT table.")
      Signed-off-by: default avatarAl Stone <al.stone@linaro.org>
      Reviewed-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Acked-by: default avatar"Rafael J. Wysocki" <rjw@rjwysocki.net>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      99e3e3ae
    • Al Stone's avatar
      ACPI / ARM64: add BAD_MADT_GICC_ENTRY() macro · b6cfb277
      Al Stone authored
      The BAD_MADT_ENTRY() macro is designed to work for all of the subtables
      of the MADT.  In the ACPI 5.1 version of the spec, the struct for the
      GICC subtable (struct acpi_madt_generic_interrupt) is 76 bytes long; in
      ACPI 6.0, the struct is 80 bytes long.  But, there is only one definition
      in ACPICA for this struct -- and that is the 6.0 version.  Hence, when
      BAD_MADT_ENTRY() compares the struct size to the length in the GICC
      subtable, it fails if 5.1 structs are in use, and there are systems in
      the wild that have them.
      
      This patch adds the BAD_MADT_GICC_ENTRY() that checks the GICC subtable
      only, accounting for the difference in specification versions that are
      possible.  The BAD_MADT_ENTRY() will continue to work as is for all other
      MADT subtables.
      
      This code is being added to an arm64 header file since that is currently
      the only architecture using the GICC subtable of the MADT.  As a GIC is
      specific to ARM, it is also unlikely the subtable will be used elsewhere.
      
      Fixes: aeb823bb
      
       ("ACPICA: ACPI 6.0: Add changes for FADT table.")
      Signed-off-by: default avatarAl Stone <al.stone@linaro.org>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Acked-by: default avatar"Rafael J. Wysocki" <rjw@rjwysocki.net>
      [catalin.marinas@arm.com: extra brackets around macro arguments]
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      b6cfb277
    • Russell King's avatar
      06be5eef
    • Rafael J. Wysocki's avatar
      PM / wakeirq: Avoid setting power.wakeirq too hastily · 6d3dab7d
      Rafael J. Wysocki authored
      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: default avatarFelipe Balbi <balbi@ti.com>
      Tested-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6d3dab7d
    • Michael Neuling's avatar
      cxl: Fix refcounting in kernel API · 3f8dc44d
      Michael Neuling authored
      
      
      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: default avatarMichael Neuling <mikey@neuling.org>
      Acked-by: default avatarIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      3f8dc44d
    • Shreyas B. Prabhu's avatar
      powerpc/powernv: Fix race in updating core_idle_state · b32aadc1
      Shreyas B. Prabhu authored
      
      
      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: default avatarShreyas 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: default avatarMichael Ellerman <mpe@ellerman.id.au>
      b32aadc1