1. 16 Jan, 2013 15 commits
    • Gabor Juhos's avatar
      powerpc: Add missing NULL terminator to avoid boot panic on PPC40x · 4675bae4
      Gabor Juhos authored
      commit e6449c9b upstream.
      
      The missing NULL terminator can cause a panic on
      PPC405 boards during boot:
      
        Linux/PowerPC load: console=ttyS0,115200 root=/dev/mtdblock1 rootfstype=squashfs,jffs2 noinitrd init=/etc/preinit
        Finalizing device tree... flat tree at 0x6a5160
        bootconsole [udbg0] enabled
        Page fault in user mode with in_atomic() = 1 mm = (null)
        NIP = c0275f50  MSR = fffffffe
        Oops: Weird page fault, sig: 11 [#1]
        PowerPC 40x Platform
        Modules linked in:
        NIP: c0275f50 LR: c0275f60 CTR: c0280000
        REGS: c0275eb0 TRAP: 636f7265   Not tainted  (3.7.1)
        MSR: fffffffe <VEC,VSX,EE,PR,FP,ME,SE,BE,IR,DR,PMM,RI> CR: c06a6190  XER: 00000001
        TASK = c02662a8[0] 'swapper' THREAD: c0274000
        GPR00: c0275ec0 c000c658 c027c4bf 00000000 c0275ee0 c000a0ec c020a1a8 c020a1f0
        GPR08: c020f631 c020f404 c025f078 c025f080 c0275f10
         Call Trace:
         ---[ end trace 31fd0ba7d8756001 ]---
      
        Kernel panic - not syncing: Attempted to kill the idle task!
      
      The panic happens since commit 9597abe0
      (sections: fix section conflicts in arch/powerpc), however the root
      cause of this is that the NULL terminator were not added in commit
      a4f740cf (of/flattree: Add of_flat_dt_match()
      helper function).
      
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: default avatarGabor Juhos <juhosg@openwrt.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      4675bae4
    • Shan Hai's avatar
      powerpc/vdso: Remove redundant locking in update_vsyscall_tz() · 615df262
      Shan Hai authored
      commit ce73ec6d upstream.
      
      The locking in update_vsyscall_tz() is not only unnecessary because the vdso
      code copies the data unproteced in __kernel_gettimeofday() but also
      introduces a hard to reproduce race condition between update_vsyscall()
      and update_vsyscall_tz(), which causes user space process to loop
      forever in vdso code.
      
      The following patch removes the locking from update_vsyscall_tz().
      
      Locking is not only unnecessary because the vdso code copies the data
      unprotected in __kernel_gettimeofday() but also erroneous because updating
      the tb_update_count is not atomic and introduces a hard to reproduce race
      condition between update_vsyscall() and update_vsyscall_tz(), which further
      causes user space process to loop forever in vdso code.
      
      The below scenario describes the race condition,
      x==0	Boot CPU			other CPU
      	proc_P: x==0
      	    timer interrupt
      		update_vsyscall
      x==1		    x++;sync		settimeofday
      					    update_vsyscall_tz
      x==2						x++;sync
      x==3		    sync;x++
      						sync;x++
      	proc_P: x==3 (loops until x becomes even)
      
      Because the ++ operator would be implemented as three instructions and not
      atomic on powerpc.
      
      A similar change was made for x86 in commit 6c260d58
      ("x86: vdso: Remove bogus locking in update_vsyscall_tz")
      Signed-off-by: default avatarShan Hai <shan.hai@windriver.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      615df262
    • Christian Lamparter's avatar
      p54usb: add USBIDs for two more p54usb devices · 2fe324ea
      Christian Lamparter authored
      commit 4010fe21 upstream.
      
      This patch adds USBIDs for:
      	- DrayTek Vigor 530
      	- Zoom 4410a
      
      It also adds a note about Gemtek WUBI-100GW
      and SparkLAN WL-682 USBID conflict [WUBI-100GW
      is a ISL3886+NET2280 (LM86 firmare) solution,
      whereas WL-682 is a ISL3887 (LM87 firmware)]
      device.
      
      Source: <http://www.wikidevi.com/wiki/Intersil/p54/usb/windows>
      Signed-off-by: default avatarChristian Lamparter <chunkeey@googlemail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      2fe324ea
    • Sujith Manoharan's avatar
      ath9k_hw: Fix RX gain initvals for AR9485 · 7c6c7b3f
      Sujith Manoharan authored
      commit a796a1dd upstream.
      
      Populate iniModesRxGain with the correct initvals
      array for AR9485 v1.1
      Signed-off-by: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      [bwh: Backported to 3.2:
       - Adjust context
       - INIT_INI_ARRAY takes additional size and columns arguments]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      7c6c7b3f
    • Tomasz Guszkowski's avatar
      p54usb: add USB ID for T-Com Sinus 154 data II · 53bb1146
      Tomasz Guszkowski authored
      commit 3194b7fc upstream.
      
      Added USB ID for T-Com Sinus 154 data II.
      Signed-off-by: default avatarTomasz Guszkowski <tsg@o2.pl>
      Acked-by: default avatarChristian Lamparter <chunkeey@googlemail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      53bb1146
    • Hugh Dickins's avatar
      tmpfs mempolicy: fix /proc/mounts corrupting memory · b8709f81
      Hugh Dickins authored
      commit f2a07f40 upstream.
      
      Recently I suggested using "mount -o remount,mpol=local /tmp" in NUMA
      mempolicy testing.  Very nasty.  Reading /proc/mounts, /proc/pid/mounts
      or /proc/pid/mountinfo may then corrupt one bit of kernel memory, often
      in a page table (causing "Bad swap" or "Bad page map" warning or "Bad
      pagetable" oops), sometimes in a vm_area_struct or rbnode or somewhere
      worse.  "mpol=prefer" and "mpol=prefer:Node" are equally toxic.
      
      Recent NUMA enhancements are not to blame: this dates back to 2.6.35,
      when commit e17f74af "mempolicy: don't call mpol_set_nodemask() when
      no_context" skipped mpol_parse_str()'s call to mpol_set_nodemask(),
      which used to initialize v.preferred_node, or set MPOL_F_LOCAL in flags.
      With slab poisoning, you can then rely on mpol_to_str() to set the bit
      for node 0x6b6b, probably in the next page above the caller's stack.
      
      mpol_parse_str() is only called from shmem_parse_options(): no_context
      is always true, so call it unused for now, and remove !no_context code.
      Set v.nodes or v.preferred_node or MPOL_F_LOCAL as mpol_to_str() might
      expect.  Then mpol_to_str() can ignore its no_context argument also,
      the mpol being appropriately initialized whether contextualized or not.
      Rename its no_context unused too, and let subsequent patch remove them
      (that's not needed for stable backporting, which would involve rejects).
      
      I don't understand why MPOL_LOCAL is described as a pseudo-policy:
      it's a reasonable policy which suffers from a confusing implementation
      in terms of MPOL_PREFERRED with MPOL_F_LOCAL.  I believe this would be
      much more robust if MPOL_LOCAL were recognized in switch statements
      throughout, MPOL_F_LOCAL deleted, and MPOL_PREFERRED use the (possibly
      empty) nodes mask like everyone else, instead of its preferred_node
      variant (I presume an optimization from the days before MPOL_LOCAL).
      But that would take me too long to get right and fully tested.
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      b8709f81
    • Jeff Layton's avatar
      cifs: adjust sequence number downward after signing NT_CANCEL request · f6f82cba
      Jeff Layton authored
      commit 31efee60 upstream.
      
      When a call goes out, the signing code adjusts the sequence number
      upward by two to account for the request and the response. An NT_CANCEL
      however doesn't get a response of its own, it just hurries the server
      along to get it to respond to the original request more quickly.
      Therefore, we must adjust the sequence number back down by one after
      signing a NT_CANCEL request.
      Reported-by: default avatarTim Perry <tdparmor-sambabugs@yahoo.com>
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      [bwh: Backported to 3.2: adjust filename]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      f6f82cba
    • Christoffer Dall's avatar
      mm: Fix PageHead when !CONFIG_PAGEFLAGS_EXTENDED · c41fba2f
      Christoffer Dall authored
      commit ad4b3fb7 upstream.
      
      Unfortunately with !CONFIG_PAGEFLAGS_EXTENDED, (!PageHead) is false, and
      (PageHead) is true, for tail pages.  If this is indeed the intended
      behavior, which I doubt because it breaks cache cleaning on some ARM
      systems, then the nomenclature is highly problematic.
      
      This patch makes sure PageHead is only true for head pages and PageTail
      is only true for tail pages, and neither is true for non-compound pages.
      
      [ This buglet seems ancient - seems to have been introduced back in Apr
        2008 in commit 6a1e7f77: "pageflags: convert to the use of new
        macros".  And the reason nobody noticed is because the PageHead()
        tests are almost all about just sanity-checking, and only used on
        pages that are actual page heads.  The fact that the old code returned
        true for tail pages too was thus not really noticeable.   - Linus ]
      Signed-off-by: default avatarChristoffer Dall <cdall@cs.columbia.edu>
      Acked-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Will Deacon <Will.Deacon@arm.com>
      Cc: Steve Capper <Steve.Capper@arm.com>
      Cc: Christoph Lameter <cl@linux.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      c41fba2f
    • Andy Lutomirski's avatar
      PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz · fb7e3f10
      Andy Lutomirski authored
      commit 812089e0 upstream.
      
      Otherwise it fails like this on cards like the Transcend 16GB SDHC card:
      
          mmc0: new SDHC card at address b368
          mmcblk0: mmc0:b368 SDC   15.0 GiB
          mmcblk0: error -110 sending status command, retrying
          mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0xb0
      
      Tested on my Lenovo x200 laptop.
      
      [bhelgaas: changelog]
      Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarChris Ball <cjb@laptop.org>
      CC: Manoj Iyer <manoj.iyer@canonical.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      fb7e3f10
    • Michael Tokarev's avatar
      ext4: do not try to write superblock on ro remount w/o journal · ad74aa67
      Michael Tokarev authored
      commit d096ad0f upstream.
      
      When a journal-less ext4 filesystem is mounted on a read-only block
      device (blockdev --setro will do), each remount (for other, unrelated,
      flags, like suid=>nosuid etc) results in a series of scary messages
      from kernel telling about I/O errors on the device.
      
      This is becauese of the following code ext4_remount():
      
             if (sbi->s_journal == NULL)
                      ext4_commit_super(sb, 1);
      
      at the end of remount procedure, which forces writing (flushing) of
      a superblock regardless whenever it is dirty or not, if the filesystem
      is readonly or not, and whenever the device itself is readonly or not.
      
      We only need call ext4_commit_super when the file system had been
      previously mounted read/write.
      
      Thanks to Eric Sandeen for help in diagnosing this issue.
      Signed-off-By: default avatarMichael Tokarev <mjt@tls.msk.ru>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      ad74aa67
    • Chris Verges's avatar
      hwmon: (lm73} Detect and report i2c bus errors · c53ed31e
      Chris Verges authored
      commit 0602934f upstream.
      
      If an LM73 device does not exist on an I2C bus, attempts to communicate
      with the device result in an error code returned from the i2c read/write
      functions.  The current lm73 driver casts that return value from a s32
      type to a s16 type, then converts it to a temperature in celsius.
      Because negative temperatures are valid, it is difficult to distinguish
      between an error code printed to the response buffer and a negative
      temperature recorded by the sensor.
      
      The solution is to evaluate the return value from the i2c functions
      before performing any temperature calculations.  If the i2c function did
      not succeed, the error code should be passed back through the virtual
      file system layer instead of being printed into the response buffer.
      
      Before:
      
         $ cat /sys/class/hwmon/hwmon0/device/temp1_input
         -46
      
      After:
      
         $ cat /sys/class/hwmon/hwmon0/device/temp1_input
         cat: read error: No such device or address
      Signed-off-by: default avatarChris Verges <kg4ysn@gmail.com>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      c53ed31e
    • Jan Kara's avatar
      jbd2: fix assertion failure in jbd2_journal_flush() · 7a552832
      Jan Kara authored
      commit d7961c7f upstream.
      
      The following race is possible between start_this_handle() and someone
      calling jbd2_journal_flush().
      
      Process A                              Process B
      start_this_handle().
        if (journal->j_barrier_count) # false
        if (!journal->j_running_transaction) { #true
          read_unlock(&journal->j_state_lock);
                                             jbd2_journal_lock_updates()
                                             jbd2_journal_flush()
                                               write_lock(&journal->j_state_lock);
                                               if (journal->j_running_transaction) {
                                                 # false
                                               ... wait for committing trans ...
                                               write_unlock(&journal->j_state_lock);
          ...
          write_lock(&journal->j_state_lock);
          if (!journal->j_running_transaction) { # true
            jbd2_get_transaction(journal, new_transaction);
          write_unlock(&journal->j_state_lock);
          goto repeat; # eventually blocks on j_barrier_count > 0
                                               ...
                                               J_ASSERT(!journal->j_running_transaction);
                                                 # fails
      
      We fix the race by rechecking j_barrier_count after reacquiring j_state_lock
      in exclusive mode.
      
      Reported-by: yjwsignal@empal.com
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      7a552832
    • Jan Kara's avatar
      ext4: check dioread_nolock on remount · f21cf73c
      Jan Kara authored
      commit 261cb20c upstream.
      
      Currently we allow enabling dioread_nolock mount option on remount for
      filesystems where blocksize < PAGE_CACHE_SIZE.  This isn't really
      supported so fix the bug by moving the check for blocksize !=
      PAGE_CACHE_SIZE into parse_options(). Change the original PAGE_SIZE to
      PAGE_CACHE_SIZE along the way because that's what we are really
      interested in.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      f21cf73c
    • Krzysztof Mazur's avatar
      i915: ensure that VGA plane is disabled · 29abfe4d
      Krzysztof Mazur authored
      commit 0fde901f upstream.
      
      Some broken systems (like HP nc6120) in some cases, usually after LID
      close/open, enable VGA plane, making display unusable (black screen on LVDS,
      some strange mode on VGA output). We used to disable VGA plane only once at
      startup. Now we also check, if VGA plane is still disabled while changing
      mode, and fix that if something changed it.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57434Signed-off-by: default avatarKrzysztof Mazur <krzysiek@podlesie.net>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      [bwh: Backported to 3.2: intel_modeset_setup_hw_state() does not
       exist, so call i915_redisable_vga() directly from intel_lid_notify()]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      29abfe4d
    • Forrest Liu's avatar
      ext4: fix extent tree corruption caused by hole punch · f7967624
      Forrest Liu authored
      commit c36575e6 upstream.
      
      When depth of extent tree is greater than 1, logical start value of
      interior node is not correctly updated in ext4_ext_rm_idx.
      Signed-off-by: default avatarForrest Liu <forrestl@synology.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: default avatarAshish Sangwan <ashishsangwan2@gmail.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      f7967624
  2. 03 Jan, 2013 25 commits