1. 17 Jan, 2013 10 commits
    • David Jeffery's avatar
      SCSI: qla2xxx: Test and clear FCPORT_UPDATE_NEEDED atomically. · 78c9672f
      David Jeffery authored
      commit a394aac8 upstream.
      
      When the qla2xxx driver loses access to multiple, remote ports, there is a race
      condition which can occur which will keep the request stuck on a scsi request
      queue indefinitely.
      
      This bad state occurred do to a race condition with how the FCPORT_UPDATE_NEEDED
      bit is set in qla2x00_schedule_rport_del(), and how it is cleared in
      qla2x00_do_dpc().  The problem port has its drport pointer set, but it has never
      been processed by the driver to inform the fc transport that the port has been
      lost.  qla2x00_schedule_rport_del() sets drport, and then sets the
      FCPORT_UPDATE_NEEDED bit.  In qla2x00_do_dpc(), the port lists are walked and
      any drport pointer is handled and the fc transport informed of the port loss,
      then the FCPORT_UPDATE_NEEDED bit is cleared.  This leaves a race where the
      dpc thread is processing one port removal, another port removal is marked
      with a call to qla2x00_schedule_rport_del(), and the dpc thread clears the
      bit for both removals, even though only the first removal was actually
      handled.  Until another event occurs to set FCPORT_UPDATE_NEEDED, the later
      port removal is never finished and qla2xxx stays in a bad state which causes
      requests to become stuck on request queues.
      
      This patch updates the driver to test and clear FCPORT_UPDATE_NEEDED
      atomically.  This ensures the port state changes are processed and not lost.
      Signed-off-by: default avatarDavid Jeffery <djeffery@redhat.com>
      Signed-off-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
      Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      78c9672f
    • Xi Wang's avatar
      SCSI: mvsas: fix undefined bit shift · b9ebaf5a
      Xi Wang authored
      commit beecadea upstream.
      
      The macro bit(n) is defined as ((u32)1 << n), and thus it doesn't work
      with n >= 32, such as in mvs_94xx_assign_reg_set():
      
      	if (i >= 32) {
      		mvi->sata_reg_set |= bit(i);
      		...
      	}
      
      The shift ((u32)1 << n) with n >= 32 also leads to undefined behavior.
      The result varies depending on the architecture.
      
      This patch changes bit(n) to do a 64-bit shift.  It also simplifies
      mv_ffc64() using __ffs64(), since invoking ffz() with ~0 is undefined.
      Signed-off-by: default avatarXi Wang <xi.wang@gmail.com>
      Acked-by: default avatarXiangliang Yu <yuxiangl@marvell.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b9ebaf5a
    • Stephan Gatzka's avatar
      firewire: net: Fix handling of fragmented multicast/broadcast packets. · f8ef1b36
      Stephan Gatzka authored
      commit 9d237342 upstream.
      
      This patch fixes both the transmit and receive portion of sending
      fragmented mutlicast and broadcast packets.
      
      The transmit section was broken because the offset for INTFRAG and
      LASTFRAG packets were just miscalculated by IEEE1394_GASP_HDR_SIZE (which
      was reserved with skb_push() in fwnet_send_packet).
      
      The receive section was broken because in fwnet_incoming_packet is a call
      to fwnet_peer_find_by_node_id(). Called with generation == -1 it will
      not find a peer and the partial datagrams are associated to a peer.
      
      [Stefan R:  The fix to use context->card->generation is not perfect.
      It relies on the IR tasklet which processes packets from the prior bus
      generation to run before the self-ID-complete worklet which sets the
      current card generation.  Alas, there is no simple way of a race-free
      implementation.  Let's do it this way for now.]
      Signed-off-by: default avatarStephan Gatzka <stephan.gatzka@gmail.com>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f8ef1b36
    • Gabor Juhos's avatar
      ath9k: ar9003: fix OTP register offsets for AR9340 · 46bea30a
      Gabor Juhos authored
      commit b3cd8021 upstream.
      
      Trying to access the OTP memory on the AR9340
      causes a data bus error like this:
      
        Data bus error, epc == 86e84164, ra == 86e84164
        Oops[#1]:
        Cpu 0
        $ 0   : 00000000 00000061 deadc0de 00000000
        $ 4   : b8115f18 00015f18 00000007 00000004
        $ 8   : 00000001 7c7c3c7c 7c7c7c7c 7c7c7c7c
        $12   : 7c7c3c7c 001f0041 00000000 7c7c7c3c
        $16   : 86ee0000 00015f18 00000000 00000007
        $20   : 00000004 00000064 00000004 86d71c44
        $24   : 00000000 86e6ca00
        $28   : 86d70000 86d71b20 86ece0c0 86e84164
        Hi    : 00000000
        Lo    : 00000064
        epc   : 86e84164 ath9k_hw_wait+0x58/0xb0 [ath9k_hw]
            Tainted: G           O
        ra    : 86e84164 ath9k_hw_wait+0x58/0xb0 [ath9k_hw]
        Status: 1100d403    KERNEL EXL IE
        Cause : 4080801c
        PrId  : 0001974c (MIPS 74Kc)
        Modules linked in: ath9k(O+) ath9k_common(O) ath9k_hw(O) ath(O) ar934x_nfc
        mac80211(O) usbcore usb_common scsi_mod nls_base nand nand_ecc nand_ids
        crc_ccitt cfg80211(O) compat(O) arc4 aes_generic crypto_blkcipher cryptomgr
        aead crypto_hash crypto_algapi ledtrig_timer ledtrig_default_on leds_gpio
        Process insmod (pid: 459, threadinfo=86d70000, task=87942140, tls=779ac440)
        Stack : 802fb500 000200da 804db150 804e0000 87816130 86ee0000 00010000 86d71b88
                86d71bc0 00000004 00000003 86e9fcd0 80305300 0002c0d0 86e74c50 800b4c20
                000003e8 00000001 00000000 86ee0000 000003ff 86e9fd64 80305300 80123938
                fffffffc 00000004 000058bc 00000000 86ea0000 86ee0000 000001ff 878d6000
                99999999 86e9fdc0 86ee0fcc 86e9e664 0000c0d0 86ee0000 0000700000007000
                ...
        Call Trace:
        [<86e84164>] ath9k_hw_wait+0x58/0xb0 [ath9k_hw]
        [<86e9fcd0>] ath9k_hw_setup_statusring+0x16b8/0x1c7c [ath9k_hw]
      
        Code: 0000a812  0040f809  00000000 <00531024> 1054000b  24020001  0c05b5dc  2404000a  26520001
      
      The cause of the error is that the OTP register
      offsets are different on the AR9340 than the
      actually used values.
      Signed-off-by: default avatarGabor Juhos <juhosg@openwrt.org>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      46bea30a
    • Felix Fietkau's avatar
      Revert "ath9k_hw: Update AR9003 high_power tx gain table" · ae172f61
      Felix Fietkau authored
      commit 9c170e06 upstream.
      
      This reverts commit f74b9d36.
      
      Turns out reverting commit a240dc7b
      "ath9k_hw: Updated AR9003 tx gain table for 5GHz" was not enough to
      bring the tx power back to normal levels on devices like the
      Buffalo WZR-HP-G450H, this one needs to be reverted as well.
      
      This revert improves tx power by ~10 db on that device
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Cc: rmanohar@qca.qualcomm.com
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ae172f61
    • Laura Abbott's avatar
      mm: use aligned zone start for pfn_to_bitidx calculation · da0e14f0
      Laura Abbott authored
      commit c060f943 upstream.
      
      The current calculation in pfn_to_bitidx assumes that (pfn -
      zone->zone_start_pfn) >> pageblock_order will return the same bit for
      all pfn in a pageblock.  If zone_start_pfn is not aligned to
      pageblock_nr_pages, this may not always be correct.
      
      Consider the following with pageblock order = 10, zone start 2MB:
      
        pfn     | pfn - zone start | (pfn - zone start) >> page block order
        ----------------------------------------------------------------
        0x26000 | 0x25e00	   |  0x97
        0x26100 | 0x25f00	   |  0x97
        0x26200 | 0x26000	   |  0x98
        0x26300 | 0x26100	   |  0x98
      
      This means that calling {get,set}_pageblock_migratetype on a single page
      will not set the migratetype for the full block.  Fix this by rounding
      down zone_start_pfn when doing the bitidx calculation.
      
      For our use case, the effects of this bug were mostly tied to the fact
      that CMA allocations would either take a long time or fail to happen.
      Depending on the driver using CMA, this could result in anything from
      visual glitches to application failures.
      Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
      Acked-by: default avatarMel Gorman <mgorman@suse.de>
      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>
      da0e14f0
    • Jason Liu's avatar
      mm: compaction: fix echo 1 > compact_memory return error issue · 63c54425
      Jason Liu authored
      commit 7964c06d upstream.
      
      when run the folloing command under shell, it will return error
      
        sh/$ echo 1 > /proc/sys/vm/compact_memory
        sh/$ sh: write error: Bad address
      
      After strace, I found the following log:
      
        ...
        write(1, "1\n", 2)               = 3
        write(1, "", 4294967295)         = -1 EFAULT (Bad address)
        write(2, "echo: write error: Bad address\n", 31echo: write error: Bad address
        ) = 31
      
      This tells system return 3(COMPACT_COMPLETE) after write data to
      compact_memory.
      
      The fix is to make the system just return 0 instead 3(COMPACT_COMPLETE)
      from sysctl_compaction_handler after compaction_nodes finished.
      Signed-off-by: default avatarJason Liu <r64343@freescale.com>
      Suggested-by: default avatarDavid Rientjes <rientjes@google.com>
      Acked-by: default avatarMel Gorman <mgorman@suse.de>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.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>
      63c54425
    • Sebastian Ott's avatar
      s390/cio: fix pgid reserved check · 2c77bb37
      Sebastian Ott authored
      commit d99e79ec upstream.
      
      The check to whom a device is reserved is done by checking the path
      state of the affected channel paths. If it turns out that one path is
      flagged as reserved by someone else the whole device is marked as such.
      
      However the meaning of the RESVD_ELSE bit is that the addressed device
      is reserved to a different pathgroup (and not reserved to a different
      LPAR). If we do this test on a path which is currently not a member of
      the pathgroup we could erroneously mark the device as reserved to
      someone else.
      
      To fix this collect the reserved state for all potential members of the
      pathgroup and only mark the device as reserved if all of those potential
      members have the RESVD_ELSE bit set.
      Acked-by: default avatarPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
      Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2c77bb37
    • Shan Hai's avatar
      powerpc/vdso: Remove redundant locking in update_vsyscall_tz() · aea63e00
      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 avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aea63e00
    • Anton Blanchard's avatar
      powerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build · dc22f2dc
      Anton Blanchard authored
      commit 11ee7e99 upstream.
      
      If we build a kernel with CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n,
      the kernel fails when we run at a non zero offset. It turns out
      we were incorrectly wrapping some of the relocatable kernel code
      with CONFIG_CRASH_DUMP.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dc22f2dc
  2. 11 Jan, 2013 30 commits
    • Greg Kroah-Hartman's avatar
      Linux 3.0.58 · 2a68fec1
      Greg Kroah-Hartman authored
      2a68fec1
    • Alexander Stein's avatar
      can: Do not call dev_put if restart timer is running upon close · a0ed2e74
      Alexander Stein authored
      commit ab48b03e upstream.
      
      If the restart timer is running due to BUS-OFF and the device is
      disconnected an dev_put will decrease the usage counter to -1 thus
      blocking the interface removal, resulting in the following dmesg
      lines repeating every 10s:
      can: notifier: receive list not found for dev can0
      can: notifier: receive list not found for dev can0
      can: notifier: receive list not found for dev can0
      unregister_netdevice: waiting for can0 to become free. Usage count = -1
      Signed-off-by: default avatarAlexander Stein <alexander.stein@systec-electronic.com>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a0ed2e74
    • Michal Hocko's avatar
      mm: limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT · c39096f1
      Michal Hocko authored
      commit 53a59fc6 upstream.
      
      Since commit e303297e ("mm: extended batches for generic
      mmu_gather") we are batching pages to be freed until either
      tlb_next_batch cannot allocate a new batch or we are done.
      
      This works just fine most of the time but we can get in troubles with
      non-preemptible kernel (CONFIG_PREEMPT_NONE or CONFIG_PREEMPT_VOLUNTARY)
      on large machines where too aggressive batching might lead to soft
      lockups during process exit path (exit_mmap) because there are no
      scheduling points down the free_pages_and_swap_cache path and so the
      freeing can take long enough to trigger the soft lockup.
      
      The lockup is harmless except when the system is setup to panic on
      softlockup which is not that unusual.
      
      The simplest way to work around this issue is to limit the maximum
      number of batches in a single mmu_gather.  10k of collected pages should
      be safe to prevent from soft lockups (we would have 2ms for one) even if
      they are all freed without an explicit scheduling point.
      
      This patch doesn't add any new explicit scheduling points because it
      relies on zap_pmd_range during page tables zapping which calls
      cond_resched per PMD.
      
      The following lockup has been reported for 3.0 kernel with a huge
      process (in order of hundreds gigs but I do know any more details).
      
        BUG: soft lockup - CPU#56 stuck for 22s! [kernel:31053]
        Modules linked in: af_packet nfs lockd fscache auth_rpcgss nfs_acl sunrpc mptctl mptbase autofs4 binfmt_misc dm_round_robin dm_multipath bonding cpufreq_conservative cpufreq_userspace cpufreq_powersave pcc_cpufreq mperf microcode fuse loop osst sg sd_mod crc_t10dif st qla2xxx scsi_transport_fc scsi_tgt netxen_nic i7core_edac iTCO_wdt joydev e1000e serio_raw pcspkr edac_core iTCO_vendor_support acpi_power_meter rtc_cmos hpwdt hpilo button container usbhid hid dm_mirror dm_region_hash dm_log linear uhci_hcd ehci_hcd usbcore usb_common scsi_dh_emc scsi_dh_alua scsi_dh_hp_sw scsi_dh_rdac scsi_dh dm_snapshot pcnet32 mii edd dm_mod raid1 ext3 mbcache jbd fan thermal processor thermal_sys hwmon cciss scsi_mod
        Supported: Yes
        CPU 56
        Pid: 31053, comm: kernel Not tainted 3.0.31-0.9-default #1 HP ProLiant DL580 G7
        RIP: 0010:  _raw_spin_unlock_irqrestore+0x8/0x10
        RSP: 0018:ffff883ec1037af0  EFLAGS: 00000206
        RAX: 0000000000000e00 RBX: ffffea01a0817e28 RCX: ffff88803ffd9e80
        RDX: 0000000000000200 RSI: 0000000000000206 RDI: 0000000000000206
        RBP: 0000000000000002 R08: 0000000000000001 R09: ffff887ec724a400
        R10: 0000000000000000 R11: dead000000200200 R12: ffffffff8144c26e
        R13: 0000000000000030 R14: 0000000000000297 R15: 000000000000000e
        FS:  00007ed834282700(0000) GS:ffff88c03f200000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
        CR2: 000000000068b240 CR3: 0000003ec13c5000 CR4: 00000000000006e0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
        Process kernel (pid: 31053, threadinfo ffff883ec1036000, task ffff883ebd5d4100)
        Call Trace:
          release_pages+0xc5/0x260
          free_pages_and_swap_cache+0x9d/0xc0
          tlb_flush_mmu+0x5c/0x80
          tlb_finish_mmu+0xe/0x50
          exit_mmap+0xbd/0x120
          mmput+0x49/0x120
          exit_mm+0x122/0x160
          do_exit+0x17a/0x430
          do_group_exit+0x3d/0xb0
          get_signal_to_deliver+0x247/0x480
          do_signal+0x71/0x1b0
          do_notify_resume+0x98/0xb0
          int_signal+0x12/0x17
        DWARF2 unwinder stuck at int_signal+0x12/0x17
      Signed-off-by: default avatarMichal Hocko <mhocko@suse.cz>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      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>
      c39096f1
    • Tony Prisk's avatar
      drivers/rtc/rtc-vt8500.c: fix handling of data passed in struct rtc_time · a2e11138
      Tony Prisk authored
      commit 2f90b683 upstream.
      
      tm_mon is 0..11, whereas vt8500 expects 1..12 for the month field,
      causing invalid date errors for January, and causing the day field to
      roll over incorrectly.
      
      The century flag is only handled in vt8500_rtc_read_time, but not set in
      vt8500_rtc_set_time.  This patch corrects the behaviour of the century
      flag.
      Signed-off-by: default avatarEdgar Toernig <froese@gmx.de>
      Signed-off-by: default avatarTony Prisk <linux@prisktech.co.nz>
      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>
      a2e11138
    • Tony Prisk's avatar
      drivers/rtc/rtc-vt8500.c: correct handling of CR_24H bitfield · afc0e69c
      Tony Prisk authored
      commit 532db570 upstream.
      
      Control register bitfield for 12H/24H mode is handled incorrectly.
      Setting CR_24H actually enables 12H mode.  This patch renames the define
      and changes the initialization code to correctly set 24H mode.
      Signed-off-by: default avatarTony Prisk <linux@prisktech.co.nz>
      Cc: Edgar Toernig <froese@gmx.de>
      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>
      afc0e69c
    • Corey Minyard's avatar
      CRIS: fix I/O macros · 4a16c403
      Corey Minyard authored
      commit c24bf9b4 upstream.
      
      The inb/outb macros for CRIS are broken from a number of points of view,
      missing () around parameters and they have an unprotected if statement
      in them.  This was breaking the compile of IPMI on CRIS and thus I was
      being annoyed by build regressions, so I fixed them.
      
      Plus I don't think they would have worked at all, since the data values
      were missing "&" and the outsl had a "3" instead of a "4" for the size.
      From what I can tell, this stuff is not used at all, so this can't be
      any more broken than it was before, anyway.
      Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.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>
      4a16c403
    • Gustavo Padovan's avatar
      Bluetooth: cancel power_on work when unregistering the device · 9b7b38a4
      Gustavo Padovan authored
      commit b9b5ef18 upstream.
      
      We need to cancel the hci_power_on work in order to avoid it run when we
      try to free the hdev.
      
      [ 1434.201149] ------------[ cut here ]------------
      [ 1434.204998] WARNING: at lib/debugobjects.c:261 debug_print_object+0x8e/0xb0()
      [ 1434.208324] ODEBUG: free active (active state 0) object type: work_struct hint: hci
      _power_on+0x0/0x90
      [ 1434.210386] Pid: 8564, comm: trinity-child25 Tainted: G        W    3.7.0-rc5-next-
      20121112-sasha-00018-g2f4ce0e #127
      [ 1434.210760] Call Trace:
      [ 1434.210760]  [<ffffffff819f3d6e>] ? debug_print_object+0x8e/0xb0
      [ 1434.210760]  [<ffffffff8110b887>] warn_slowpath_common+0x87/0xb0
      [ 1434.210760]  [<ffffffff8110b911>] warn_slowpath_fmt+0x41/0x50
      [ 1434.210760]  [<ffffffff819f3d6e>] debug_print_object+0x8e/0xb0
      [ 1434.210760]  [<ffffffff8376b750>] ? hci_dev_open+0x310/0x310
      [ 1434.210760]  [<ffffffff83bf94e5>] ? _raw_spin_unlock_irqrestore+0x55/0xa0
      [ 1434.210760]  [<ffffffff819f3ee5>] __debug_check_no_obj_freed+0xa5/0x230
      [ 1434.210760]  [<ffffffff83785db0>] ? bt_host_release+0x10/0x20
      [ 1434.210760]  [<ffffffff819f4d15>] debug_check_no_obj_freed+0x15/0x20
      [ 1434.210760]  [<ffffffff8125eee7>] kfree+0x227/0x330
      [ 1434.210760]  [<ffffffff83785db0>] bt_host_release+0x10/0x20
      [ 1434.210760]  [<ffffffff81e539e5>] device_release+0x65/0xc0
      [ 1434.210760]  [<ffffffff819d3975>] kobject_cleanup+0x145/0x190
      [ 1434.210760]  [<ffffffff819d39cd>] kobject_release+0xd/0x10
      [ 1434.210760]  [<ffffffff819d33cc>] kobject_put+0x4c/0x60
      [ 1434.210760]  [<ffffffff81e548b2>] put_device+0x12/0x20
      [ 1434.210760]  [<ffffffff8376a334>] hci_free_dev+0x24/0x30
      [ 1434.210760]  [<ffffffff82fd8fe1>] vhci_release+0x31/0x60
      [ 1434.210760]  [<ffffffff8127be12>] __fput+0x122/0x250
      [ 1434.210760]  [<ffffffff811cab0d>] ? rcu_user_exit+0x9d/0xd0
      [ 1434.210760]  [<ffffffff8127bf49>] ____fput+0x9/0x10
      [ 1434.210760]  [<ffffffff81133402>] task_work_run+0xb2/0xf0
      [ 1434.210760]  [<ffffffff8106cfa7>] do_notify_resume+0x77/0xa0
      [ 1434.210760]  [<ffffffff83bfb0ea>] int_signal+0x12/0x17
      [ 1434.210760] ---[ end trace a6d57fefbc8a8cc7 ]---
      Reported-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9b7b38a4
    • Marcos Chaparro's avatar
      Bluetooth: ath3k: Add support for VAIO VPCEH [0489:e027] · 1bc26219
      Marcos Chaparro authored
      commit acd94544 upstream.
      
      Added Atheros AR3011 internal bluetooth device found in Sony VAIO VPCEH to the
      devices list.
      Before this, the bluetooth module was identified as an Foxconn / Hai bluetooth
      device [0489:e027], now it claims to be an AtherosAR3011 Bluetooth
      [0cf3:3005].
      
      T:  Bus=01 Lev=02 Prnt=02 Port=04 Cnt=02 Dev#=  4 Spd=12   MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0489 ProdID=e027 Rev= 0.01
      C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      Signed-off-by: default avatarMarcos Chaparro <marcos@mrkindustries.com.ar>
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1bc26219
    • Andy Lutomirski's avatar
      PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz · e6413067
      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 avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e6413067
    • David Woodhouse's avatar
      solos-pci: fix double-free of TX skb in DMA mode · decbd08d
      David Woodhouse authored
      commit cae49ede upstream.
      
      We weren't clearing card->tx_skb[port] when processing the TX done interrupt.
      If there wasn't another skb ready to transmit immediately, this led to a
      double-free because we'd free it *again* next time we did have a packet to
      send.
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      decbd08d
    • Al Viro's avatar
      ARM: missing ->mmap_sem around find_vma() in swp_emulate.c · 0b6916a7
      Al Viro authored
      commit 7bf9b7be upstream.
      
      find_vma() is *not* safe when somebody else is removing vmas.  Not just
      the return value might get bogus just as you are getting it (this instance
      doesn't try to dereference the resulting vma), the search itself can get
      buggered in rather spectacular ways.  IOW, ->mmap_sem really, really is
      not optional here.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0b6916a7
    • Will Deacon's avatar
      ARM: mm: use pteval_t to represent page protection values · f61019b8
      Will Deacon authored
      commit 864aa04c upstream.
      
      When updating the page protection map after calculating the user_pgprot
      value, the base protection map is temporarily stored in an unsigned long
      type, causing truncation of the protection bits when LPAE is enabled.
      This effectively means that calls to mprotect() will corrupt the upper
      page attributes, clearing the XN bit unconditionally.
      
      This patch uses pteval_t to store the intermediate protection values,
      preserving the upper bits for 64-bit descriptors.
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f61019b8
    • Eric Dumazet's avatar
      tcp: RFC 5961 5.2 Blind Data Injection Attack Mitigation · 8d15569e
      Eric Dumazet authored
      [ Upstream commit 354e4aa3 ]
      
      RFC 5961 5.2 [Blind Data Injection Attack].[Mitigation]
      
        All TCP stacks MAY implement the following mitigation.  TCP stacks
        that implement this mitigation MUST add an additional input check to
        any incoming segment.  The ACK value is considered acceptable only if
        it is in the range of ((SND.UNA - MAX.SND.WND) <= SEG.ACK <=
        SND.NXT).  All incoming segments whose ACK value doesn't satisfy the
        above condition MUST be discarded and an ACK sent back.
      
      Move tcp_send_challenge_ack() before tcp_ack() to avoid a forward
      declaration.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Cc: Jerry Chu <hkchu@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8d15569e
    • Eric Dumazet's avatar
      tcp: tcp_replace_ts_recent() should not be called from tcp_validate_incoming() · ffd34fcb
      Eric Dumazet authored
      [ Upstream commit bd090dfc ]
      
      We added support for RFC 5961 in latest kernels but TCP fails
      to perform exhaustive check of ACK sequence.
      
      We can update our view of peer tsval from a frame that is
      later discarded by tcp_ack()
      
      This makes timestamps enabled sessions vulnerable to injection of
      a high tsval : peers start an ACK storm, since the victim
      sends a dupack each time it receives an ACK from the other peer.
      
      As tcp_validate_incoming() is called before tcp_ack(), we should
      not peform tcp_replace_ts_recent() from it, and let callers do it
      at the right time.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Cc: Nandita Dukkipati <nanditad@google.com>
      Cc: H.K. Jerry Chu <hkchu@google.com>
      Cc: Romain Francoise <romain@orebokech.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ffd34fcb
    • Eric Dumazet's avatar
      tcp: refine SYN handling in tcp_validate_incoming · 282190ea
      Eric Dumazet authored
      [ Upstream commit e3715899 ]
      
      Followup of commit 0c24604b (tcp: implement RFC 5961 4.2)
      
      As reported by Vijay Subramanian, we should send a challenge ACK
      instead of a dup ack if a SYN flag is set on a packet received out of
      window.
      
      This permits the ratelimiting to work as intended, and to increase
      correct SNMP counters.
      Suggested-by: default avatarVijay Subramanian <subramanian.vijay@gmail.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarVijay Subramanian <subramanian.vijay@gmail.com>
      Cc: Kiran Kumar Kella <kkiran@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      282190ea
    • Eric Dumazet's avatar
      tcp: implement RFC 5961 4.2 · ab5c718d
      Eric Dumazet authored
      [ Upstream commit 0c24604b ]
      
      Implement the RFC 5691 mitigation against Blind
      Reset attack using SYN bit.
      
      Section 4.2 of RFC 5961 advises to send a Challenge ACK and drop
      incoming packet, instead of resetting the session.
      
      Add a new SNMP counter to count number of challenge acks sent
      in response to SYN packets.
      (netstat -s | grep TCPSYNChallenge)
      
      Remove obsolete TCPAbortOnSyn, since we no longer abort a TCP session
      because of a SYN flag.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Kiran Kumar Kella <kkiran@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ab5c718d
    • Eric Dumazet's avatar
      tcp: implement RFC 5961 3.2 · 86791bbf
      Eric Dumazet authored
      [ Upstream commit 282f23c6 ]
      
      Implement the RFC 5691 mitigation against Blind
      Reset attack using RST bit.
      
      Idea is to validate incoming RST sequence,
      to match RCV.NXT value, instead of previouly accepted
      window : (RCV.NXT <= SEG.SEQ < RCV.NXT+RCV.WND)
      
      If sequence is in window but not an exact match, send
      a "challenge ACK", so that the other part can resend an
      RST with the appropriate sequence.
      
      Add a new sysctl, tcp_challenge_ack_limit, to limit
      number of challenge ACK sent per second.
      
      Add a new SNMP counter to count number of challenge acks sent.
      (netstat -s | grep TCPChallengeACK)
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Kiran Kumar Kella <kkiran@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      86791bbf
    • Stefan Hasko's avatar
      net: sched: integer overflow fix · 9b79271d
      Stefan Hasko authored
      [ Upstream commit d2fe85da ]
      
      Fixed integer overflow in function htb_dequeue
      Signed-off-by: default avatarStefan Hasko <hasko.stevo@gmail.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9b79271d
    • Dave Kleikamp's avatar
      sparc: huge_ptep_set_* functions need to call set_huge_pte_at() · 1e8928ab
      Dave Kleikamp authored
      [ Upstream commit 6cb9c369 ]
      
      Modifying the huge pte's requires that all the underlying pte's be
      modified.
      
      Version 2: added missing flush_tlb_page()
      Signed-off-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: sparclinux@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1e8928ab
    • Steven Rostedt's avatar
      ftrace: Do not function trace inlined functions · 6fe7238e
      Steven Rostedt authored
      commit 45959ee7 upstream.
      
      When gcc inlines a function, it does not mark it with the mcount
      prologue, which in turn means that inlined functions are not traced
      by the function tracer. But if CONFIG_OPTIMIZE_INLINING is set, then
      gcc is allowed not to inline a function that is marked inline.
      
      Depending on the options and the compiler, a function may or may
      not be traced by the function tracer, depending on whether gcc
      decides to inline a function or not. This has caused several
      problems in the pass becaues gcc is not always consistent with
      what it decides to inline between different gcc versions.
      
      Some places should not be traced (like paravirt native_* functions)
      and these are mostly marked as inline. When gcc decides not to
      inline the function, and if that function should not be traced, then
      the ftrace function tracer will suddenly break when it use to work
      fine. This becomes even harder to debug when different versions of
      gcc will not inline that function, making the same kernel and config
      work for some gcc versions and not work for others.
      
      By making all functions marked inline to not be traced will remove
      the ambiguity that gcc adds when it comes to tracing functions marked
      inline. All gcc versions will be consistent with what functions are
      traced and having volatile working code will be removed.
      
      Note, only the inline macro when CONFIG_OPTIMIZE_INLINING is set needs
      to have notrace added, as the attribute __always_inline will force
      the function to be inlined and then not traced.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6fe7238e
    • Andre Przywara's avatar
      x86, amd: Disable way access filter on Piledriver CPUs · 6c94f438
      Andre Przywara authored
      commit 2bbf0a14 upstream.
      
      The Way Access Filter in recent AMD CPUs may hurt the performance of
      some workloads, caused by aliasing issues in the L1 cache.
      This patch disables it on the affected CPUs.
      
      The issue is similar to that one of last year:
      http://lkml.indiana.edu/hypermail/linux/kernel/1107.3/00041.html
      This new patch does not replace the old one, we just need another
      quirk for newer CPUs.
      
      The performance penalty without the patch depends on the
      circumstances, but is a bit less than the last year's 3%.
      
      The workloads affected would be those that access code from the same
      physical page under different virtual addresses, so different
      processes using the same libraries with ASLR or multiple instances of
      PIE-binaries. The code needs to be accessed simultaneously from both
      cores of the same compute unit.
      
      More details can be found here:
      http://developer.amd.com/Assets/SharedL1InstructionCacheonAMD15hCPU.pdf
      
      CPUs affected are anything with the core known as Piledriver.
      That includes the new parts of the AMD A-Series (aka Trinity) and the
      just released new CPUs of the FX-Series (aka Vishera).
      The model numbering is a bit odd here: FX CPUs have model 2,
      A-Series has model 10h, with possible extensions to 1Fh. Hence the
      range of model ids.
      Signed-off-by: default avatarAndre Przywara <osp@andrep.de>
      Link: http://lkml.kernel.org/r/1351700450-9277-1-git-send-email-osp@andrep.deSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Signed-off-by: default avatarCAI Qian <caiqian@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6c94f438
    • Tejun Heo's avatar
      cgroup: remove incorrect dget/dput() pair in cgroup_create_dir() · 01fdcf4e
      Tejun Heo authored
      commit 17543163 upstream.
      
      cgroup_create_dir() does weird dancing with dentry refcnt.  On
      success, it gets and then puts it achieving nothing.  On failure, it
      puts but there isn't no matching get anywhere leading to the following
      oops if cgroup_create_file() fails for whatever reason.
      
        ------------[ cut here ]------------
        kernel BUG at /work/os/work/fs/dcache.c:552!
        invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
        Modules linked in:
        CPU 2
        Pid: 697, comm: mkdir Not tainted 3.7.0-rc4-work+ #3 Bochs Bochs
        RIP: 0010:[<ffffffff811d9c0c>]  [<ffffffff811d9c0c>] dput+0x1dc/0x1e0
        RSP: 0018:ffff88001a3ebef8  EFLAGS: 00010246
        RAX: 0000000000000000 RBX: ffff88000e5b1ef8 RCX: 0000000000000403
        RDX: 0000000000000303 RSI: 2000000000000000 RDI: ffff88000e5b1f58
        RBP: ffff88001a3ebf18 R08: ffffffff82c76960 R09: 0000000000000001
        R10: ffff880015022080 R11: ffd9bed70f48a041 R12: 00000000ffffffea
        R13: 0000000000000001 R14: ffff88000e5b1f58 R15: 00007fff57656d60
        FS:  00007ff05fcb3800(0000) GS:ffff88001fd00000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 00000000004046f0 CR3: 000000001315f000 CR4: 00000000000006e0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
        Process mkdir (pid: 697, threadinfo ffff88001a3ea000, task ffff880015022080)
        Stack:
         ffff88001a3ebf48 00000000ffffffea 0000000000000001 0000000000000000
         ffff88001a3ebf38 ffffffff811cc889 0000000000000001 ffff88000e5b1ef8
         ffff88001a3ebf68 ffffffff811d1fc9 ffff8800198d7f18 ffff880019106ef8
        Call Trace:
         [<ffffffff811cc889>] done_path_create+0x19/0x50
         [<ffffffff811d1fc9>] sys_mkdirat+0x59/0x80
         [<ffffffff811d2009>] sys_mkdir+0x19/0x20
         [<ffffffff81be1e02>] system_call_fastpath+0x16/0x1b
        Code: 00 48 8d 90 18 01 00 00 48 89 93 c0 00 00 00 4c 89 a0 18 01 00 00 48 8b 83 a0 00 00 00 83 80 28 01 00 00 01 e8 e6 6f a0 00 eb 92 <0f> 0b 66 90 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 49 89 fe 41
        RIP  [<ffffffff811d9c0c>] dput+0x1dc/0x1e0
         RSP <ffff88001a3ebef8>
        ---[ end trace 1277bcfd9561ddb0 ]---
      
      Fix it by dropping the unnecessary dget/dput() pair.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      01fdcf4e
    • Russell Webb's avatar
      xhci: Add Lynx Point LP to list of Intel switchable hosts · 5729b131
      Russell Webb authored
      commit bb1e5dd7 upstream.
      
      Like Lynx Point, Lynx Point LP is also switchable.  See
      1c12443a for more details.
      
      This patch should be backported to stable kernels as old as 3.0,
      that contain commit 69e848c2
      "Intel xhci: Support EHCI/xHCI port switching."
      Signed-off-by: default avatarRussell Webb <russell.webb@linux.intel.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5729b131
    • Thomas Gleixner's avatar
      genirq: Always force thread affinity · d0389110
      Thomas Gleixner authored
      commit 04aa530e upstream.
      
      Sankara reported that the genirq core code fails to adjust the
      affinity of an interrupt thread in several cases:
      
       1) On request/setup_irq() the call to setup_affinity() happens before
          the new action is registered, so the new thread is not notified.
      
       2) For secondary shared interrupts nothing notifies the new thread to
          change its affinity.
      
       3) Interrupts which have the IRQ_NO_BALANCE flag set are not moving
          the thread either.
      
      Fix this by setting the thread affinity flag right on thread creation
      time. This ensures that under all circumstances the thread moves to
      the right place. Requires a check in irq_thread_check_affinity for an
      existing affinity mask (CONFIG_CPU_MASK_OFFSTACK=y)
      Reported-and-tested-by: default avatarSankara Muthukrishnan <sankara.m@gmail.com>
      Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1209041738200.2754@ionosSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d0389110
    • Peter Popovec's avatar
      Input: walkera0701 - fix crash on startup · ada84ad6
      Peter Popovec authored
      commit a455e298 upstream.
      
      The driver's timer must be set up before enabling IRQ handler, otherwise
      bad things may happen.
      Reported-and-tested-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: default avatarPeter Popovec <popovec@fei.tuke.sk>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ada84ad6
    • Xi Wang's avatar
      nfs: fix null checking in nfs_get_option_str() · 31c4e8cd
      Xi Wang authored
      commit e25fbe38 upstream.
      
      The following null pointer check is broken.
      
      	*option = match_strdup(args);
      	return !option;
      
      The pointer `option' must be non-null, and thus `!option' is always false.
      Use `!*option' instead.
      
      The bug was introduced in commit c5cb09b6 ("Cleanup: Factor out some
      cut-and-paste code.").
      Signed-off-by: default avatarXi Wang <xi.wang@gmail.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      31c4e8cd
    • J. Bruce Fields's avatar
      nfsd4: fix oops on unusual readlike compound · d6e0c42c
      J. Bruce Fields authored
      commit d5f50b0c upstream.
      
      If the argument and reply together exceed the maximum payload size, then
      a reply with a read-like operation can overlow the rq_pages array.
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d6e0c42c
    • Trond Myklebust's avatar
      NFS: Fix calls to drop_nlink() · 9d53441a
      Trond Myklebust authored
      commit 1f018458 upstream.
      
      It is almost always wrong for NFS to call drop_nlink() after removing a
      file. What we really want is to mark the inode's attributes for
      revalidation, and we want to ensure that the VFS drops it if we're
      reasonably sure that this is the final unlink().
      Do the former using the usual cache validity flags, and the latter
      by testing if inode->i_nlink == 1, and clearing it in that case.
      
      This also fixes the following warning reported by Neil Brown and
      Jeff Layton (among others).
      
      [634155.004438] WARNING:
      at /home/abuild/rpmbuild/BUILD/kernel-desktop-3.5.0/lin [634155.004442]
      Hardware name: Latitude E6510 [634155.004577]  crc_itu_t crc32c_intel
      snd_hwdep snd_pcm snd_timer snd soundcor [634155.004609] Pid: 13402, comm:
      bash Tainted: G        W    3.5.0-36-desktop # [634155.004611] Call Trace:
      [634155.004630]  [<ffffffff8100444a>] dump_trace+0xaa/0x2b0
      [634155.004641]  [<ffffffff815a23dc>] dump_stack+0x69/0x6f
      [634155.004653]  [<ffffffff81041a0b>] warn_slowpath_common+0x7b/0xc0
      [634155.004662]  [<ffffffff811832e4>] drop_nlink+0x34/0x40
      [634155.004687]  [<ffffffffa05bb6c3>] nfs_dentry_iput+0x33/0x70 [nfs]
      [634155.004714]  [<ffffffff8118049e>] dput+0x12e/0x230
      [634155.004726]  [<ffffffff8116b230>] __fput+0x170/0x230
      [634155.004735]  [<ffffffff81167c0f>] filp_close+0x5f/0x90
      [634155.004743]  [<ffffffff81167cd7>] sys_close+0x97/0x100
      [634155.004754]  [<ffffffff815c3b39>] system_call_fastpath+0x16/0x1b
      [634155.004767]  [<00007f2a73a0d110>] 0x7f2a73a0d10f
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9d53441a
    • NeilBrown's avatar
      NFS: avoid NULL dereference in nfs_destroy_server · 64b45c80
      NeilBrown authored
      commit f259613a upstream.
      
      In rare circumstances, nfs_clone_server() of a v2 or v3 server can get
      an error between setting server->destory (to nfs_destroy_server), and
      calling nfs_start_lockd (which will set server->nlm_host).
      
      If this happens, nfs_clone_server will call nfs_free_server which
      will call nfs_destroy_server and thence nlmclnt_done(NULL).  This
      causes the NULL to be dereferenced.
      
      So add a guard to only call nlmclnt_done() if ->nlm_host is not NULL.
      
      The other guards there are irrelevant as nlm_host can only be non-NULL
      if one of these flags are set - so remove those tests.  (Thanks to Trond
      for this suggestion).
      
      This is suitable for any stable kernel since 2.6.25.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      64b45c80
    • Rafael J. Wysocki's avatar
      ACPI / scan: Do not use dummy HID for system bus ACPI nodes · 611d6f03
      Rafael J. Wysocki authored
      commit 4f5f64cf upstream.
      
      At one point acpi_device_set_id() checks if acpi_device_hid(device)
      returns NULL, but that never happens, so system bus devices with an
      empty list of PNP IDs are given the dummy HID ("device") instead of
      the "system bus HID" ("LNXSYBUS").  Fix the code to use the right
      check.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      611d6f03