Skip to content
  1. Aug 05, 2014
    • David S. Miller's avatar
      sparc64: Guard against flushing openfirmware mappings. · 4ca9a237
      David S. Miller authored
      Based almost entirely upon a patch by Christopher Alexander Tobias
      Schulze.
      
      In commit db64fe02
      
       ("mm: rewrite vmap
      layer") lazy VMAP tlb flushing was added to the vmalloc layer.  This
      causes problems on sparc64.
      
      Sparc64 has two VMAP mapped regions and they are not contiguous with
      eachother.  First we have the malloc mapping area, then another
      unrelated region, then the vmalloc region.
      
      This "another unrelated region" is where the firmware is mapped.
      
      If the lazy TLB flushing logic in the vmalloc code triggers after
      we've had both a module unload and a vfree or similar, it will pass an
      address range that goes from somewhere inside the malloc region to
      somewhere inside the vmalloc region, and thus covering the
      openfirmware area entirely.
      
      The sparc64 kernel learns about openfirmware's dynamic mappings in
      this region early in the boot, and then services TLB misses in this
      area.  But openfirmware has some locked TLB entries which are not
      mentioned in those dynamic mappings and we should thus not disturb
      them.
      
      These huge lazy TLB flush ranges causes those openfirmware locked TLB
      entries to be removed, resulting in all kinds of problems including
      hard hangs and crashes during reboot/reset.
      
      Besides causing problems like this, such huge TLB flush ranges are
      also incredibly inefficient.  A plea has been made with the author of
      the VMAP lazy TLB flushing code, but for now we'll put a safety guard
      into our flush_tlb_kernel_range() implementation.
      
      Since the implementation has become non-trivial, stop defining it as a
      macro and instead make it a function in a C source file.
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ca9a237
    • Christopher Alexander Tobias Schulze's avatar
      sunsab: Fix detection of BREAK on sunsab serial console · fe418231
      Christopher Alexander Tobias Schulze authored
      
      
      Fix detection of BREAK on sunsab serial console: BREAK detection was only
      performed when there were also serial characters received simultaneously.
      To handle all BREAKs correctly, the check for BREAK and the corresponding
      call to uart_handle_break() must also be done if count == 0, therefore
      duplicate this code fragment and pull it out of the loop over the received
      characters.
      
      Patch applies to 3.16-rc6.
      
      Signed-off-by: default avatarChristopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fe418231
    • Christopher Alexander Tobias Schulze's avatar
      bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000 · 5cdceab3
      Christopher Alexander Tobias Schulze authored
      
      
      Fix regression in bbc i2c temperature and fan control on some Sun systems
      that causes the driver to refuse to load due to the bbc_i2c_bussel resource not
      being present on the (second) i2c bus where the temperature sensors and fan
      control are located. (The check for the number of resources was removed when
      the driver was ported to a pure OF driver in mid 2008.)
      
      Signed-off-by: default avatarChristopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5cdceab3
    • David S. Miller's avatar
      sparc64: Do not insert non-valid PTEs into the TSB hash table. · 18f38132
      David S. Miller authored
      
      
      The assumption was that update_mmu_cache() (and the equivalent for PMDs) would
      only be called when the PTE being installed will be accessible by the user.
      
      This is not true for code paths originating from remove_migration_pte().
      
      There are dire consequences for placing a non-valid PTE into the TSB.  The TLB
      miss frramework assumes thatwhen a TSB entry matches we can just load it into
      the TLB and return from the TLB miss trap.
      
      So if a non-valid PTE is in there, we will deadlock taking the TLB miss over
      and over, never satisfying the miss.
      
      Just exit early from update_mmu_cache() and friends in this situation.
      
      Based upon a report and patch from Christopher Alexander Tobias Schulze.
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      18f38132
  2. Jul 29, 2014
  3. Jul 28, 2014
  4. Jul 27, 2014
    • Linus Torvalds's avatar
      Fix gcc-4.9.0 miscompilation of load_balance() in scheduler · 2062afb4
      Linus Torvalds authored
      Michel Dänzer and a couple of other people reported inexplicable random
      oopses in the scheduler, and the cause turns out to be gcc mis-compiling
      the load_balance() function when debugging is enabled.  The gcc bug
      apparently goes back to gcc-4.5, but slight optimization changes means
      that it now showed up as a problem in 4.9.0 and 4.9.1.
      
      The instruction scheduling problem causes gcc to schedule a spill
      operation to before the stack frame has been created, which in turn can
      corrupt the spilled value if an interrupt comes in.  There may be other
      effects of this bug too, but that's the code generation problem seen in
      Michel's case.
      
      This is fixed in current gcc HEAD, but the workaround as suggested by
      Markus Trippelsdorf is pretty simple: use -fno-var-tracking-assignments
      when compiling the kernel, which disables the gcc code that causes the
      problem.  This can result in slightly worse debug information for
      variable accesses, but that is infinitely preferable to actual code
      generation problems.
      
      Doing this unconditionally (not just for CONFIG_DEBUG_INFO) also allows
      non-debug builds to verify that the debug build would be identical: we
      can do
      
          export GCC_COMPARE_DEBUG=1
      
      to make gcc internally verify that the result of the build is
      independent of the "-g" flag (it will make the compiler build everything
      twice, toggling the debug flag, and compare the results).
      
      Without the "-fno-var-tracking-assignments" option, the build would fail
      (even with 4.8.3 that didn't show the actual stack frame bug) with a gcc
      compare failure.
      
      See also gcc bugzilla:
      
        https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801
      
      
      
      Reported-by: default avatarMichel Dänzer <michel@daenzer.net>
      Suggested-by: default avatarMarkus Trippelsdorf <markus@trippelsdorf.de>
      Cc: Jakub Jelinek <jakub@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2062afb4
    • Hugh Dickins's avatar
      mm: fix direct reclaim writeback regression · 8bdd6380
      Hugh Dickins authored
      Shortly before 3.16-rc1, Dave Jones reported:
      
        WARNING: CPU: 3 PID: 19721 at fs/xfs/xfs_aops.c:971
                 xfs_vm_writepage+0x5ce/0x630 [xfs]()
        CPU: 3 PID: 19721 Comm: trinity-c61 Not tainted 3.15.0+ #3
        Call Trace:
          xfs_vm_writepage+0x5ce/0x630 [xfs]
          shrink_page_list+0x8f9/0xb90
          shrink_inactive_list+0x253/0x510
          shrink_lruvec+0x563/0x6c0
          shrink_zone+0x3b/0x100
          shrink_zones+0x1f1/0x3c0
          try_to_free_pages+0x164/0x380
          __alloc_pages_nodemask+0x822/0xc90
          alloc_pages_vma+0xaf/0x1c0
          handle_mm_fault+0xa31/0xc50
        etc.
      
       970   if (WARN_ON_ONCE((current->flags & (PF_MEMALLOC|PF_KSWAPD)) ==
       971                   PF_MEMALLOC))
      
      I did not respond at the time, because a glance at the PageDirty block
      in shrink_page_list() quickly shows that this is impossible: we don't do
      writeback on file pages (other than tmpfs) from direct reclaim nowadays.
      Dave was hallucinating, but it would have been disrespectful to say so.
      
      However, my own /var/log/messages now shows similar complaints
      
        WARNING: CPU: 1 PID: 28814 at fs/ext4/inode.c:1881 ext4_writepage+0xa7/0x38b()
        WARNING: CPU: 0 PID: 27347 at fs/ext4/inode.c:1764 ext4_writepage+0xa7/0x38b()
      
      from stressing some mmotm trees during July.
      
      Could a dirty xfs or ext4 file page somehow get marked PageSwapBacked,
      so fail shrink_page_list()'s page_is_file_cache() test, and so proceed
      to mapping->a_ops->writepage()?
      
      Yes, 3.16-rc1's commit 68711a74
      
       ("mm, migration: add destination
      page freeing callback") has provided such a way to compaction: if
      migrating a SwapBacked page fails, its newpage may be put back on the
      list for later use with PageSwapBacked still set, and nothing will clear
      it.
      
      Whether that can do anything worse than issue WARN_ON_ONCEs, and get
      some statistics wrong, is unclear: easier to fix than to think through
      the consequences.
      
      Fixing it here, before the put_new_page(), addresses the bug directly,
      but is probably the worst place to fix it.  Page migration is doing too
      many parts of the job on too many levels: fixing it in
      move_to_new_page() to complement its SetPageSwapBacked would be
      preferable, except why is it (and newpage->mapping and newpage->index)
      done there, rather than down in migrate_page_move_mapping(), once we are
      sure of success? Not a cleanup to get into right now, especially not
      with memcg cleanups coming in 3.17.
      
      Reported-by: default avatarDave Jones <davej@redhat.com>
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8bdd6380
  5. Jul 26, 2014
  6. Jul 25, 2014
    • H. Peter Anvin's avatar
      x86: Merge tag 'ras_urgent' into x86/urgent · bf72f5de
      H. Peter Anvin authored
      Promote one fix for 3.16
      
      This fix was necessary after
      
      9c15a24b ("x86/mce: Improve mcheck_init_device() error handling")
      
      went in. What this patch did was, among others, check the return value
      of misc_register and exit early if it encountered an error. Original
      code sloppily didn't do that.
      
      However,
      
              cef12ee5
      
       ("xen/mce: Add mcelog support for Xen platform")
      
      made it so that xen's init routine xen_late_init_mcelog runs first. This
      was needed for the xen mcelog device which is supposed to be independent
      from the baremetal one.
      
      Initially it was reported that misc_register() fails often on xen and
      that's why it needed fixing. However, it is *supposed* to fail by
      design, when running in dom0 so that the xen mcelog device file gets
      registered first.
      
      And *then* you need the notifier *not* unregistered on the error path so
      that the timer does get deleted properly in the CPU hotplug notifier.
      
      Btw, this fix is needed also on baremetal in the unlikely event that
      misc_register(&mce_chrdev_device) fails there too.
      
      I was unsure whether to rush it in now and decided to delay it to 3.17.
      However, xen people wanted it promoted as it breaks xen when doing cpu
      hotplug there. So, after a bit of simmering in tip/master for initial
      smoke testing, let's move it to 3.16. It fixes a semi-regression which
      got introduced in 3.16 so no need for stable tagging.
      
      tip/x86/ras contains that exact same commit but we can't remove it
      there as it is not the last one. It won't cause any merge issues, as I
      confirmed locally but I should state here the special situation of this
      one fix explicitly anyway.
      
      Thanks.
      
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      bf72f5de
    • Jerome Glisse's avatar
      drm/radeon: fix cut and paste issue for hawaii. · 1b2c4869
      Jerome Glisse authored
      
      
      This is a halfway fix for hawaii acceleration. More fixes to come
      but hopefully isolated to userspace.
      
      Signed-off-by: default avatarJérôme Glisse <jglisse@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      1b2c4869
    • Dave Airlie's avatar
      Merge branch 'drm-fixes-3.16' of git://people.freedesktop.org/~agd5f/linux into drm-fixes · 97cefc3e
      Dave Airlie authored
      two more radeon fixes.
      
      * 'drm-fixes-3.16' of git://people.freedesktop.org/~agd5f/linux:
        drm/radeon: fix irq ring buffer overflow handling
        drm/radeon: fix error handling in radeon_vm_bo_set_addr
      97cefc3e
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2014-07-24' of git://anongit.freedesktop.org/drm-intel into drm-fixes · 9d6ed3c6
      Dave Airlie authored
      This time in time! Just 32bit-pae fix from Hugh, semaphores fun from Chris
      and a fix for runtime pm cherry-picked from next.
      
      Paulo is still working on a fix for runtime pm when X does cursor fun when
      the display is off, but that one isn't ready yet.
      
      * tag 'drm-intel-fixes-2014-07-24' of git://anongit.freedesktop.org/drm-intel:
        drm/i915: Simplify i915_gem_release_all_mmaps()
        drm/i915: fix freeze with blank screen booting highmem
        drm/i915: Reorder the semaphore deadlock check, again
      9d6ed3c6
    • HIMANGI SARAOGI's avatar
      parisc: Eliminate memset after alloc_bootmem_pages · 9794144d
      HIMANGI SARAOGI authored
      
      
      alloc_bootmem and related function always return zeroed region of
      memory. Thus a memset after calls to these functions is unnecessary.
      
      The following Coccinelle semantic patch was used for making the change:
      
      @@
      expression E,E1;
      @@
      
      E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...)
      ... when != E
      - memset(E,0,E1);
      
      Signed-off-by: default avatarHimangi Saraogi <himangi774@gmail.com>
      Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      9794144d
    • John David Anglin's avatar
      parisc: Remove SA_RESTORER define · 20dbea49
      John David Anglin authored
      
      
      The sa_restorer field in struct sigaction is obsolete and no longer in
      the parisc implementation.  However, the core code assumes the field is
      present if SA_RESTORER is defined. So, the define needs to be removed.
      
      Signed-off-by: default avatarJohn David Anglin <dave.anglin@bell.net>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      20dbea49
  7. Jul 24, 2014
    • Guenter Roeck's avatar
      hwmon: (smsc47m192) Fix temperature limit and vrm write operations · 043572d5
      Guenter Roeck authored
      
      
      Temperature limit clamps are applied after converting the temperature
      from milli-degrees C to degrees C, so either the clamp limit needs
      to be specified in degrees C, not milli-degrees C, or clamping must
      happen before converting to degrees C. Use the latter method to avoid
      overflows.
      
      vrm is an u8, so the written value needs to be limited to [0, 255].
      
      Cc: Axel Lin <axel.lin@ingics.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
      043572d5
    • Vasily Averin's avatar
      fs: umount on symlink leaks mnt count · 295dc39d
      Vasily Averin authored
      
      
      Currently umount on symlink blocks following umount:
      
      /vz is separate mount
      
      # ls /vz/ -al | grep test
      drwxr-xr-x.  2 root root       4096 Jul 19 01:14 testdir
      lrwxrwxrwx.  1 root root         11 Jul 19 01:16 testlink -> /vz/testdir
      # umount -l /vz/testlink
      umount: /vz/testlink: not mounted (expected)
      
      # lsof /vz
      # umount /vz
      umount: /vz: device is busy. (unexpected)
      
      In this case mountpoint_last() gets an extra refcount on path->mnt
      
      Signed-off-by: default avatarVasily Averin <vvs@openvz.org>
      Acked-by: default avatarIan Kent <raven@themaw.net>
      Acked-by: default avatarJeff Layton <jlayton@primarydata.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      295dc39d
    • Boaz Harrosh's avatar
      direct-io: fix uninitialized warning in do_direct_IO() · 6fcc5420
      Boaz Harrosh authored
      
      
      The following warnings:
      
        fs/direct-io.c: In function ‘__blockdev_direct_IO’:
        fs/direct-io.c:1011:12: warning: ‘to’ may be used uninitialized in this function [-Wmaybe-uninitialized]
        fs/direct-io.c:913:16: note: ‘to’ was declared here
        fs/direct-io.c:1011:12: warning: ‘from’ may be used uninitialized in this function [-Wmaybe-uninitialized]
        fs/direct-io.c:913:10: note: ‘from’ was declared here
      
      are false positive because dio_get_page() either fails, or sets both
      'from' and 'to'.
      
      Paul Bolle said ...
      Maybe it's better to move initializing "to" and "from" out of
      dio_get_page(). That _might_ make it easier for both the the reader and
      the compiler to understand what's going on. Something like this:
      
      Christoph Hellwig said ...
      The fix of moving the code definitively looks nicer, while I think
      uninitialized_var is horrible wart that won't get anywhere near my code.
      
      Boaz Harrosh: I agree with Christoph and Paul
      
      Signed-off-by: default avatarBoaz Harrosh <boaz@plexistor.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      6fcc5420
    • Linus Torvalds's avatar
      Merge branch 'for-3.16' of git://linux-nfs.org/~bfields/linux · 82e13c71
      Linus Torvalds authored
      Pull nfsd bugfix from Bruce Fields:
       "Another regression from the xdr encoding rewrite"
      
      * 'for-3.16' of git://linux-nfs.org/~bfields/linux:
        NFSD: Fix crash encoding lock reply on 32-bit
      82e13c71