1. 23 Apr, 2015 24 commits
  2. 20 Apr, 2015 1 commit
  3. 17 Apr, 2015 15 commits
    • Ameya Palande's avatar
      mfd: kempld-core: Fix callback return value check · bc943258
      Ameya Palande authored
      [ Upstream commit c8648508 ]
      
      On success, callback function returns 0. So invert the if condition
      check so that we can break out of loop.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAmeya Palande <2ameya@gmail.com>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      bc943258
    • Markos Chandras's avatar
      net: ethernet: pcnet32: Setup the SRAM and NOUFLO on Am79C97{3, 5} · 5f402128
      Markos Chandras authored
      [ Upstream commit 87f966d9 ]
      
      On a MIPS Malta board, tons of fifo underflow errors have been observed
      when using u-boot as bootloader instead of YAMON. The reason for that
      is that YAMON used to set the pcnet device to SRAM mode but u-boot does
      not. As a result, the default Tx threshold (64 bytes) is now too small to
      keep the fifo relatively used and it can result to Tx fifo underflow errors.
      As a result of which, it's best to setup the SRAM on supported controllers
      so we can always use the NOUFLO bit.
      
      Cc: <netdev@vger.kernel.org>
      Cc: <stable@vger.kernel.org>
      Cc: <linux-kernel@vger.kernel.org>
      Cc: Don Fry <pcnet32@frontier.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      5f402128
    • Scott Wood's avatar
      powerpc/mpc85xx: Add ranges to etsec2 nodes · 7b1b4376
      Scott Wood authored
      [ Upstream commit bb344ca5 ]
      
      Commit 746c9e9f "of/base: Fix PowerPC address parsing hack" limited
      the applicability of the workaround whereby a missing ranges is treated
      as an empty ranges.  This workaround was hiding a bug in the etsec2
      device tree nodes, which have children with reg, but did not have
      ranges.
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      Reported-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      7b1b4376
    • Tyrel Datwyler's avatar
      powerpc/pseries: Little endian fixes for post mobility device tree update · 950b8254
      Tyrel Datwyler authored
      [ Upstream commit f6ff0414 ]
      
      We currently use the device tree update code in the kernel after resuming
      from a suspend operation to re-sync the kernels view of the device tree with
      that of the hypervisor. The code as it stands is not endian safe as it relies
      on parsing buffers returned by RTAS calls that thusly contains data in big
      endian format.
      
      This patch annotates variables and structure members with __be types as well
      as performing necessary byte swaps to cpu endian for data that needs to be
      parsed.
      Signed-off-by: default avatarTyrel Datwyler <tyreld@linux.vnet.ibm.com>
      Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
      Cc: Cyril Bur <cyrilbur@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      950b8254
    • Catalin Marinas's avatar
      arm64: Use the reserved TTBR0 if context switching to the init_mm · 20ecb85c
      Catalin Marinas authored
      [ Upstream commit e53f21bc ]
      
      The idle_task_exit() function may call switch_mm() with next ==
      &init_mm. On arm64, init_mm.pgd cannot be used for user mappings, so
      this patch simply sets the reserved TTBR0.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: default avatarJon Medhurst (Tixy) <tixy@linaro.org>
      Tested-by: default avatarJon Medhurst (Tixy) <tixy@linaro.org>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      20ecb85c
    • Keerthy's avatar
      regulator: palmas: Correct TPS659038 register definition for REGEN2 · 3d8fc138
      Keerthy authored
      [ Upstream commit e03826d5 ]
      
      The register offset for REGEN2_CTRL in different for TPS659038 chip as when
      compared with other Palmas family PMICs. In the case of TPS659038 the wrong
      offset pointed to PLLEN_CTRL and was causing a hang. Correcting the same.
      Signed-off-by: default avatarKeerthy <j-keerthy@ti.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      3d8fc138
    • Mahesh Salgaonkar's avatar
      powerpc/book3s: Fix the MCE code to use CONFIG_KVM_BOOK3S_64_HANDLER · bac01bf2
      Mahesh Salgaonkar authored
      [ Upstream commit 44d5f6f5 ]
      
      commit id 2ba9f0d8 has changed CONFIG_KVM_BOOK3S_64_HV to tristate to allow
      HV/PR bits to be built as modules. But the MCE code still depends on
      CONFIG_KVM_BOOK3S_64_HV which is wrong. When user selects
      CONFIG_KVM_BOOK3S_64_HV=m to build HV/PR bits as a separate module the
      relevant MCE code gets excluded.
      
      This patch fixes the MCE code to use CONFIG_KVM_BOOK3S_64_HANDLER. This
      makes sure that the relevant MCE code is included when HV/PR bits
      are built as a separate modules.
      
      Fixes: 2ba9f0d8 ("kvm: powerpc: book3s: Support building HV and PR KVM as module")
      Cc: stable@vger.kernel.org  # v3.14+
      Signed-off-by: default avatarMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Acked-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      bac01bf2
    • Tony Luck's avatar
      sb_edac: Fix typo computing number of banks · 32ac769b
      Tony Luck authored
      [ Upstream commit fec53af5 ]
      
      Code will always think there are 16 banks because of a typo
      
      Reported-by: Misha
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      Acked-by: default avatarAristeu Rozanski <aris@redhat.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      32ac769b
    • Tony Luck's avatar
      sb_edac: Fix discovery of top-of-low-memory for Haswell · e3d11d50
      Tony Luck authored
      [ Upstream commit f7cf2a22 ]
      
      Haswell moved the TOLM/TOHM registers to a different device and offset.
      The sb_edac driver accounted for the change of device, but not for the
      new offset.  There was also a typo in the constant to fill in the low
      26 bits (was 0x1ffffff, should be 0x3ffffff).
      
      This resulted in a bogus value for the top of low memory:
      
        EDAC DEBUG: get_memory_layout: TOLM: 0.032 GB (0x0000000001ffffff)
      
      which would result in EDAC refusing to translate addresses for
      errors above the bogus value and below 4GB:
      
         sbridge MC3: HANDLING MCE MEMORY ERROR
         sbridge MC3: CPU 0: Machine Check Event: 0 Bank 7: 8c00004000010090
         sbridge MC3: TSC 0
         sbridge MC3: ADDR 2000000
         sbridge MC3: MISC 523eac86
         sbridge MC3: PROCESSOR 0:306f3 TIME 1414600951 SOCKET 0 APIC 0
         MC3: 1 CE Error at TOLM area, on addr 0x02000000 on any memory ( page:0x0 offset:0x0 grain:32 syndrome:0x0)
      
      With the fix we see the correct TOLM value:
      
         DEBUG: get_memory_layout: TOLM: 2.048 GB (0x000000007fffffff)
      
      and we decode address 2000000 correctly:
      
         sbridge MC3: HANDLING MCE MEMORY ERROR
         sbridge MC3: CPU 0: Machine Check Event: 0 Bank 7: 8c00004000010090
         sbridge MC3: TSC 0
         sbridge MC3: ADDR 2000000
         sbridge MC3: MISC 523e1086
         sbridge MC3: PROCESSOR 0:306f3 TIME 1414601319 SOCKET 0 APIC 0
         DEBUG: get_memory_error_data: SAD interleave package: 0 = CPU socket 0, HA 0, shiftup: 0
         DEBUG: get_memory_error_data: TAD#0: address 0x0000000002000000 < 0x000000007fffffff, socket interleave 1, channel interleave 4 (offset 0x00000000), index 0, base ch: 0, ch mask: 0x01
         DEBUG: get_memory_error_data: RIR#0, limit: 4.095 GB (0x00000000ffffffff), way: 1
         DEBUG: get_memory_error_data: RIR#0: channel address 0x00200000 < 0xffffffff, RIR interleave 0, index 0
         DEBUG: sbridge_mce_output_error:  area:DRAM err_code:0001:0090 socket:0 channel_mask:1 rank:0
         MC3: 1 CE memory read error on CPU_SrcID#0_Channel#0_DIMM#0 (channel:0 slot:0 page:0x2000 offset:0x0 grain:32 syndrome:0x0 -  area:DRAM err_code:0001:0090 socket:0 channel_mask:1 rank:0)
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      Acked-by: default avatarAristeu Rozanski <aris@redhat.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      e3d11d50
    • Ilya Dryomov's avatar
      Revert "libceph: use memalloc flags for net IO" · 310ba06e
      Ilya Dryomov authored
      [ Upstream commit 6d7fdb0a ]
      
      This reverts commit 89baaa57.
      
      Dirty page throttling should be sufficient for us in the general case
      so there is no need to use __GFP_MEMALLOC - it would be needed only in
      the swap-over-rbd case, which we currently don't support.  (It would
      probably take approximately the commit that is being reverted to add
      that support, but we would also need the "swap" option to distinguish
      from the general case and make sure swap ceph_client-s aren't shared
      with anything else.)  See ceph-devel threads [1] and [2] for the
      details of why enabling pfmemalloc reserves for all cases is a bad
      thing.
      
      On top of potential system lockups related to drained emergency
      reserves, this turned out to cause ceph lockups in case peers are on
      the same host and communicating via loopback due to sk_filter()
      dropping pfmemalloc skbs on the receiving side because the receiving
      loopback socket is not tagged with SOCK_MEMALLOC.
      
      [1] "SOCK_MEMALLOC vs loopback"
          http://www.spinics.net/lists/ceph-devel/msg22998.html
      [2] "[PATCH] libceph: don't set memalloc flags in loopback case"
          http://www.spinics.net/lists/ceph-devel/msg23392.html
      
      Conflicts:
      	net/ceph/messenger.c [ context: tcp_nodelay option ]
      
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Sage Weil <sage@redhat.com>
      Cc: stable@vger.kernel.org # 3.18+, needs backporting
      Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Acked-by: default avatarMike Christie <michaelc@cs.wisc.edu>
      Acked-by: default avatarMel Gorman <mgorman@suse.de>
      [idryomov@gmail.com: backport to 3.18, 3.19: context]
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      310ba06e
    • Sergei Antonov's avatar
      hfsplus: fix B-tree corruption after insertion at position 0 · 44f6282e
      Sergei Antonov authored
      [ Upstream commit 98cf21c6 ]
      
      Fix B-tree corruption when a new record is inserted at position 0 in the
      node in hfs_brec_insert().  In this case a hfs_brec_update_parent() is
      called to update the parent index node (if exists) and it is passed
      hfs_find_data with a search_key containing a newly inserted key instead
      of the key to be updated.  This results in an inconsistent index node.
      The bug reproduces on my machine after an extents overflow record for
      the catalog file (CNID=4) is inserted into the extents overflow B-tree.
      Because of a low (reserved) value of CNID=4, it has to become the first
      record in the first leaf node.
      
      The resulting first leaf node is correct:
      
        ----------------------------------------------------
        | key0.CNID=4 | key1.CNID=123 | key2.CNID=456, ... |
        ----------------------------------------------------
      
      But the parent index key0 still contains the previous key CNID=123:
      
        -----------------------
        | key0.CNID=123 | ... |
        -----------------------
      
      A change in hfs_brec_insert() makes hfs_brec_update_parent() work
      correctly by preventing it from getting fd->record=-1 value from
      __hfs_brec_find().
      
      Along the way, I removed duplicate code with unification of the if
      condition.  The resulting code is equivalent to the original code
      because node is never 0.
      
      Also hfs_brec_update_parent() will now return an error after getting a
      negative fd->record value.  However, the return value of
      hfs_brec_update_parent() is not checked anywhere in the file and I'm
      leaving it unchanged by this patch.  brec.c lacks error checking after
      some other calls too, but this issue is of less importance than the one
      being fixed by this patch.
      Signed-off-by: default avatarSergei Antonov <saproj@gmail.com>
      Cc: Joe Perches <joe@perches.com>
      Reviewed-by: default avatarVyacheslav Dubeyko <slava@dubeyko.com>
      Acked-by: default avatarHin-Tak Leung <htl10@users.sourceforge.net>
      Cc: Anton Altaparmakov <aia21@cam.ac.uk>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      44f6282e
    • Uwe Kleine-König's avatar
      spi: trigger trace event for message-done before mesg->complete · ea4e289c
      Uwe Kleine-König authored
      [ Upstream commit 391949b6 ]
      
      With spidev the mesg->complete callback points to spidev_complete.
      Calling this unblocks spidev_sync and so spidev_sync_write finishes. As
      the struct spi_message just read is a local variable in
      spidev_sync_write and recording the trace event accesses this message
      the recording is better done first. The same can happen for
      spidev_sync_read.
      
      This fixes an oops observed on a 3.14-rt system with spidev activity
      after
      
      	echo 1 > /sys/kernel/debug/tracing/events/spi/enable
      
      .
      Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      ea4e289c
    • Ivan T. Ivanov's avatar
      spi: qup: Fix cs-num DT property parsing · 7cc582d4
      Ivan T. Ivanov authored
      [ Upstream commit 12cb89e3 ]
      
      num-cs is 32 bit property, don't read just upper 16 bits.
      
      Fixes: 4a8573ab (spi: qup: Remove chip select function)
      Signed-off-by: default avatarIvan T. Ivanov <iivanov@mm-sol.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      7cc582d4
    • Mikulas Patocka's avatar
      dm snapshot: suspend merging snapshot when doing exception handover · c280422c
      Mikulas Patocka authored
      [ Upstream commit 09ee96b2 ]
      
      The "dm snapshot: suspend origin when doing exception handover" commit
      fixed a exception store handover bug associated with pending exceptions
      to the "snapshot-origin" target.
      
      However, a similar problem exists in snapshot merging.  When snapshot
      merging is in progress, we use the target "snapshot-merge" instead of
      "snapshot-origin".  Consequently, during exception store handover, we
      must find the snapshot-merge target and suspend its associated
      mapped_device.
      
      To avoid lockdep warnings, the target must be suspended and resumed
      without holding _origins_lock.
      
      Introduce a dm_hold() function that grabs a reference on a
      mapped_device, but unlike dm_get(), it doesn't crash if the device has
      the DMF_FREEING flag set, it returns an error in this case.
      
      In snapshot_resume() we grab the reference to the origin device using
      dm_hold() while holding _origins_lock (_origins_lock guarantees that the
      device won't disappear).  Then we release _origins_lock, suspend the
      device and grab _origins_lock again.
      
      NOTE to stable@ people:
      When backporting to kernels 3.18 and older, use dm_internal_suspend and
      dm_internal_resume instead of dm_internal_suspend_fast and
      dm_internal_resume_fast.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c280422c
    • Mikulas Patocka's avatar
      dm snapshot: suspend origin when doing exception handover · 306d7122
      Mikulas Patocka authored
      [ Upstream commit b735fede ]
      
      In the function snapshot_resume we perform exception store handover.  If
      there is another active snapshot target, the exception store is moved
      from this target to the target that is being resumed.
      
      The problem is that if there is some pending exception, it will point to
      an incorrect exception store after that handover, causing a crash due to
      dm-snap-persistent.c:get_exception()'s BUG_ON.
      
      This bug can be triggered by repeatedly changing snapshot permissions
      with "lvchange -p r" and "lvchange -p rw" while there are writes on the
      associated origin device.
      
      To fix this bug, we must suspend the origin device when doing the
      exception store handover to make sure that there are no pending
      exceptions:
      - introduce _origin_hash that keeps track of dm_origin structures.
      - introduce functions __lookup_dm_origin, __insert_dm_origin and
        __remove_dm_origin that manipulate the origin hash.
      - modify snapshot_resume so that it calls dm_internal_suspend_fast() and
        dm_internal_resume_fast() on the origin device.
      
      NOTE to stable@ people:
      
      When backporting to kernels 3.12-3.18, use dm_internal_suspend and
      dm_internal_resume instead of dm_internal_suspend_fast and
      dm_internal_resume_fast.
      
      When backporting to kernels older than 3.12, you need to pick functions
      dm_internal_suspend and dm_internal_resume from the commit
      fd2ed4d2.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      306d7122