1. 16 Jul, 2012 40 commits
    • Jiang Liu's avatar
      memory hotplug: fix invalid memory access caused by stale kswapd pointer · 0e343dbe
      Jiang Liu authored
      commit d8adde17 upstream.
      
      kswapd_stop() is called to destroy the kswapd work thread when all memory
      of a NUMA node has been offlined.  But kswapd_stop() only terminates the
      work thread without resetting NODE_DATA(nid)->kswapd to NULL.  The stale
      pointer will prevent kswapd_run() from creating a new work thread when
      adding memory to the memory-less NUMA node again.  Eventually the stale
      pointer may cause invalid memory access.
      
      An example stack dump as below. It's reproduced with 2.6.32, but latest
      kernel has the same issue.
      
        BUG: unable to handle kernel NULL pointer dereference at (null)
        IP: [<ffffffff81051a94>] exit_creds+0x12/0x78
        PGD 0
        Oops: 0000 [#1] SMP
        last sysfs file: /sys/devices/system/memory/memory391/state
        CPU 11
        Modules linked in: cpufreq_conservative cpufreq_userspace cpufreq_powersave acpi_cpufreq microcode fuse loop dm_mod tpm_tis rtc_cmos i2c_i801 rtc_core tpm serio_raw pcspkr sg tpm_bios igb i2c_core iTCO_wdt rtc_lib mptctl iTCO_vendor_support button dca bnx2 usbhid hid uhci_hcd ehci_hcd usbcore sd_mod crc_t10dif edd ext3 mbcache jbd fan ide_pci_generic ide_core ata_generic ata_piix libata thermal processor thermal_sys hwmon mptsas mptscsih mptbase scsi_transport_sas scsi_mod
        Pid: 7949, comm: sh Not tainted 2.6.32.12-qiuxishi-5-default #92 Tecal RH2285
        RIP: 0010:exit_creds+0x12/0x78
        RSP: 0018:ffff8806044f1d78  EFLAGS: 00010202
        RAX: 0000000000000000 RBX: ffff880604f22140 RCX: 0000000000019502
        RDX: 0000000000000000 RSI: 0000000000000202 RDI: 0000000000000000
        RBP: ffff880604f22150 R08: 0000000000000000 R09: ffffffff81a4dc10
        R10: 00000000000032a0 R11: ffff880006202500 R12: 0000000000000000
        R13: 0000000000c40000 R14: 0000000000008000 R15: 0000000000000001
        FS:  00007fbc03d066f0(0000) GS:ffff8800282e0000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
        CR2: 0000000000000000 CR3: 000000060f029000 CR4: 00000000000006e0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
        Process sh (pid: 7949, threadinfo ffff8806044f0000, task ffff880603d7c600)
        Stack:
         ffff880604f22140 ffffffff8103aac5 ffff880604f22140 ffffffff8104d21e
         ffff880006202500 0000000000008000 0000000000c38000 ffffffff810bd5b1
         0000000000000000 ffff880603d7c600 00000000ffffdd29 0000000000000003
        Call Trace:
          __put_task_struct+0x5d/0x97
          kthread_stop+0x50/0x58
          offline_pages+0x324/0x3da
          memory_block_change_state+0x179/0x1db
          store_mem_state+0x9e/0xbb
          sysfs_write_file+0xd0/0x107
          vfs_write+0xad/0x169
          sys_write+0x45/0x6e
          system_call_fastpath+0x16/0x1b
        Code: ff 4d 00 0f 94 c0 84 c0 74 08 48 89 ef e8 1f fd ff ff 5b 5d 31 c0 41 5c c3 53 48 8b 87 20 06 00 00 48 89 fb 48 8b bf 18 06 00 00 <8b> 00 48 c7 83 18 06 00 00 00 00 00 00 f0 ff 0f 0f 94 c0 84 c0
        RIP  exit_creds+0x12/0x78
         RSP <ffff8806044f1d78>
        CR2: 0000000000000000
      
      [akpm@linux-foundation.org: add pglist_data.kswapd locking comments]
      Signed-off-by: default avatarXishi Qiu <qiuxishi@huawei.com>
      Signed-off-by: default avatarJiang Liu <jiang.liu@huawei.com>
      Acked-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Acked-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Acked-by: default avatarMel Gorman <mgorman@suse.de>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Reviewed-by: default avatarMinchan Kim <minchan@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 avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0e343dbe
    • Lars-Peter Clausen's avatar
      staging:iio:ad7606: Re-add missing scale attribute · a2db97f1
      Lars-Peter Clausen authored
      commit 279bf2e5 upstream.
      
      Commit 50ac23be ("staging:iio:adc:ad7606 add local define for chan_spec
      structures.") accidentally removed the scale info_mask flag. This patch
      adds it back again.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Acked-by: default avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [herton: Backported to 3.4: info_mask was not used yet with another flag]
      Signed-off-by: default avatarHerton R. Krzesinski <herton@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a2db97f1
    • majianpeng's avatar
      md/raid5: Do not add data_offset before call to is_badblock · d3f94022
      majianpeng authored
      commit 6c0544e2 upstream.
      
      In chunk_aligned_read() we are adding data_offset before calling
      is_badblock.  But is_badblock also adds data_offset, so that is bad.
      
      So move the addition of data_offset to after the call to
      is_badblock.
      
      This bug was introduced by commit 31c176ec
           md/raid5: avoid reading from known bad blocks.
      which first appeared in 3.0.  So that patch is suitable for any
      -stable kernel from 3.0.y onwards.  However it will need minor
      revision for most of those (as the comment didn't appear until
      recently).
      Signed-off-by: default avatarmajianpeng <majianpeng@gmail.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      [bwh: Backported to 3.2: ignored missing comment]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d3f94022
    • Andy Lutomirski's avatar
      mm: Hold a file reference in madvise_remove · 0c4ad5cc
      Andy Lutomirski authored
      commit 9ab4233d upstream.
      
      Otherwise the code races with munmap (causing a use-after-free
      of the vma) or with close (causing a use-after-free of the struct
      file).
      
      The bug was introduced by commit 90ed52eb ("[PATCH] holepunch: fix
      mmap_sem i_mutex deadlock")
      
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Miklos Szeredi <mszeredi@suse.cz>
      Cc: Badari Pulavarty <pbadari@us.ibm.com>
      Cc: Nick Piggin <npiggin@suse.de>
      Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      [bwh: Backported to 3.2:
       - Adjust context
       - madvise_remove() calls vmtruncate_range(), not do_fallocate()]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0c4ad5cc
    • Daniel Vetter's avatar
      drm/i915: rip out the PM_IIR WARN · c9bb51fb
      Daniel Vetter authored
      commit 58bf8062 upstream.
      
      After banging my head against this for the past few months, I still
      don't see how this could possible race under the premise that once an
      irq bit is masked in PM_IMR and reset in PM_IIR it won't show up again
      until we unmask it in PM_IMR.
      
      Still, we have reports of this being seen in the wild. Now Bspec has
      this little bit of lovely language in the PMIIR register:
      
      Public SNB Docs, Vol3Part2, 2.5.14 "PMIIR":
      
      "For each bit, the IIR can store a second pending interrupt if two or
      more of the same interrupt conditions occur before the first condition
      is cleared. Upon clearing the interrupt, the IIR bit will momentarily
      go low, then return high to indicate there is another interrupt
      pending."
      
      Now if we presume that PMIMR only prevent new interrupts from being
      queued, we could easily end up masking an interrupt and clearing it,
      but the 2nd pending interrupt setting the bit in PMIIR right away
      again. Which leads, the next time the irq handler runs, to hitting the
      WARN.
      
      Also, no bad side effects of this have ever been reported. And we've
      tracked down our issues with the gpu turbo getting stuck to bogus
      interrupt generation limits in th RPLIMIT register.
      
      So let's just rip out this WARN as bogus and call it a day. The only
      shallow thing here is that this 2-deep irq queue in the hw makes you
      wonder how racy the windows irq handler is ...
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42907Acked-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c9bb51fb
    • Chris Wilson's avatar
      drm/i915: Refactor the deferred PM_IIR handling into a single function · a08fae60
      Chris Wilson authored
      commit fc6826d1 upstream.
      
      This function, along with the registers and deferred work hander, are
      all shared with SandyBridge, IvyBridge and their variants. So remove the
      duplicate code into a single function.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      [bwh: Backported to 3.2: adjust context; drop changes for Valley View]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a08fae60
    • Eric Dumazet's avatar
      splice: fix racy pipe->buffers uses · 2c07f25e
      Eric Dumazet authored
      commit 047fe360 upstream.
      
      Dave Jones reported a kernel BUG at mm/slub.c:3474! triggered
      by splice_shrink_spd() called from vmsplice_to_pipe()
      
      commit 35f3d14d (pipe: add support for shrinking and growing pipes)
      added capability to adjust pipe->buffers.
      
      Problem is some paths don't hold pipe mutex and assume pipe->buffers
      doesn't change for their duration.
      
      Fix this by adding nr_pages_max field in struct splice_pipe_desc, and
      use it in place of pipe->buffers where appropriate.
      
      splice_shrink_spd() loses its struct pipe_inode_info argument.
      Reported-by: default avatarDave Jones <davej@redhat.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Tom Herbert <therbert@google.com>
      Tested-by: default avatarDave Jones <davej@redhat.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      [bwh: Backported to 3.2:
       - Adjust context in vmsplice_to_pipe()
       - Update one more call to splice_shrink_spd(), from skb_splice_bits()]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2c07f25e
    • Stanislav Yakovlev's avatar
      net/wireless: ipw2x00: add supported cipher suites to wiphy initialization · 5318edef
      Stanislav Yakovlev authored
      commit a141e6a0 upstream.
      
      Driver doesn't report its supported cipher suites through cfg80211
      interface. It still uses wext interface and probably will not work
      through nl80211, but will at least correctly advertise supported
      features.
      
      Bug was reported by Omar Siam.
      https://bugzilla.kernel.org/show_bug.cgi?id=43049Signed-off-by: default avatarStanislav Yakovlev <stas.yakovlev@gmail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Cc: Josh Boyer <jwboyer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5318edef
    • Jason Wang's avatar
      macvtap: zerocopy: validate vectors before building skb · 6d0535e8
      Jason Wang authored
      commit b92946e2 upstream.
      
      There're several reasons that the vectors need to be validated:
      
      - Return error when caller provides vectors whose num is greater than UIO_MAXIOV.
      - Linearize part of skb when userspace provides vectors grater than MAX_SKB_FRAGS.
      - Return error when userspace provides vectors whose total length may exceed
      - MAX_SKB_FRAGS * PAGE_SIZE.
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Cc: Josh Boyer <jwboyer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6d0535e8
    • Stanislaw Gruszka's avatar
      rtl8187: ->brightness_set can not sleep · 21359ac3
      Stanislaw Gruszka authored
      commit 0fde0a8c upstream.
      
      Fix:
      
      BUG: sleeping function called from invalid context at kernel/workqueue.c:2547
      in_atomic(): 1, irqs_disabled(): 0, pid: 629, name: wpa_supplicant
      2 locks held by wpa_supplicant/629:
       #0:  (rtnl_mutex){+.+.+.}, at: [<c08b2b84>] rtnl_lock+0x14/0x20
       #1:  (&trigger->leddev_list_lock){.+.?..}, at: [<c0867f41>] led_trigger_event+0x21/0x80
      Pid: 629, comm: wpa_supplicant Not tainted 3.3.0-0.rc3.git5.1.fc17.i686
      Call Trace:
       [<c046a9f6>] __might_sleep+0x126/0x1d0
       [<c0457d6c>] wait_on_work+0x2c/0x1d0
       [<c045a09a>] __cancel_work_timer+0x6a/0x120
       [<c045a160>] cancel_delayed_work_sync+0x10/0x20
       [<f7dd3c22>] rtl8187_led_brightness_set+0x82/0xf0 [rtl8187]
       [<c0867f7c>] led_trigger_event+0x5c/0x80
       [<f7ff5e6d>] ieee80211_led_radio+0x1d/0x40 [mac80211]
       [<f7ff3583>] ieee80211_stop_device+0x13/0x230 [mac80211]
      
      Removing _sync is ok, because if led_on work is currently running
      it will be finished before led_off work start to perform, since
      they are always queued on the same mac80211 local->workqueue.
      
      Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=795176Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Acked-by: default avatarHin-Tak Leung <htl10@users.sourceforge.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Cc: Josh Boyer <jwboyer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      21359ac3
    • Andrea Arcangeli's avatar
      thp: avoid atomic64_read in pmd_read_atomic for 32bit PAE · acf8fbd7
      Andrea Arcangeli authored
      commit e4eed03f upstream.
      
      In the x86 32bit PAE CONFIG_TRANSPARENT_HUGEPAGE=y case while holding the
      mmap_sem for reading, cmpxchg8b cannot be used to read pmd contents under
      Xen.
      
      So instead of dealing only with "consistent" pmdvals in
      pmd_none_or_trans_huge_or_clear_bad() (which would be conceptually
      simpler) we let pmd_none_or_trans_huge_or_clear_bad() deal with pmdvals
      where the low 32bit and high 32bit could be inconsistent (to avoid having
      to use cmpxchg8b).
      
      The only guarantee we get from pmd_read_atomic is that if the low part of
      the pmd was found null, the high part will be null too (so the pmd will be
      considered unstable).  And if the low part of the pmd is found "stable"
      later, then it means the whole pmd was read atomically (because after a
      pmd is stable, neither MADV_DONTNEED nor page faults can alter it anymore,
      and we read the high part after the low part).
      
      In the 32bit PAE x86 case, it is enough to read the low part of the pmdval
      atomically to declare the pmd as "stable" and that's true for THP and no
      THP, furthermore in the THP case we also have a barrier() that will
      prevent any inconsistent pmdvals to be cached by a later re-read of the
      *pmd.
      Signed-off-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
      Cc: Jonathan Nieder <jrnieder@gmail.com>
      Cc: Ulrich Obergfell <uobergfe@redhat.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Larry Woodman <lwoodman@redhat.com>
      Cc: Petr Matousek <pmatouse@redhat.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Jan Beulich <jbeulich@suse.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
      Tested-by: default avatarAndrew Jones <drjones@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      acf8fbd7
    • Andrea Arcangeli's avatar
      mm: pmd_read_atomic: fix 32bit PAE pmd walk vs pmd_populate SMP race condition · ff99851d
      Andrea Arcangeli authored
      commit 26c19178 upstream.
      
      When holding the mmap_sem for reading, pmd_offset_map_lock should only
      run on a pmd_t that has been read atomically from the pmdp pointer,
      otherwise we may read only half of it leading to this crash.
      
      PID: 11679  TASK: f06e8000  CPU: 3   COMMAND: "do_race_2_panic"
       #0 [f06a9dd8] crash_kexec at c049b5ec
       #1 [f06a9e2c] oops_end at c083d1c2
       #2 [f06a9e40] no_context at c0433ded
       #3 [f06a9e64] bad_area_nosemaphore at c043401a
       #4 [f06a9e6c] __do_page_fault at c0434493
       #5 [f06a9eec] do_page_fault at c083eb45
       #6 [f06a9f04] error_code (via page_fault) at c083c5d5
          EAX: 01fb470c EBX: fff35000 ECX: 00000003 EDX: 00000100 EBP:
          00000000
          DS:  007b     ESI: 9e201000 ES:  007b     EDI: 01fb4700 GS:  00e0
          CS:  0060     EIP: c083bc14 ERR: ffffffff EFLAGS: 00010246
       #7 [f06a9f38] _spin_lock at c083bc14
       #8 [f06a9f44] sys_mincore at c0507b7d
       #9 [f06a9fb0] system_call at c083becd
                               start           len
          EAX: ffffffda  EBX: 9e200000  ECX: 00001000  EDX: 6228537f
          DS:  007b      ESI: 00000000  ES:  007b      EDI: 003d0f00
          SS:  007b      ESP: 62285354  EBP: 62285388  GS:  0033
          CS:  0073      EIP: 00291416  ERR: 000000da  EFLAGS: 00000286
      
      This should be a longstanding bug affecting x86 32bit PAE without THP.
      Only archs with 64bit large pmd_t and 32bit unsigned long should be
      affected.
      
      With THP enabled the barrier() in pmd_none_or_trans_huge_or_clear_bad()
      would partly hide the bug when the pmd transition from none to stable,
      by forcing a re-read of the *pmd in pmd_offset_map_lock, but when THP is
      enabled a new set of problem arises by the fact could then transition
      freely in any of the none, pmd_trans_huge or pmd_trans_stable states.
      So making the barrier in pmd_none_or_trans_huge_or_clear_bad()
      unconditional isn't good idea and it would be a flakey solution.
      
      This should be fully fixed by introducing a pmd_read_atomic that reads
      the pmd in order with THP disabled, or by reading the pmd atomically
      with cmpxchg8b with THP enabled.
      
      Luckily this new race condition only triggers in the places that must
      already be covered by pmd_none_or_trans_huge_or_clear_bad() so the fix
      is localized there but this bug is not related to THP.
      
      NOTE: this can trigger on x86 32bit systems with PAE enabled with more
      than 4G of ram, otherwise the high part of the pmd will never risk to be
      truncated because it would be zero at all times, in turn so hiding the
      SMP race.
      
      This bug was discovered and fully debugged by Ulrich, quote:
      
      ----
      [..]
      pmd_none_or_trans_huge_or_clear_bad() loads the content of edx and
      eax.
      
          496 static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t
          *pmd)
          497 {
          498         /* depend on compiler for an atomic pmd read */
          499         pmd_t pmdval = *pmd;
      
                                      // edi = pmd pointer
      0xc0507a74 <sys_mincore+548>:   mov    0x8(%esp),%edi
      ...
                                      // edx = PTE page table high address
      0xc0507a84 <sys_mincore+564>:   mov    0x4(%edi),%edx
      ...
                                      // eax = PTE page table low address
      0xc0507a8e <sys_mincore+574>:   mov    (%edi),%eax
      
      [..]
      
      Please note that the PMD is not read atomically. These are two "mov"
      instructions where the high order bits of the PMD entry are fetched
      first. Hence, the above machine code is prone to the following race.
      
      -  The PMD entry {high|low} is 0x0000000000000000.
         The "mov" at 0xc0507a84 loads 0x00000000 into edx.
      
      -  A page fault (on another CPU) sneaks in between the two "mov"
         instructions and instantiates the PMD.
      
      -  The PMD entry {high|low} is now 0x00000003fda38067.
         The "mov" at 0xc0507a8e loads 0xfda38067 into eax.
      ----
      Reported-by: default avatarUlrich Obergfell <uobergfe@redhat.com>
      Signed-off-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Larry Woodman <lwoodman@redhat.com>
      Cc: Petr Matousek <pmatouse@redhat.com>
      Cc: Rik van Riel <riel@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ff99851d
    • Tom Hughes's avatar
      ath9k: fix panic caused by returning a descriptor we have queued for reuse · e5982925
      Tom Hughes authored
      commit 6bb51c70 upstream.
      
      Commit 3a2923e8 introduced a bug when a corrupt descriptor
      is encountered - although the following descriptor is discarded
      and returned to the queue for reuse the associated frame is
      also returned for processing. This leads to a panic:
      
      BUG: unable to handle kernel NULL pointer dereference at 000000000000003a
      IP: [<ffffffffa02599a5>] ath_rx_tasklet+0x165/0x1b00 [ath9k]
      Call Trace:
      <IRQ>
      [<ffffffff812d7fa0>] ? map_single+0x60/0x60
      [<ffffffffa028f044>] ? ath9k_ioread32+0x34/0x90 [ath9k]
      [<ffffffffa0292eec>] athk9k_tasklet+0xdc/0x160 [ath9k]
      [<ffffffff8105e133>] tasklet_action+0x63/0xd0
      [<ffffffff8105dbc0>] __do_softirq+0xc0/0x1e0
      [<ffffffff8101a873>] ? native_sched_clock+0x13/0x80
      [<ffffffff815f9d5c>] call_softirq+0x1c/0x30
      [<ffffffff810151f5>] do_softirq+0x75/0xb0
      [<ffffffff8105df95>] irq_exit+0xb5/0xc0
      [<ffffffff815fa5b3>] do_IRQ+0x63/0xe0
      [<ffffffff815f0cea>] common_interrupt+0x6a/0x6a
      <EOI>
      [<ffffffff8131840a>] ? intel_idle+0xea/0x150
      [<ffffffff813183eb>] ? intel_idle+0xcb/0x150
      [<ffffffff814a1db9>] cpuidle_enter+0x19/0x20
      [<ffffffff814a23d9>] cpuidle_idle_call+0xa9/0x240
      [<ffffffff8101c4bf>] cpu_idle+0xaf/0x120
      [<ffffffff815cda8e>] rest_init+0x72/0x74
      [<ffffffff81cf4c1a>] start_kernel+0x3b7/0x3c4
      [<ffffffff81cf4662>] ? repair_env_string+0x5e/0x5e
      [<ffffffff81cf4346>] x86_64_start_reservations+0x131/0x135
      [<ffffffff81cf444a>] x86_64_start_kernel+0x100/0x10f
      
      Making sure bf is cleared to NULL in this case restores the
      old behaviour.
      Signed-off-by: default avatarTom Hughes <tom@compton.nu>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Cc: Josh Boyer <jwboyer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e5982925
    • Matt Carlson's avatar
      tg3: Apply short DMA frag workaround to 5906 · 5250def1
      Matt Carlson authored
      commit b7abee6e upstream.
      
      5906 devices also need the short DMA fragment workaround.  This patch
      makes the necessary change.
      Signed-off-by: default avatarMatt Carlson <mcarlson@broadcom.com>
      Tested-by: default avatarChristian Kujau <lists@nerdbynature.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: Josh Boyer <jwboyer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5250def1
    • Shaohua Li's avatar
      raid5: delayed stripe fix · 5bbbd747
      Shaohua Li authored
      commit fab363b5 upstream.
      
      There isn't locking setting STRIPE_DELAYED and STRIPE_PREREAD_ACTIVE bits, but
      the two bits have relationship. A delayed stripe can be moved to hold list only
      when preread active stripe count is below IO_THRESHOLD. If a stripe has both
      the bits set, such stripe will be in delayed list and preread count not 0,
      which will make such stripe never leave delayed list.
      Signed-off-by: default avatarShaohua Li <shli@fusionio.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5bbbd747
    • Hans de Goede's avatar
      gspca-core: Fix buffers staying in queued state after a stream_off · c412589f
      Hans de Goede authored
      commit af05ef01 upstream.
      
      [Backport to linux-stable by Antonio Ospite <ospite@studenti.unina.it>]
      
      This fixes a regression introduced by commit f7059eaa and should be
      backported to all supported stable kernels which have this commit.
      Signed-off-by: default avatarAntonio Ospite <ospite@studenti.unina.it>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Tested-by: default avatarAntonio Ospite <ospite@studenti.unina.it>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c412589f
    • Bing Zhao's avatar
      mwifiex: fix wrong return values in add_virtual_intf() error cases · 445006de
      Bing Zhao authored
      commit 858faa57 upstream
      
      add_virtual_intf() needs to return an ERR_PTR(), instead of NULL,
      on errors, otherwise cfg80211 will crash.
      Reported-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      445006de
    • Vaibhav Nagarnaik's avatar
      tracing: change CPU ring buffer state from tracing_cpumask · 4943d9cb
      Vaibhav Nagarnaik authored
      commit 71babb27 upstream.
      
      According to Documentation/trace/ftrace.txt:
      
      tracing_cpumask:
      
              This is a mask that lets the user only trace
              on specified CPUS. The format is a hex string
              representing the CPUS.
      
      The tracing_cpumask currently doesn't affect the tracing state of
      per-CPU ring buffers.
      
      This patch enables/disables CPU recording as its corresponding bit in
      tracing_cpumask is set/unset.
      
      Link: http://lkml.kernel.org/r/1336096792-25373-3-git-send-email-vnagarnaik@google.com
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Laurent Chavey <chavey@google.com>
      Cc: Justin Teravest <teravest@google.com>
      Cc: David Sharp <dhsharp@google.com>
      Signed-off-by: default avatarVaibhav Nagarnaik <vnagarnaik@google.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4943d9cb
    • Johannes Berg's avatar
      iwlwifi: remove log_event debugfs file debugging is disabled · dbb3e108
      Johannes Berg authored
      commit 882b7b7d upstream.
      
      When debugging is disabled, the event log functions aren't
      functional in the way that the debugfs file expects. This
      leads to the debugfs access crashing. Since the event log
      functions aren't functional then, remove the debugfs file
      when CONFIG_IWLWIFI_DEBUG is not set.
      Reported-by: default avatarLekensteyn <lekensteyn@gmail.com>
      Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      [bwh: Backported to 3.2: adjust filename, context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dbb3e108
    • Johannes Berg's avatar
      mac80211: fix queues stuck issue with HT bandwidth change · bf2370ff
      Johannes Berg authored
      No upstream commit, the buggy code was removed in 3.5 in commit
      7213cf2c and others.
      
      Rajkumar changed code for handling channel switching in
      mac80211 to stop the queues in
      
        commit 7cc44ed4
        Author: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
        Date:   Fri Sep 16 15:32:34 2011 +0530
      
            mac80211: Fix regression on queue stop during 2040 bss change
      
      which went into 3.2. In the 3.4 cycle, Paul's change
      
        commit 3117bbdb
        Author: Paul Stewart <pstew@chromium.org>
        Date:   Tue Mar 13 07:46:18 2012 -0700
      
            mac80211: Don't let regulatory make us deaf
      
      went in and changed the TX/RX enable logic, but now
      the conditions for stopping and restarting the queues
      were different so that now, if the AP changes between
      20/40 MHz bandwidth, it can happen that we stop but
      never restart the queues. This breaks the connection
      and the module actually has to be reloaded to get it
      back to work.
      
      Fix this by making sure the queues are always started
      when they were stopped.
      Reported-by: default avatarFlorian Manschwetus <manschwetus@googlemail.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bf2370ff
    • Stanislav Kinsbursky's avatar
      NFS: hard-code init_net for NFS callback transports · f183282b
      Stanislav Kinsbursky authored
      upstream commit 12918b10.
      
      In case of destroying mount namespace on child reaper exit, nsproxy is zeroed
      to the point already. So, dereferencing of it is invalid.
      This patch hard-code "init_net" for all network namespace references for NFS
      callback services. This will be fixed with proper NFS callback
      containerization.
      Signed-off-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f183282b
    • Stanislav Kinsbursky's avatar
      SUNRPC: move per-net operations from svc_destroy() · ee923891
      Stanislav Kinsbursky authored
      upstream commit 786185b5.
      
      The idea is to separate service destruction and per-net operations,
      because these are two different things and the mix looks ugly.
      
      Notes:
      
      1) For NFS server this patch looks ugly (sorry for that). But these
      place will be rewritten soon during NFSd containerization.
      
      2) LockD per-net counter increase int lockd_up() was moved prior to
      make_socks() to make lockd_down_net() call safe in case of error.
      Signed-off-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ee923891
    • Stanislav Kinsbursky's avatar
      SUNRPC: new svc_bind() routine introduced · 10762419
      Stanislav Kinsbursky authored
      upstream commit 9793f7c8.
      
      This new routine is responsible for service registration in a specified
      network context.
      
      The idea is to separate service creation from per-net operations.
      
      Note also: since registering service with svc_bind() can fail, the
      service will be destroyed and during destruction it will try to
      unregister itself from rpcbind. In this case unregistration has to be
      skipped.
      Signed-off-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      10762419
    • Stanislav Kinsbursky's avatar
      Lockd: pass network namespace to creation and destruction routines · 0bbc9d1b
      Stanislav Kinsbursky authored
      upstream commit e3f70ead.
      
      v2: dereference of most probably already released nlm_host removed in
      nlmclnt_done() and reclaimer().
      
      These routines are called from locks reclaimer() kernel thread. This thread
      works in "init_net" network context and currently relays on persence on lockd
      thread and it's per-net resources. Thus lockd_up() and lockd_down() can't relay
      on current network context. So let's pass corrent one into them.
      Signed-off-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0bbc9d1b
    • Davide Gerhard's avatar
      ipheth: add support for iPad · 0e924ae7
      Davide Gerhard authored
      commit 6de0298e upstream.
      
      This adds support for the iPad to the ipheth driver.
      (product id = 0x129a)
      Signed-off-by: default avatarDavide Gerhard <rainbow@irh.it>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0e924ae7
    • Alan Stern's avatar
      PCI: EHCI: fix crash during suspend on ASUS computers · 0659cf9d
      Alan Stern authored
      commit dbf0e4c7 upstream.
      
      Quite a few ASUS computers experience a nasty problem, related to the
      EHCI controllers, when going into system suspend.  It was observed
      that the problem didn't occur if the controllers were not put into the
      D3 power state before starting the suspend, and commit
      151b6128 (USB: EHCI: fix crash during
      suspend on ASUS computers) was created to do this.
      
      It turned out this approach messed up other computers that didn't have
      the problem -- it prevented USB wakeup from working.  Consequently
      commit c2fb8a3f (USB: add
      NO_D3_DURING_SLEEP flag and revert 151b6128) was merged; it
      reverted the earlier commit and added a whitelist of known good board
      names.
      
      Now we know the actual cause of the problem.  Thanks to AceLan Kao for
      tracking it down.
      
      According to him, an engineer at ASUS explained that some of their
      BIOSes contain a bug that was added in an attempt to work around a
      problem in early versions of Windows.  When the computer goes into S3
      suspend, the BIOS tries to verify that the EHCI controllers were first
      quiesced by the OS.  Nothing's wrong with this, but the BIOS does it
      by checking that the PCI COMMAND registers contain 0 without checking
      the controllers' power state.  If the register isn't 0, the BIOS
      assumes the controller needs to be quiesced and tries to do so.  This
      involves making various MMIO accesses to the controller, which don't
      work very well if the controller is already in D3.  The end result is
      a system hang or memory corruption.
      
      Since the value in the PCI COMMAND register doesn't matter once the
      controller has been suspended, and since the value will be restored
      anyway when the controller is resumed, we can work around the BIOS bug
      simply by setting the register to 0 during system suspend.  This patch
      (as1590) does so and also reverts the second commit mentioned above,
      which is now unnecessary.
      
      In theory we could do this for every PCI device.  However to avoid
      introducing new problems, the patch restricts itself to EHCI host
      controllers.
      
      Finally the affected systems can suspend with USB wakeup working
      properly.
      
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=37632
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=42728Based-on-patch-by: default avatarAceLan Kao <acelan.kao@canonical.com>
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Tested-by: default avatarDâniel Fraga <fragabr@gmail.com>
      Tested-by: default avatarJavier Marcet <jmarcet@gmail.com>
      Tested-by: default avatarAndrey Rahmatullin <wrar@wrar.name>
      Tested-by: default avatarOleksij Rempel <bug-track@fisher-privat.net>
      Tested-by: default avatarPavel Pisa <pisa@cmp.felk.cvut.cz>
      Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0659cf9d
    • Sarah Sharp's avatar
      xhci: Fix hang on back-to-back Set TR Deq Ptr commands. · b62d32b9
      Sarah Sharp authored
      commit 0d9f78a9 upstream.
      
      The Microsoft LifeChat 3000 USB headset was causing a very reproducible
      hang whenever it was plugged in.  At first, I thought the host
      controller was producing bad transfer events, because the log was filled
      with errors like:
      
      xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD
      
      However, it turned out to be an xHCI driver bug in the ring expansion
      patches.  The bug is triggered When there are two ring segments, and a
      TD that ends just before a link TRB, like so:
      
       ______________                     _____________
      |              |              ---> | setup TRB B |
       ______________               |     _____________
      |              |              |    |  data TRB B |
       ______________               |     _____________
      | setup TRB A  | <-- deq      |    |  data TRB B |
       ______________               |     _____________
      | data TRB A   |              |    |             | <-- enq, deq''
       ______________               |     _____________
      | status TRB A |              |    |             |
       ______________               |     _____________
      |  link TRB    |---------------    |  link TRB   |
       _____________  <--- deq'           _____________
      
      TD A (the first control transfer) stalls on the data phase.  That halts
      the ring.  The xHCI driver moves the hardware dequeue pointer to the
      first TRB after the stalled transfer, which happens to be the link TRB.
      
      Once the Set TR dequeue pointer command completes, the function
      update_ring_for_set_deq_completion runs.  That function is supposed to
      update the xHCI driver's dequeue pointer to match the internal hardware
      dequeue pointer.  On the first call this would work fine, and the
      software dequeue pointer would move to deq'.
      
      However, if the transfer immediately after that stalled (TD B in this
      case), another Set TR Dequeue command would be issued.  That would move
      the hardware dequeue pointer to deq''.  Once that command completed,
      update_ring_for_set_deq_completion would run again.
      
      The original code would unconditionally increment the software dequeue
      pointer, which moved the pointer off the ring segment into la-la-land.
      The while loop would happy increment the dequeue pointer (possibly
      wrapping it) until it matched the hardware pointer value.
      
      The while loop would also access all the memory in between the first
      ring segment and the second ring segment to determine if it was a link
      TRB.  This could cause general protection faults, although it was
      unlikely because the ring segments came from a DMA pool, and would often
      have consecutive memory addresses.
      
      If nothing in that space looked like a link TRB, the deq_seg pointer for
      the ring would remain on the first segment.  Thus, the deq_seg and the
      software dequeue pointer would get out of sync.
      
      When the next transfer event came in after the stalled transfer, the
      xHCI driver code would attempt to convert the software dequeue pointer
      into a DMA address in order to compare the DMA address for the completed
      transfer.  Since the deq_seg and the dequeue pointer were out of sync,
      xhci_trb_virt_to_dma would return NULL.
      
      The transfer event would get ignored, the transfer would eventually
      timeout, and we would mistakenly convert the finished transfer to no-op
      TRBs.  Some kernel driver (maybe xHCI?) would then get stuck in an
      infinite loop in interrupt context, and the whole machine would hang.
      
      This patch should be backported to kernels as old as 3.4, that contain
      the commit b008df60 "xHCI: count free
      TRBs on transfer ring"
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Andiry Xu <andiry.xu@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b62d32b9
    • Stanislaw Ledwon's avatar
      usb: Add support for root hub port status CAS · e171ce5c
      Stanislaw Ledwon authored
      commit 8bea2bd3 upstream.
      
      The host controller port status register supports CAS (Cold Attach
      Status) bit. This bit could be set when USB3.0 device is connected
      when system is in Sx state. When the system wakes to S0 this port
      status with CAS bit is reported and this port can't be used by any
      device.
      
      When CAS bit is set the port should be reset by warm reset. This
      was not supported by xhci driver.
      
      The issue was found when pendrive was connected to suspended
      platform. The link state of "Compliance Mode" was reported together
      with CAS bit. This link state was also not supported by xhci and
      core/hub.c.
      
      The CAS bit is defined only for xhci root hub port and it is
      not supported on regular hubs. The link status is used to force
      warm reset on port. Make the USB core issue a warm reset when port
      is in ether the 'inactive' or 'compliance mode'. Change the xHCI driver
      to report 'compliance mode' when the CAS is set. This force warm reset
      on the root hub port.
      
      This patch should be backported to stable kernels as old as 3.2, that
      contain the commit 10d674a8 "USB: When
      hot reset for USB3 fails, try warm reset."
      Signed-off-by: default avatarStanislaw Ledwon <staszek.ledwon@linux.intel.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Acked-by: default avatarAndiry Xu <andiry.xu@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e171ce5c
    • Gaosen Zhang's avatar
      USB: option: Add MEDIATEK product ids · 9da79f90
      Gaosen Zhang authored
      commit aacef9c5 upstream.
      Signed-off-by: default avatarGaosen Zhang <gaosen.zhang@mediatek.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9da79f90
    • Bjørn Mork's avatar
      USB: option: add ZTE MF60 · 62e44494
      Bjørn Mork authored
      commit 8e16e33c upstream.
      
      Switches into a composite device by ejecting the initial
      driver CD.  The four interfaces are: QCDM, AT, QMI/wwan
      and mass storage.  Let this driver manage the two serial
      interfaces:
      
      T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 28 Spd=480  MxCh= 0
      D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
      P:  Vendor=19d2 ProdID=1402 Rev= 0.00
      S:  Manufacturer=ZTE,Incorporated
      S:  Product=ZTE WCDMA Technologies MSM
      S:  SerialNumber=xxxxx
      C:* #Ifs= 4 Cfg#= 1 Atr=c0 MxPwr=500mA
      I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
      E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 3 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      62e44494
    • Bjørn Mork's avatar
      USB: cdc-wdm: fix lockup on error in wdm_read · b80f6db7
      Bjørn Mork authored
      commit b086b6b1 upstream.
      
      Clear the WDM_READ flag on empty reads to avoid running
      forever in an infinite tight loop, causing lockups:
      
      Jul  1 21:58:11 nemi kernel: [ 3658.898647] qmi_wwan 2-1:1.2: Unexpected error -71
      Jul  1 21:58:36 nemi kernel: [ 3684.072021] BUG: soft lockup - CPU#0 stuck for 23s! [qmi.pl:12235]
      Jul  1 21:58:36 nemi kernel: [ 3684.072212] CPU 0
      Jul  1 21:58:36 nemi kernel: [ 3684.072355]
      Jul  1 21:58:36 nemi kernel: [ 3684.072367] Pid: 12235, comm: qmi.pl Tainted: P           O 3.5.0-rc2+ #13 LENOVO 2776LEG/2776LEG
      Jul  1 21:58:36 nemi kernel: [ 3684.072383] RIP: 0010:[<ffffffffa0635008>]  [<ffffffffa0635008>] spin_unlock_irq+0x8/0xc [cdc_wdm]
      Jul  1 21:58:36 nemi kernel: [ 3684.072388] RSP: 0018:ffff88022dca1e70  EFLAGS: 00000282
      Jul  1 21:58:36 nemi kernel: [ 3684.072393] RAX: ffff88022fc3f650 RBX: ffffffff811c56f7 RCX: 00000001000ce8c1
      Jul  1 21:58:36 nemi kernel: [ 3684.072398] RDX: 0000000000000010 RSI: 000000000267d810 RDI: ffff88022fc3f650
      Jul  1 21:58:36 nemi kernel: [ 3684.072403] RBP: ffff88022dca1eb0 R08: ffffffffa063578e R09: 0000000000000000
      Jul  1 21:58:36 nemi kernel: [ 3684.072407] R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000002
      Jul  1 21:58:36 nemi kernel: [ 3684.072412] R13: 0000000000000246 R14: ffffffff00000002 R15: ffff8802281d8c88
      Jul  1 21:58:36 nemi kernel: [ 3684.072418] FS:  00007f666a260700(0000) GS:ffff88023bc00000(0000) knlGS:0000000000000000
      Jul  1 21:58:36 nemi kernel: [ 3684.072423] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      Jul  1 21:58:36 nemi kernel: [ 3684.072428] CR2: 000000000270d9d8 CR3: 000000022e865000 CR4: 00000000000007f0
      Jul  1 21:58:36 nemi kernel: [ 3684.072433] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      Jul  1 21:58:36 nemi kernel: [ 3684.072438] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Jul  1 21:58:36 nemi kernel: [ 3684.072444] Process qmi.pl (pid: 12235, threadinfo ffff88022dca0000, task ffff88022ff76380)
      Jul  1 21:58:36 nemi kernel: [ 3684.072448] Stack:
      Jul  1 21:58:36 nemi kernel: [ 3684.072458]  ffffffffa063592e 0000000100020000 ffff88022fc3f650 ffff88022fc3f6a8
      Jul  1 21:58:36 nemi kernel: [ 3684.072466]  0000000000000200 0000000100000000 000000000267d810 0000000000000000
      Jul  1 21:58:36 nemi kernel: [ 3684.072475]  0000000000000000 ffff880212cfb6d0 0000000000000200 ffff880212cfb6c0
      Jul  1 21:58:36 nemi kernel: [ 3684.072479] Call Trace:
      Jul  1 21:58:36 nemi kernel: [ 3684.072489]  [<ffffffffa063592e>] ? wdm_read+0x1a0/0x263 [cdc_wdm]
      Jul  1 21:58:36 nemi kernel: [ 3684.072500]  [<ffffffff8110adb7>] ? vfs_read+0xa1/0xfb
      Jul  1 21:58:36 nemi kernel: [ 3684.072509]  [<ffffffff81040589>] ? alarm_setitimer+0x35/0x64
      Jul  1 21:58:36 nemi kernel: [ 3684.072517]  [<ffffffff8110aec7>] ? sys_read+0x45/0x6e
      Jul  1 21:58:36 nemi kernel: [ 3684.072525]  [<ffffffff813725f9>] ? system_call_fastpath+0x16/0x1b
      Jul  1 21:58:36 nemi kernel: [ 3684.072557] Code: <66> 66 90 c3 83 ff ed 89 f8 74 16 7f 06 83 ff a1 75 0a c3 83 ff f4
      
      The WDM_READ flag is normally cleared by wdm_int_callback
      before resubmitting the read urb, and set by wdm_in_callback
      when this urb returns with data or an error.  But a crashing
      device may cause both a read error and cancelling all urbs.
      Make sure that the flag is cleared by wdm_read if the buffer
      is empty.
      
      We don't clear the flag on errors, as there may be pending
      data in the buffer which should be processed.  The flag will
      instead be cleared on the next wdm_read call.
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Acked-by: default avatarOliver Neukum <oneukum@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b80f6db7
    • Johan Hovold's avatar
      USB: metro-usb: fix tty_flip_buffer_push use · b46b5ba5
      Johan Hovold authored
      commit b7d28e32 upstream.
      
      Do not set low_latency flag at open as tty_flip_buffer_push must not be
      called in IRQ context with low_latency set.
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b46b5ba5
    • Jonathan Nieder's avatar
      ACPI / PM: Leave Bus Master Arbitration enabled for suspend/resume · d63d3985
      Jonathan Nieder authored
      commit dc332fdf upstream.
      
      This is an old suspend/resume lockup fix:
      
      	commit 2780cc46
      	Author: Len Brown <len.brown@intel.com>
      	Date:   Thu Dec 23 13:43:30 2004 -0500
      
      	    [ACPI] Fix suspend/resume lockup issue
      	    by leaving Bus Master Arbitration enabled.
      	    The ACPI spec mandates it be disabled only for C3.
      
      	    http://bugzilla.kernel.org/show_bug.cgi?id=3599Signed-off-by: default avatarDavid Shaohua Li <shaohua.li@intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      
      The bug snuck back in in commit 2feec47d (ACPICA: ACPI 5: Support
      for new FADT SleepStatus, SleepControl registers, 2012-02-14),
      presumably by copy/pasting a copy of the code without that fix for the
      legacy case.
      
      On affected machines, after that commit, the machine locks up hard on
      resume from suspend.  The same fix as seven years ago still works.
      
      Addresses <https://bugzilla.kernel.org/show_bug.cgi?id=43641>.
      Reported-bisected-and-tested-by: default avatarOctavio Alvarez <alvarezp@alvarezp.com>
      Reported-by: default avatarAdrian Knoth <adi@drcomp.erfurt.thur.de>
      Signed-off-by: default avatarJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d63d3985
    • Dan Williams's avatar
      SCSI: libsas: fix taskfile corruption in sas_ata_qc_fill_rtf · 76c6b958
      Dan Williams authored
      commit 6ef1b512 upstream.
      
      fill_result_tf() grabs the taskfile flags from the originating qc which
      sas_ata_qc_fill_rtf() promptly overwrites.  The presence of an
      ata_taskfile in the sata_device makes it tempting to just copy the full
      contents in sas_ata_qc_fill_rtf().  However, libata really only wants
      the fis contents and expects the other portions of the taskfile to not
      be touched by ->qc_fill_rtf.  To that end store a fis buffer in the
      sata_device and use ata_tf_from_fis() like every other ->qc_fill_rtf()
      implementation.
      Reported-by: default avatarPraveen Murali <pmurali@logicube.com>
      Tested-by: default avatarPraveen Murali <pmurali@logicube.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      76c6b958
    • Mark Rustad's avatar
      SCSI: Fix NULL dereferences in scsi_cmd_to_driver · 5a89aae8
      Mark Rustad authored
      commit 222a806a upstream.
      
      Avoid crashing if the private_data pointer happens to be NULL. This has
      been seen sometimes when a host reset happens, notably when there are
      many LUNs:
      
      host3: Assigned Port ID 0c1601
      scsi host3: libfc: Host reset succeeded on port (0c1601)
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000350
      IP: [<ffffffff81352bb8>] scsi_send_eh_cmnd+0x58/0x3a0
      <snip>
      Process scsi_eh_3 (pid: 4144, threadinfo ffff88030920c000, task ffff880326b160c0)
      Stack:
       000000010372e6ba 0000000000000282 000027100920dca0 ffffffffa0038ee0
       0000000000000000 0000000000030003 ffff88030920dc80 ffff88030920dc80
       00000002000e0000 0000000a00004000 ffff8803242f7760 ffff88031326ed80
      Call Trace:
       [<ffffffff8105b590>] ? lock_timer_base+0x70/0x70
       [<ffffffff81352fbe>] scsi_eh_tur+0x3e/0xc0
       [<ffffffff81353a36>] scsi_eh_test_devices+0x76/0x170
       [<ffffffff81354125>] scsi_eh_host_reset+0x85/0x160
       [<ffffffff81354291>] scsi_eh_ready_devs+0x91/0x110
       [<ffffffff813543fd>] scsi_unjam_host+0xed/0x1f0
       [<ffffffff813546a8>] scsi_error_handler+0x1a8/0x200
       [<ffffffff81354500>] ? scsi_unjam_host+0x1f0/0x1f0
       [<ffffffff8106ec3e>] kthread+0x9e/0xb0
       [<ffffffff81509264>] kernel_thread_helper+0x4/0x10
       [<ffffffff8106eba0>] ? kthread_freezable_should_stop+0x70/0x70
       [<ffffffff81509260>] ? gs_change+0x13/0x13
      Code: 25 28 00 00 00 48 89 45 c8 31 c0 48 8b 87 80 00 00 00 48 8d b5 60 ff ff ff 89 d1 48 89 fb 41 89 d6 4c 89 fa 48 8b 80 b8 00 00 00
       <48> 8b 80 50 03 00 00 48 8b 00 48 89 85 38 ff ff ff 48 8b 07 4c
      RIP  [<ffffffff81352bb8>] scsi_send_eh_cmnd+0x58/0x3a0
       RSP <ffff88030920dc50>
      CR2: 0000000000000350
      Signed-off-by: default avatarMark Rustad <mark.d.rustad@intel.com>
      Tested-by: default avatarMarcus Dennis <marcusx.e.dennis@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5a89aae8
    • Rafael J. Wysocki's avatar
      ACPI / PM: Make acpi_pm_device_sleep_state() follow the specification · 7c2c0261
      Rafael J. Wysocki authored
      commit dbe9a2ed upstream.
      
      The comparison between the system sleep state being entered
      and the lowest system sleep state the given device may wake up
      from in acpi_pm_device_sleep_state() is reversed, because the
      specification (ACPI 5.0) says that for wakeup to work:
      
      "The sleeping state being entered must be less than or equal to the
       power state declared in element 1 of the _PRW object."
      
      In other words, the state returned by _PRW is the deepest
      (lowest-power) system sleep state the device is capable of waking up
      the system from.
      
      Moreover, acpi_pm_device_sleep_state() also should check if the
      wakeup capability is supported through ACPI, because in principle it
      may be done via native PCIe PME, for example, in which case _SxW
      should not be evaluated.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7c2c0261
    • Benjamin Tissoires's avatar
      HID: hid-multitouch: fix wrong protocol detection · 099fddaa
      Benjamin Tissoires authored
      commit 3ac36d15 upstream.
      
      The previous implementation introduced a randomness in the splitting
      of the different touches reported by the device. This version is more
      robust as we don't rely on hi->input->absbit, but on our own structure.
      
      This also prepares hid-multitouch to better support Win8 devices.
      
      [Jiri Kosina <jkosina@suse.cz>: fix build]
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@enac.fr>
      Acked-by: default avatarHenrik Rydberg <rydberg@euromail.se>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      099fddaa
    • Bruce Allan's avatar
      e1000e: test for valid check_reset_block function pointer · e831cf2d
      Bruce Allan authored
      commit 470a5420 upstream.
      
      commit 44abd5c1 introduced NULL pointer
      dereferences when attempting to access the check_reset_block function
      pointer on 8257x and 80003es2lan non-copper devices.
      
      This fix should be applied back through 3.4.
      Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
      Tested-by: default avatarJeff Pieper <jeffrey.e.pieper@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e831cf2d
    • Tomi Valkeinen's avatar
      OMAPDSS: use DSI_FIFO_BUG workaround only for manual update displays · f33f0eaf
      Tomi Valkeinen authored
      commit 3568f2a4 upstream.
      
      There is a problem related to DSS FIFO thresholds and power management
      on OMAP3. It seems that when the full PM hits in, we get underflows. The
      core reason is unknown, but after experiments it looks like only
      particular FIFO thresholds work correctly.
      
      This bug is related to an earlier patch, which added special FIFO
      threshold configuration for OMAP3, because DSI command mode output
      didn't work with the normal threshold configuration.
      
      However, as the above work-around worked fine for other output types
      also, we currently always configure thresholds in this special way on
      OMAP3. In theory there should be negligible difference with this special
      way and the standard way. The first paragraph explains what happens in
      practice.
      
      This patch changes the driver to use the special threshold configuration
      only when the output is a manual update display on OMAP3. This does
      include RFBI displays also, and although it hasn't been tested (no
      boards using RFBI) I suspect the similar behaviour is present there
      also, as the DISPC side should work similarly for DSI command mode and
      RFBI.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Joe Woodward <jw@terrafix.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f33f0eaf
    • Greg Pearson's avatar
      mm/memblock: fix overlapping allocation when doubling reserved array · 757fcf2b
      Greg Pearson authored
      commit 48c3b583 upstream.
      
      __alloc_memory_core_early() asks memblock for a range of memory then try
      to reserve it.  If the reserved region array lacks space for the new
      range, memblock_double_array() is called to allocate more space for the
      array.  If memblock is used to allocate memory for the new array it can
      end up using a range that overlaps with the range originally allocated in
      __alloc_memory_core_early(), leading to possible data corruption.
      
      With this patch memblock_double_array() now calls memblock_find_in_range()
      with a narrowed candidate range (in cases where the reserved.regions array
      is being doubled) so any memory allocated will not overlap with the
      original range that was being reserved.  The range is narrowed by passing
      in the starting address and size of the previously allocated range.  Then
      the range above the ending address is searched and if a candidate is not
      found, the range below the starting address is searched.
      Signed-off-by: default avatarGreg Pearson <greg.pearson@hp.com>
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.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 avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      757fcf2b