1. 22 Dec, 2014 40 commits
    • Benjamin Herrenschmidt's avatar
      PCI/MSI: Add device flag indicating that 64-bit MSIs don't work · b5bde69d
      Benjamin Herrenschmidt authored
      This can be set by quirks/drivers to be used by the architecture code
      that assigns the MSI addresses.
      
      We additionally add verification in the core MSI code that the values
      assigned by the architecture do satisfy the limitation in order to fail
      gracefully if they don't (ie. the arch hasn't been updated to deal with
      that quirk yet).
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: <stable@vger.kernel.org>
      Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      
      (cherry picked from commit f144d149)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      b5bde69d
    • Yinghai Lu's avatar
      PCI: Support 64-bit bridge windows if we have 64-bit dma_addr_t · 5f426e5a
      Yinghai Lu authored
      Aaron reported that a 32-bit x86 kernel with Physical Address Extension
      (PAE) support complains about bridge prefetchable memory windows above 4GB:
      
        pci_bus 0000:00: root bus resource [mem 0x380000000000-0x383fffffffff]
        ...
        pci 0000:03:00.0: reg 0x10: [mem 0x383fffc00000-0x383fffdfffff 64bit pref]
        pci 0000:03:00.0: reg 0x20: [mem 0x383fffe04000-0x383fffe07fff 64bit pref]
        pci 0000:03:00.1: reg 0x10: [mem 0x383fffa00000-0x383fffbfffff 64bit pref]
        pci 0000:03:00.1: reg 0x20: [mem 0x383fffe00000-0x383fffe03fff 64bit pref]
        pci 0000:00:02.2: PCI bridge to [bus 03-04]
        pci 0000:00:02.2:   bridge window [io  0x1000-0x1fff]
        pci 0000:00:02.2:   bridge window [mem 0x91900000-0x91cfffff]
        pci 0000:00:02.2: can't handle 64-bit address space for bridge
      
      In this kernel, unsigned long is 32 bits and dma_addr_t is 64 bits.
      Previously we used "unsigned long" to hold the bridge window address.  But
      this is a bus address, so we should use dma_addr_t instead.
      
      Use dma_addr_t to hold the bridge window base and limit.
      
      The question of whether the CPU can actually *address* the window is
      separate and depends on what the physical address space of the CPU is and
      whether the host bridge does any address translation.
      
      [bhelgaas: fix "shift count > width of type", changelog, stable tag]
      Fixes: d56dbf5b ("PCI: Allocate 64-bit BARs above 4G when possible")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=88131Reported-by: default avatarAaron Ma <mapengyu@gmail.com>
      Tested-by: default avatarAaron Ma <mapengyu@gmail.com>
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      CC: stable@vger.kernel.org	# v3.14+
      
      (cherry picked from commit 7fc986d8)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      5f426e5a
    • Andy Lutomirski's avatar
      x86_64, traps: Rework bad_iret · 9bfb2b55
      Andy Lutomirski authored
      commit b645af2d upstream.
      
      It's possible for iretq to userspace to fail.  This can happen because
      of a bad CS, SS, or RIP.
      
      Historically, we've handled it by fixing up an exception from iretq to
      land at bad_iret, which pretends that the failed iret frame was really
      the hardware part of #GP(0) from userspace.  To make this work, there's
      an extra fixup to fudge the gs base into a usable state.
      
      This is suboptimal because it loses the original exception.  It's also
      buggy because there's no guarantee that we were on the kernel stack to
      begin with.  For example, if the failing iret happened on return from an
      NMI, then we'll end up executing general_protection on the NMI stack.
      This is bad for several reasons, the most immediate of which is that
      general_protection, as a non-paranoid idtentry, will try to deliver
      signals and/or schedule from the wrong stack.
      
      This patch throws out bad_iret entirely.  As a replacement, it augments
      the existing swapgs fudge into a full-blown iret fixup, mostly written
      in C.  It's should be clearer and more correct.
      Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit fd2375c3)
      9bfb2b55
    • Quentin Casasnovas's avatar
      regmap: fix kernel hang on regmap_bulk_write with zero val_count. · 694d1bc3
      Quentin Casasnovas authored
      Fixes commit 2f06fa04 which was an
      incorrect backported version of commit
      d6b41cb0 upstream.
      
      If val_count is zero we return -EINVAL with map->lock_arg locked, which
      will deadlock the kernel next time we try to acquire this lock.
      
      This was introduced by f5942dd ("regmap: fix possible ZERO_SIZE_PTR pointer
      dereferencing error.") which improperly back-ported d6b41cb0.
      
      This issue was found during review of Ubuntu Trusty 3.13.0-40.68 kernel to
      prepare Ksplice rebootless updates.
      
      Fixes: f5942dd ("regmap: fix possible ZERO_SIZE_PTR pointer dereferencing error.")
      Signed-off-by: default avatarQuentin Casasnovas <quentin.casasnovas@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      (cherry picked from commit 197b3975)
      
      (cherry picked from commit HEAD)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      694d1bc3
    • bob picco's avatar
      sparc64: T5 PMU · dfb75c80
      bob picco authored
      The T5 (niagara5) has different PCR related HV fast trap values and a new
      HV API Group. This patch utilizes these and shares when possible with niagara4.
      
      We use the same sparc_pmu niagara4_pmu. Should there be new effort to
      obtain the MCU perf statistics then this would have to be changed.
      
      Cc: sparclinux@vger.kernel.org
      Signed-off-by: default avatarBob Picco <bob.picco@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit 05aa1651)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      dfb75c80
    • Xiubo Li's avatar
      regmap: fix possible ZERO_SIZE_PTR pointer dereferencing error. · 2540baeb
      Xiubo Li authored
      Since we cannot make sure the 'val_count' will always be none zero
      here, and then if it equals to zero, the kmemdup() will return
      ZERO_SIZE_PTR, which equals to ((void *)16).
      
      So this patch fix this with just doing the zero check before calling
      kmemdup().
      Signed-off-by: default avatarXiubo Li <Li.Xiubo@freescale.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit d6b41cb0)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      2540baeb
    • Bryan O'Donoghue's avatar
      usb: pch_udc: usb gadget device support for Intel Quark X1000 · 3538f3cd
      Bryan O'Donoghue authored
      This patch is to enable the USB gadget device for Intel Quark X1000
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@intel.com>
      Signed-off-by: default avatarBing Niu <bing.niu@intel.com>
      Signed-off-by: default avatarAlvin (Weike) Chen <alvin.chen@intel.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      
      (cherry picked from commit a68df706)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      3538f3cd
    • Takashi Iwai's avatar
      ALSA: usb-audio: Don't resubmit pending URBs at MIDI error recovery · 99575f8c
      Takashi Iwai authored
      In snd_usbmidi_error_timer(), the driver tries to resubmit MIDI input
      URBs to reactivate the MIDI stream, but this causes the error when
      some of URBs are still pending like:
      
       WARNING: CPU: 0 PID: 0 at ../drivers/usb/core/urb.c:339 usb_submit_urb+0x5f/0x70()
       URB ef705c40 submitted while active
       CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.16.6-2-desktop #1
       Hardware name: FOXCONN TPS01/TPS01, BIOS 080015  03/23/2010
        c0984bfa f4009ed4 c078deaf f4009ee4 c024c884 c09a135c f4009f00 00000000
        c0984bfa 00000153 c061ac4f c061ac4f 00000009 00000001 ef705c40 e854d1c0
        f4009eec c024c8d3 00000009 f4009ee4 c09a135c f4009f00 f4009f04 c061ac4f
       Call Trace:
        [<c0205df6>] try_stack_unwind+0x156/0x170
        [<c020482a>] dump_trace+0x5a/0x1b0
        [<c0205e56>] show_trace_log_lvl+0x46/0x50
        [<c02049d1>] show_stack_log_lvl+0x51/0xe0
        [<c0205eb7>] show_stack+0x27/0x50
        [<c078deaf>] dump_stack+0x45/0x65
        [<c024c884>] warn_slowpath_common+0x84/0xa0
        [<c024c8d3>] warn_slowpath_fmt+0x33/0x40
        [<c061ac4f>] usb_submit_urb+0x5f/0x70
        [<f7974104>] snd_usbmidi_submit_urb+0x14/0x60 [snd_usbmidi_lib]
        [<f797483a>] snd_usbmidi_error_timer+0x6a/0xa0 [snd_usbmidi_lib]
        [<c02570c0>] call_timer_fn+0x30/0x130
        [<c0257442>] run_timer_softirq+0x1c2/0x260
        [<c0251493>] __do_softirq+0xc3/0x270
        [<c0204732>] do_softirq_own_stack+0x22/0x30
        [<c025186d>] irq_exit+0x8d/0xa0
        [<c0795228>] smp_apic_timer_interrupt+0x38/0x50
        [<c0794a3c>] apic_timer_interrupt+0x34/0x3c
        [<c0673d9e>] cpuidle_enter_state+0x3e/0xd0
        [<c028bb8d>] cpu_idle_loop+0x29d/0x3e0
        [<c028bd23>] cpu_startup_entry+0x53/0x60
        [<c0bfac1e>] start_kernel+0x415/0x41a
      
      For avoiding these errors, check the pending URBs and skip
      resubmitting such ones.
      Reported-and-tested-by: default avatarStefan Seyfried <stefan.seyfried@googlemail.com>
      Acked-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      
      (cherry picked from commit 66139a48)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      99575f8c
    • Greg Kroah-Hartman's avatar
      Revert: ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC · 84108da6
      Greg Kroah-Hartman authored
      This reverts commit 2dbfff81, which
      really is commit 558e4736 upstream.
      
      Sorry for the confusion, this got applied twice, and reverted once, this
      is the second revert and I hope to never touch it again...
      Reported-by: default avatarLv Zheng <lv.zheng@intel.com>
      Cc: Alexander Mezin <mezin.alexander@gmail.com>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit 1c9e23ba)
      
      (cherry picked from commit HEAD)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      84108da6
    • Daniel Borkmann's avatar
      net: sctp: use MAX_HEADER for headroom reserve in output path · 5425d17e
      Daniel Borkmann authored
      To accomodate for enough headroom for tunnels, use MAX_HEADER instead
      of LL_MAX_HEADER. Robert reported that he has hit after roughly 40hrs
      of trinity an skb_under_panic() via SCTP output path (see reference).
      I couldn't reproduce it from here, but not using MAX_HEADER as elsewhere
      in other protocols might be one possible cause for this.
      
      In any case, it looks like accounting on chunks themself seems to look
      good as the skb already passed the SCTP output path and did not hit
      any skb_over_panic(). Given tunneling was enabled in his .config, the
      headroom would have been expanded by MAX_HEADER in this case.
      Reported-by: default avatarRobert Święcki <robert@swiecki.net>
      Reference: https://lkml.org/lkml/2014/12/1/507
      Fixes: 594ccc14 ("[SCTP] Replace incorrect use of dev_alloc_skb with alloc_skb in sctp_packet_transmit().")
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit 9772b54c)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      5425d17e
    • willy tarreau's avatar
      net: mvneta: fix Tx interrupt delay · b0f388bf
      willy tarreau authored
      The mvneta driver sets the amount of Tx coalesce packets to 16 by
      default. Normally that does not cause any trouble since the driver
      uses a much larger Tx ring size (532 packets). But some sockets
      might run with very small buffers, much smaller than the equivalent
      of 16 packets. This is what ping is doing for example, by setting
      SNDBUF to 324 bytes rounded up to 2kB by the kernel.
      
      The problem is that there is no documented method to force a specific
      packet to emit an interrupt (eg: the last of the ring) nor is it
      possible to make the NIC emit an interrupt after a given delay.
      
      In this case, it causes trouble, because when ping sends packets over
      its raw socket, the few first packets leave the system, and the first
      15 packets will be emitted without an IRQ being generated, so without
      the skbs being freed. And since the socket's buffer is small, there's
      no way to reach that amount of packets, and the ping ends up with
      "send: no buffer available" after sending 6 packets. Running with 3
      instances of ping in parallel is enough to hide the problem, because
      with 6 packets per instance, that's 18 packets total, which is enough
      to grant a Tx interrupt before all are sent.
      
      The original driver in the LSP kernel worked around this design flaw
      by using a software timer to clean up the Tx descriptors. This timer
      was slow and caused terrible network performance on some Tx-bound
      workloads (such as routing) but was enough to make tools like ping
      work correctly.
      
      Instead here, we simply set the packet counts before interrupt to 1.
      This ensures that each packet sent will produce an interrupt. NAPI
      takes care of coalescing interrupts since the interrupt is disabled
      once generated.
      
      No measurable performance impact nor CPU usage were observed on small
      nor large packets, including when saturating the link on Tx, and this
      fixes tools like ping which rely on too small a send buffer. If one
      wants to increase this value for certain workloads where it is safe
      to do so, "ethtool -C $dev tx-frames" will override this default
      setting.
      
      This fix needs to be applied to stable kernels starting with 3.10.
      Tested-By: default avatarMaggie Mae Roxas <maggie.mae.roxas@gmail.com>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit aebea2ba)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      b0f388bf
    • Jack Morgenstein's avatar
      net/mlx4_core: Limit count field to 24 bits in qp_alloc_res · a40e0996
      Jack Morgenstein authored
      Some VF drivers use the upper byte of "param1" (the qp count field)
      in mlx4_qp_reserve_range() to pass flags which are used to optimize
      the range allocation.
      
      Under the current code, if any of these flags are set, the 32-bit
      count field yields a count greater than 2^24, which is out of range,
      and this VF fails.
      
      As these flags represent a "best-effort" allocation hint anyway, they may
      safely be ignored. Therefore, the PF driver may simply mask out the bits.
      
      Fixes: c82e9aa0 "mlx4_core: resource tracking for HCA resources used by guests"
      Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit 2d5c57d7)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a40e0996
    • Thadeu Lima de Souza Cascardo's avatar
      tg3: fix ring init when there are more TX than RX channels · 217bacf2
      Thadeu Lima de Souza Cascardo authored
      If TX channels are set to 4 and RX channels are set to less than 4,
      using ethtool -L, the driver will try to initialize more RX channels
      than it has allocated, causing an oops.
      
      This fix only initializes the RX ring if it has been allocated.
      Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit a620a6bc)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      217bacf2
    • Yuri Chislov's avatar
      ipv6: gre: fix wrong skb->protocol in WCCP · c0263f56
      Yuri Chislov authored
      When using GRE redirection in WCCP, it sets the wrong skb->protocol,
      that is, ETH_P_IP instead of ETH_P_IPV6 for the encapuslated traffic.
      
      Fixes: c12b395a ("gre: Support GRE over IPv6")
      Cc: Dmitry Kozlov <xeb@mail.ru>
      Signed-off-by: default avatarYuri Chislov <yuri.chislov@gmail.com>
      Tested-by: default avatarYuri Chislov <yuri.chislov@gmail.com>
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit be6572fd)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c0263f56
    • Dmitry Torokhov's avatar
      sata_fsl: fix error handling of irq_of_parse_and_map · 1985f1c0
      Dmitry Torokhov authored
      irq_of_parse_and_map() returns 0 on error (the result is unsigned int),
      so testing for negative result never works.
      Signed-off-by: default avatarDmitry Torokhov <dtor@chromium.org>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit aad0b624)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      1985f1c0
    • Tejun Heo's avatar
      ahci: disable MSI on SAMSUNG 0xa800 SSD · e0d1dacd
      Tejun Heo authored
      Just like 0x1600 which got blacklisted by 66a7cbc3 ("ahci: disable
      MSI instead of NCQ on Samsung pci-e SSDs on macbooks"), 0xa800 chokes
      on NCQ commands if MSI is enabled.  Disable MSI.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarDominik Mierzejewski <dominik@greysector.net>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=89171
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 2b21ef0a)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      e0d1dacd
    • Devin Ryles's avatar
      AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller · 3284d5cc
      Devin Ryles authored
      This patch adds DeviceIDs for Sunrise Point-LP.
      Signed-off-by: default avatarDevin Ryles <devin.ryles@intel.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 249cd0a1)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      3284d5cc
    • Sakari Ailus's avatar
      media: smiapp: Only some selection targets are settable · f2987b0a
      Sakari Ailus authored
      commit b31eb901 upstream.
      
      Setting a non-settable selection target caused BUG() to be called. The check
      for valid selections only takes the selection target into account, but does
      not tell whether it may be set, or only get. Fix the issue by simply
      returning an error to the user.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit 6d6a8c0b)
      
      (cherry picked from commit HEAD)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      f2987b0a
    • Petr Mladek's avatar
      drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6 · afd2d465
      Petr Mladek authored
      I was unable too boot 3.18.0-rc6 because of the following kernel
      panic in drm_calc_vbltimestamp_from_scanoutpos():
      
          [drm] Initialized drm 1.1.0 20060810
          [drm] radeon kernel modesetting enabled.
          [drm] initializing kernel modesetting (RV100 0x1002:0x515E 0x15D9:0x8080).
          [drm] register mmio base: 0xC8400000
          [drm] register mmio size: 65536
          radeon 0000:0b:01.0: VRAM: 128M 0x00000000D0000000 - 0x00000000D7FFFFFF (16M used)
          radeon 0000:0b:01.0: GTT: 512M 0x00000000B0000000 - 0x00000000CFFFFFFF
          [drm] Detected VRAM RAM=128M, BAR=128M
          [drm] RAM width 16bits DDR
          [TTM] Zone  kernel: Available graphics memory: 3829346 kiB
          [TTM] Zone   dma32: Available graphics memory: 2097152 kiB
          [TTM] Initializing pool allocator
          [TTM] Initializing DMA pool allocator
          [drm] radeon: 16M of VRAM memory ready
          [drm] radeon: 512M of GTT memory ready.
          [drm] GART: num cpu pages 131072, num gpu pages 131072
          [drm] PCI GART of 512M enabled (table at 0x0000000037880000).
          radeon 0000:0b:01.0: WB disabled
          radeon 0000:0b:01.0: fence driver on ring 0 use gpu addr 0x00000000b0000000 and cpu addr 0xffff8800bbbfa000
          [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
          [drm] Driver supports precise vblank timestamp query.
          [drm] radeon: irq initialized.
          [drm] Loading R100 Microcode
          radeon 0000:0b:01.0: Direct firmware load for radeon/R100_cp.bin failed with error -2
          radeon_cp: Failed to load firmware "radeon/R100_cp.bin"
          [drm:r100_cp_init] *ERROR* Failed to load firmware!
          radeon 0000:0b:01.0: failed initializing CP (-2).
          radeon 0000:0b:01.0: Disabling GPU acceleration
          [drm] radeon: cp finalized
          BUG: unable to handle kernel NULL pointer dereference at 000000000000025c
          IP: [<ffffffff8150423b>] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
          PGD 0
          Oops: 0000 [#1] SMP
          Modules linked in:
          CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc6-4-default #2649
          Hardware name: Supermicro X7DB8/X7DB8, BIOS 6.00 07/26/2006
          task: ffff880234da2010 ti: ffff880234da4000 task.ti: ffff880234da4000
          RIP: 0010:[<ffffffff8150423b>]  [<ffffffff8150423b>] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
          RSP: 0000:ffff880234da7918  EFLAGS: 00010086
          RAX: ffffffff81557890 RBX: 0000000000000000 RCX: ffff880234da7a48
          RDX: ffff880234da79f4 RSI: 0000000000000000 RDI: ffff880232e15000
          RBP: ffff880234da79b8 R08: 0000000000000000 R09: 0000000000000000
          R10: 000000000000000a R11: 0000000000000001 R12: ffff880232dda1c0
          R13: ffff880232e1518c R14: 0000000000000292 R15: ffff880232e15000
          FS:  0000000000000000(0000) GS:ffff88023fc40000(0000) knlGS:0000000000000000
          CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
          CR2: 000000000000025c CR3: 0000000002014000 CR4: 00000000000007e0
          Stack:
           ffff880234da79d8 0000000000000286 ffff880232dcbc00 0000000000002480
           ffff880234da7958 0000000000000296 ffff880234da7998 ffffffff8151b51d
           ffff880234da7a48 0000000032dcbeb0 ffff880232dcbc00 ffff880232dcbc58
          Call Trace:
           [<ffffffff8151b51d>] ? drm_vma_offset_remove+0x1d/0x110
           [<ffffffff8152dc98>] radeon_get_vblank_timestamp_kms+0x38/0x60
           [<ffffffff8152076a>] ? ttm_bo_release_list+0xba/0x180
           [<ffffffff81503751>] drm_get_last_vbltimestamp+0x41/0x70
           [<ffffffff81503933>] vblank_disable_and_save+0x73/0x1d0
           [<ffffffff81106b2f>] ? try_to_del_timer_sync+0x4f/0x70
           [<ffffffff81505245>] drm_vblank_cleanup+0x65/0xa0
           [<ffffffff815604fa>] radeon_irq_kms_fini+0x1a/0x70
           [<ffffffff8156c07e>] r100_init+0x26e/0x410
           [<ffffffff8152ae3e>] radeon_device_init+0x7ae/0xb50
           [<ffffffff8152d57f>] radeon_driver_load_kms+0x8f/0x210
           [<ffffffff81506965>] drm_dev_register+0xb5/0x110
           [<ffffffff8150998f>] drm_get_pci_dev+0x8f/0x200
           [<ffffffff815291cd>] radeon_pci_probe+0xad/0xe0
           [<ffffffff8141a365>] local_pci_probe+0x45/0xa0
           [<ffffffff8141b741>] pci_device_probe+0xd1/0x130
           [<ffffffff81633dad>] driver_probe_device+0x12d/0x3e0
           [<ffffffff8163413b>] __driver_attach+0x9b/0xa0
           [<ffffffff816340a0>] ? __device_attach+0x40/0x40
           [<ffffffff81631cd3>] bus_for_each_dev+0x63/0xa0
           [<ffffffff8163378e>] driver_attach+0x1e/0x20
           [<ffffffff81633390>] bus_add_driver+0x180/0x240
           [<ffffffff81634914>] driver_register+0x64/0xf0
           [<ffffffff81419cac>] __pci_register_driver+0x4c/0x50
           [<ffffffff81509bf5>] drm_pci_init+0xf5/0x120
           [<ffffffff821dc871>] ? ttm_init+0x6a/0x6a
           [<ffffffff821dc908>] radeon_init+0x97/0xb5
           [<ffffffff810002fc>] do_one_initcall+0xbc/0x1f0
           [<ffffffff810e3278>] ? __wake_up+0x48/0x60
           [<ffffffff8218e256>] kernel_init_freeable+0x18a/0x215
           [<ffffffff8218d983>] ? initcall_blacklist+0xc0/0xc0
           [<ffffffff818a78f0>] ? rest_init+0x80/0x80
           [<ffffffff818a78fe>] kernel_init+0xe/0xf0
           [<ffffffff818c0c3c>] ret_from_fork+0x7c/0xb0
           [<ffffffff818a78f0>] ? rest_init+0x80/0x80
          Code: 45 ac 0f 88 a8 01 00 00 3b b7 d0 01 00 00 49 89 ff 0f 83 99 01 00 00 48 8b 47 20 48 8b 80 88 00 00 00 48 85 c0 0f 84 cd 01 00 00 <41> 8b b1 5c 02 00 00 41 8b 89 58 02 00 00 89 75 98 41 8b b1 60
          RIP  [<ffffffff8150423b>] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
           RSP <ffff880234da7918>
          CR2: 000000000000025c
          ---[ end trace ad2c0aadf48e2032 ]---
          Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
      
      It has helped me to add a NULL pointer check that was suggested at
      http://lists.freedesktop.org/archives/dri-devel/2014-October/070663.html
      
      I am not familiar with the code. But the change looks sane
      and we need something fast at this stage of 3.18 development.
      Suggested-by: default avatarHelge Deller <deller@gmx.de>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.cz>
      Tested-by: default avatarPetr Mladek <pmladek@suse.cz>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit f5475cc4)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      afd2d465
    • Grygorii Strashko's avatar
      i2c: davinci: generate STP always when NACK is received · a09ee434
      Grygorii Strashko authored
      According to I2C specification the NACK should be handled as follows:
      "When SDA remains HIGH during this ninth clock pulse, this is defined as the Not
      Acknowledge signal. The master can then generate either a STOP condition to
      abort the transfer, or a repeated START condition to start a new transfer."
      [I2C spec Rev. 6, 3.1.6: http://www.nxp.com/documents/user_manual/UM10204.pdf]
      
      Currently the Davinci i2c driver interrupts the transfer on receipt of a
      NACK but fails to send a STOP in some situations and so makes the bus
      stuck until next I2C IP reset (idle/enable).
      
      For example, the issue will happen during SMBus read transfer which
      consists from two i2c messages write command/address and read data:
      
      S Slave Address Wr A Command Code A Sr Slave Address Rd A D1..Dn A P
      <--- write -----------------------> <--- read --------------------->
      
      The I2C client device will send NACK if it can't recognize "Command Code"
      and it's expected from I2C master to generate STP in this case.
      But now, Davinci i2C driver will just exit with -EREMOTEIO and STP will
      not be generated.
      
      Hence, fix it by generating Stop condition (STP) always when NACK is received.
      
      This patch fixes Davinci I2C in the same way it was done for OMAP I2C
      commit cda2109a ("i2c: omap: query STP always when NACK is received").
      Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Reported-by: default avatarHein Tibosch <hein_tibosch@yahoo.es>
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      Cc: stable@kernel.org
      
      (cherry picked from commit 9ea359f7)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a09ee434
    • Alexander Kochetkov's avatar
      i2c: omap: fix i207 errata handling · 480fff6b
      Alexander Kochetkov authored
      commit 6d9939f6 (i2c: omap: split out [XR]DR
      and [XR]RDY) changed the way how errata i207 (I2C: RDR Flag May Be Incorrectly
      Set) get handled. 6d9939f6 code doesn't correspond to workaround provided by
      errata.
      
      According to errata ISR must filter out spurious RDR before data read not after.
      ISR must read RXSTAT to get number of bytes available to read. Because RDR
      could be set while there could no data in the receive FIFO.
      
      Restored pre 6d9939f6 way of handling errata.
      
      Found by code review. Real impact haven't seen.
      Tested on Beagleboard XM C.
      Signed-off-by: default avatarAlexander Kochetkov <al.kochet@gmail.com>
      Fixes: 6d9939f6 i2c: omap: split out [XR]DR and [XR]RDY
      Tested-by: default avatarFelipe Balbi <balbi@ti.com>
      Reviewed-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      
      (cherry picked from commit ccfc8663)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      480fff6b
    • Alexander Kochetkov's avatar
      i2c: omap: fix NACK and Arbitration Lost irq handling · c53ec9a4
      Alexander Kochetkov authored
      commit 1d7afc95 (i2c: omap: ack IRQ in parts)
      changed the interrupt handler to complete transfers without clearing
      XRDY (AL case) and ARDY (NACK case) flags. XRDY or ARDY interrupts will be
      fired again. As a result, ISR keep processing transfer after it was already
      complete (from the driver code point of view).
      
      A didn't see real impacts of the 1d7afc95, but it is really bad idea to
      have ISR running on user data after transfer was complete.
      
      It looks, what 1d7afc95 violate TI specs in what how AL and NACK should be
      handled (see Note 1, sprugn4r, Figure 17-31 and Figure 17-32).
      
      According to specs (if I understood correctly), in case of NACK and AL driver
      must reset NACK, AL, ARDY, RDR, and RRDY (Master Receive Mode), and
      NACK, AL, ARDY, and XDR (Master Transmitter Mode).
      
      All that is done down the code under the if condition:
      if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) ...
      
      The patch restore pre 1d7afc95 logic of handling NACK and AL interrupts, so
      no interrupts is fired after ISR informs the rest of driver what transfer
      complete.
      
      Note: instead of removing break under NACK case, we could just replace 'break'
      with 'continue' and allow NACK transfer to finish using ARDY event. I found
      that NACK and ARDY bits usually set together. That case confirm TI wiki:
      http://processors.wiki.ti.com/index.php/I2C_Tips#Detecting_and_handling_NACK
      
      In order if someone interested in the event traces for NACK and AL cases,
      I sent them to mailing list.
      
      Tested on Beagleboard XM C.
      Signed-off-by: default avatarAlexander Kochetkov <al.kochet@gmail.com>
      Fixes: 1d7afc95 i2c: omap: ack IRQ in parts
      Cc: <stable@vger.kernel.org> # v3.7+
      Acked-by: default avatarFelipe Balbi <balbi@ti.com>
      Tested-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      
      (cherry picked from commit 27caca9d)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c53ec9a4
    • Seth Forshee's avatar
      xen-netfront: Remove BUGs on paged skb data which crosses a page boundary · cd9d6ef1
      Seth Forshee authored
      These BUGs can be erroneously triggered by frags which refer to
      tail pages within a compound page. The data in these pages may
      overrun the hardware page while still being contained within the
      compound page, but since compound_order() evaluates to 0 for tail
      pages the assertion fails. The code already iterates through
      subsequent pages correctly in this scenario, so the BUGs are
      unnecessary and can be removed.
      
      Fixes: f36c3747 ("xen/netfront: handle compound page fragments on transmit")
      Cc: <stable@vger.kernel.org> # 3.7+
      Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
      Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit 8d609725)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      cd9d6ef1
    • Daniel Forrest's avatar
      mm: fix anon_vma_clone() error treatment · 0bf43074
      Daniel Forrest authored
      Andrew Morton noticed that the error return from anon_vma_clone() was
      being dropped and replaced with -ENOMEM (which is not itself a bug
      because the only error return value from anon_vma_clone() is -ENOMEM).
      
      I did an audit of callers of anon_vma_clone() and discovered an actual
      bug where the error return was being lost.  In __split_vma(), between
      Linux 3.11 and 3.12 the code was changed so the err variable is used
      before the call to anon_vma_clone() and the default initial value of
      -ENOMEM is overwritten.  So a failure of anon_vma_clone() will return
      success since err at this point is now zero.
      
      Below is a patch which fixes this bug and also propagates the error
      return value from anon_vma_clone() in all cases.
      
      Fixes: ef0855d3 ("mm: mempolicy: turn vma_set_policy() into vma_dup_policy()")
      Signed-off-by: default avatarDaniel Forrest <dan.forrest@ssec.wisc.edu>
      Reviewed-by: default avatarMichal Hocko <mhocko@suse.cz>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Tim Hartrick <tim@edgecast.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: <stable@vger.kernel.org>	[3.12+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      
      (cherry picked from commit c4ea95d7)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      0bf43074
    • Hugh Dickins's avatar
      mm: fix swapoff hang after page migration and fork · 69e2b30b
      Hugh Dickins authored
      I've been seeing swapoff hangs in recent testing: it's cycling around
      trying unsuccessfully to find an mm for some remaining pages of swap.
      
      I have been exercising swap and page migration more heavily recently,
      and now notice a long-standing error in copy_one_pte(): it's trying to
      add dst_mm to swapoff's mmlist when it finds a swap entry, but is doing
      so even when it's a migration entry or an hwpoison entry.
      
      Which wouldn't matter much, except it adds dst_mm next to src_mm,
      assuming src_mm is already on the mmlist: which may not be so.  Then if
      pages are later swapped out from dst_mm, swapoff won't be able to find
      where to replace them.
      
      There's already a !non_swap_entry() test for stats: move that up before
      the swap_duplicate() and the addition to mmlist.
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Cc: Kelley Nielsen <kelleynnn@gmail.com>
      Cc: <stable@vger.kernel.org>	[2.6.18+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      
      (cherry picked from commit 2022b4d1)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      69e2b30b
    • Al Viro's avatar
      fat: fix oops on corrupted vfat fs · 67cfa640
      Al Viro authored
      a) don't bother with ->d_time for positives - we only check it for
         negatives anyway.
      
      b) make sure to set it at unlink and rmdir time - at *that* point
         soon-to-be negative dentry matches then-current directory contents
      
      c) don't go into renaming of old alias in vfat_lookup() unless it
         has the same parent (which it will, unless we are seeing corrupted
         image)
      
      [hirofumi@mail.parknet.co.jp: make change minimum, don't call d_move() for dir]
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: <stable@vger.kernel.org>	[3.17.x]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      
      (cherry picked from commit 1ead0e79)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      67cfa640
    • Andrew Morton's avatar
      drivers/input/evdev.c: don't kfree() a vmalloc address · 8b1c1891
      Andrew Morton authored
      If kzalloc() failed and then evdev_open_device() fails, evdev_open()
      will pass a vmalloc'ed pointer to kfree.
      
      This might fix https://bugzilla.kernel.org/show_bug.cgi?id=88401, where
      there was a crash in kfree().
      Reported-by: default avatarChristian Casteyde <casteyde.christian@free.fr>
      Belatedly-Acked-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Henrik Rydberg <rydberg@euromail.se>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      
      (cherry picked from commit 92788ac1)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8b1c1891
    • Weijie Yang's avatar
      mm: frontswap: invalidate expired data on a dup-store failure · f619cda6
      Weijie Yang authored
      If a frontswap dup-store failed, it should invalidate the expired page
      in the backend, or it could trigger some data corruption issue.
      Such as:
       1. use zswap as the frontswap backend with writeback feature
       2. store a swap page(version_1) to entry A, success
       3. dup-store a newer page(version_2) to the same entry A, fail
       4. use __swap_writepage() write version_2 page to swapfile, success
       5. zswap do shrink, writeback version_1 page to swapfile
       6. version_2 page is overwrited by version_1, data corrupt.
      
      This patch fixes this issue by invalidating expired data immediately
      when meet a dup-store failure.
      Signed-off-by: default avatarWeijie Yang <weijie.yang@samsung.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Seth Jennings <sjennings@variantweb.net>
      Cc: Dan Streetman <ddstreet@ieee.org>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Bob Liu <bob.liu@oracle.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      
      (cherry picked from commit fb993fa1)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      f619cda6
    • Benjamin Herrenschmidt's avatar
      gpu/radeon: Set flag to indicate broken 64-bit MSI · 4effb214
      Benjamin Herrenschmidt authored
      Some radeon ASICs don't support all 64 address bits of MSIs despite
      advertising support for 64-bit MSIs in their configuration space.
      
      This breaks on systems such as IBM POWER7/8, where 64-bit MSIs can
      be assigned with some of the high address bits set.
      
      This makes use of the newly introduced "no_64bit_msi" flag in structure
      pci_dev to allow the MSI allocation code to fallback to 32-bit MSIs
      on those adapters.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      CC: <stable@vger.kernel.org>
      ---
      
      Adding Alex's review tag. Patch to the driver is identical to the
      reviewed one, I dropped the arch/powerpc hunk rewrote the subject
      and cset comment.
      
      (cherry picked from commit 91ed6fd2)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      4effb214
    • Maurizio Lombardi's avatar
      bnx2fc: do not add shared skbs to the fcoe_rx_list · bba941f7
      Maurizio Lombardi authored
      In some cases, the fcoe_rx_list may contains multiple instances
      of the same skb (the so called "shared skbs").
      
      the bnx2fc_l2_rcv thread is a loop that extracts a skb from the list,
      modifies (and destroys) its content and then proceed to the next one.
      The problem is that if the skb is shared, the remaining instances will
      be corrupted.
      
      The solution is to use skb_share_check() before adding the skb to the
      fcoe_rx_list.
      
      [ 6286.808725] ------------[ cut here ]------------
      [ 6286.808729] WARNING: at include/scsi/fc_frame.h:173 bnx2fc_l2_rcv_thread+0x425/0x450 [bnx2fc]()
      [ 6286.808748] Modules linked in: bnx2x(-) mdio dm_service_time bnx2fc cnic uio fcoe libfcoe 8021q garp stp mrp libfc llc scsi_transport_fc scsi_tgt sg iTCO_wdt iTCO_vendor_support coretemp kvm_intel kvm crct10dif_pclmul crc32_pclmul crc32c_intel e1000e ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper ptp cryptd hpilo serio_raw hpwdt lpc_ich pps_core ipmi_si pcspkr mfd_core ipmi_msghandler shpchp pcc_cpufreq mperf nfsd auth_rpcgss nfs_acl lockd sunrpc dm_multipath xfs libcrc32c ata_generic pata_acpi sd_mod crc_t10dif crct10dif_common mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit ata_piix drm_kms_helper ttm drm libata i2c_core hpsa dm_mirror dm_region_hash dm_log dm_mod [last unloaded: mdio]
      [ 6286.808750] CPU: 3 PID: 1304 Comm: bnx2fc_l2_threa Not tainted 3.10.0-121.el7.x86_64 #1
      [ 6286.808750] Hardware name: HP ProLiant DL120 G7, BIOS J01 07/01/2013
      [ 6286.808752]  0000000000000000 000000000b36e715 ffff8800deba1e00 ffffffff815ec0ba
      [ 6286.808753]  ffff8800deba1e38 ffffffff8105dee1 ffffffffa05618c0 ffff8801e4c81888
      [ 6286.808754]  ffffe8ffff663868 ffff8801f402b180 ffff8801f56bc000 ffff8800deba1e48
      [ 6286.808754] Call Trace:
      [ 6286.808759]  [<ffffffff815ec0ba>] dump_stack+0x19/0x1b
      [ 6286.808762]  [<ffffffff8105dee1>] warn_slowpath_common+0x61/0x80
      [ 6286.808763]  [<ffffffff8105e00a>] warn_slowpath_null+0x1a/0x20
      [ 6286.808765]  [<ffffffffa054f415>] bnx2fc_l2_rcv_thread+0x425/0x450 [bnx2fc]
      [ 6286.808767]  [<ffffffffa054eff0>] ? bnx2fc_disable+0x90/0x90 [bnx2fc]
      [ 6286.808769]  [<ffffffff81085aef>] kthread+0xcf/0xe0
      [ 6286.808770]  [<ffffffff81085a20>] ? kthread_create_on_node+0x140/0x140
      [ 6286.808772]  [<ffffffff815fc76c>] ret_from_fork+0x7c/0xb0
      [ 6286.808773]  [<ffffffff81085a20>] ? kthread_create_on_node+0x140/0x140
      [ 6286.808774] ---[ end trace c6cdb939184ccb4e ]---
      Signed-off-by: default avatarMaurizio Lombardi <mlombard@redhat.com>
      Acked-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 01a4cc4d)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      bba941f7
    • Trond Myklebust's avatar
      nfsd: Fix slot wake up race in the nfsv4.1 callback code · f754efef
      Trond Myklebust authored
      The currect code for nfsd41_cb_get_slot() and nfsd4_cb_done() has no
      locking in order to guarantee atomicity, and so allows for races of
      the form.
      
      Task 1                                  Task 2
      ======                                  ======
      if (test_and_set_bit(0) != 0) {
                                              clear_bit(0)
                                              rpc_wake_up_next(queue)
              rpc_sleep_on(queue)
              return false;
      }
      
      This patch breaks the race condition by adding a retest of the bit
      after the call to rpc_sleep_on().
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      (cherry picked from commit c6c15e1e)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      f754efef
    • Stanislaw Gruszka's avatar
      rt2x00: do not align payload on modern H/W · 19c58f10
      Stanislaw Gruszka authored
      RT2800 and newer hardware require padding between header and payload if
      header length is not multiple of 4.
      
      For historical reasons we also align payload to to 4 bytes boundary, but
      such alignment is not needed on modern H/W.
      
      Patch fixes skb_under_panic problems reported from time to time:
      
      https://bugzilla.kernel.org/show_bug.cgi?id=84911
      https://bugzilla.kernel.org/show_bug.cgi?id=72471
      http://marc.info/?l=linux-wireless&m=139108549530402&w=2
      https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1087591
      
      Panic happened because we eat 4 bytes of skb headroom on each
      (re)transmission when sending frame without the payload and the header
      length not being multiple of 4 (i.e. QoS header has 26 bytes). On such
      case because paylad_aling=2 is bigger than header_align=0 we increase
      header_align by 4 bytes. To prevent that we could change the check to:
      
      	if (payload_length && payload_align > header_align)
      		header_align += 4;
      
      but not aligning payload at all is more effective and alignment is not
      really needed by H/W (that has been tested on OpenWrt project for few
      years now).
      Reported-and-tested-by: default avatarAntti S. Lankila <alankila@bel.fi>
      Debugged-by: default avatarAntti S. Lankila <alankila@bel.fi>
      Reported-by: default avatarHenrik Asp <solenskiner@gmail.com>
      Originally-From: Helmut Schaa <helmut.schaa@googlemail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      
      (cherry picked from commit cfd9167a)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      19c58f10
    • Thomas Körper's avatar
      can: dev: avoid calling kfree_skb() from interrupt context · 4ff391a6
      Thomas Körper authored
      ikfree_skb() is Called in can_free_echo_skb(), which might be called from (TX
      Error) interrupt, which triggers the folloing warning:
      
      [ 1153.360705] ------------[ cut here ]------------
      [ 1153.360715] WARNING: CPU: 0 PID: 31 at net/core/skbuff.c:563 skb_release_head_state+0xb9/0xd0()
      [ 1153.360772] Call Trace:
      [ 1153.360778]  [<c167906f>] dump_stack+0x41/0x52
      [ 1153.360782]  [<c105bb7e>] warn_slowpath_common+0x7e/0xa0
      [ 1153.360784]  [<c158b909>] ? skb_release_head_state+0xb9/0xd0
      [ 1153.360786]  [<c158b909>] ? skb_release_head_state+0xb9/0xd0
      [ 1153.360788]  [<c105bc42>] warn_slowpath_null+0x22/0x30
      [ 1153.360791]  [<c158b909>] skb_release_head_state+0xb9/0xd0
      [ 1153.360793]  [<c158be90>] skb_release_all+0x10/0x30
      [ 1153.360795]  [<c158bf06>] kfree_skb+0x36/0x80
      [ 1153.360799]  [<f8486938>] ? can_free_echo_skb+0x28/0x40 [can_dev]
      [ 1153.360802]  [<f8486938>] can_free_echo_skb+0x28/0x40 [can_dev]
      [ 1153.360805]  [<f849a12c>] esd_pci402_interrupt+0x34c/0x57a [esd402]
      [ 1153.360809]  [<c10a75b5>] handle_irq_event_percpu+0x35/0x180
      [ 1153.360811]  [<c10a7623>] ? handle_irq_event_percpu+0xa3/0x180
      [ 1153.360813]  [<c10a7731>] handle_irq_event+0x31/0x50
      [ 1153.360816]  [<c10a9c7f>] handle_fasteoi_irq+0x6f/0x120
      [ 1153.360818]  [<c10a9c10>] ? handle_edge_irq+0x110/0x110
      [ 1153.360822]  [<c1011b61>] handle_irq+0x71/0x90
      [ 1153.360823]  <IRQ>  [<c168152c>] do_IRQ+0x3c/0xd0
      [ 1153.360829]  [<c1680b6c>] common_interrupt+0x2c/0x34
      [ 1153.360834]  [<c107d277>] ? finish_task_switch+0x47/0xf0
      [ 1153.360836]  [<c167c27b>] __schedule+0x35b/0x7e0
      [ 1153.360839]  [<c10a5334>] ? console_unlock+0x2c4/0x4d0
      [ 1153.360842]  [<c13df500>] ? n_tty_receive_buf_common+0x890/0x890
      [ 1153.360845]  [<c10707b6>] ? process_one_work+0x196/0x370
      [ 1153.360847]  [<c167c723>] schedule+0x23/0x60
      [ 1153.360849]  [<c1070de1>] worker_thread+0x161/0x460
      [ 1153.360852]  [<c1090fcf>] ? __wake_up_locked+0x1f/0x30
      [ 1153.360854]  [<c1070c80>] ? rescuer_thread+0x2f0/0x2f0
      [ 1153.360856]  [<c1074f01>] kthread+0xa1/0xc0
      [ 1153.360859]  [<c1680401>] ret_from_kernel_thread+0x21/0x30
      [ 1153.360861]  [<c1074e60>] ? kthread_create_on_node+0x110/0x110
      [ 1153.360863] ---[ end trace 5ff83639cbb74b35 ]---
      
      This patch replaces the kfree_skb() by dev_kfree_skb_any().
      Signed-off-by: default avatarThomas Körper <thomas.koerper@esd.eu>
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      
      (cherry picked from commit 5247a589)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      4ff391a6
    • Christian Sünkenberg's avatar
      scsi: add Intel Multi-Flex to scsi scan blacklist · 83bb066c
      Christian Sünkenberg authored
      Intel Multi-Flex LUNs choke on REPORT SUPPORTED OPERATION CODES
      resulting in sd_mod hanging for several minutes on startup.
      The issue was introduced with WRITE SAME discovery heuristics.
      
      Fixes: 5db44863 ("[SCSI] sd: Implement support for WRITE SAME")
      Signed-off-by: default avatarChristian Sünkenberg <christian.suenkenberg@hfg-karlsruhe.de>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 18990455)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      83bb066c
    • Thor Thayer's avatar
      spi: dw: Fix dynamic speed change. · 179eb5a7
      Thor Thayer authored
      An IOCTL call that calls spi_setup() and then dw_spi_setup() will
      overwrite the persisted last transfer speed. On each transfer, the
      SPI speed is compared to the last transfer speed to determine if the
      clock divider registers need to be updated (did the speed change?).
      This bug was observed with the spidev driver using spi-config to
      update the max transfer speed.
      
      This fix: Don't overwrite the persisted last transaction clock speed
      when updating the SPI parameters in dw_spi_setup(). On the next
      transaction, the new speed won't match the persisted last speed
      and the hardware registers will be updated.
      On initialization, the persisted last transaction clock
      speed will be 0 but will be updated after the first SPI
      transaction.
      
      Move zeroed clock divider check into clock change test because
      chip->clk_div is zero on startup and would cause a divide-by-zero
      error. The calculation was wrong as well (can't support odd #).
      Reported-by: default avatarVlastimil Setka <setka@vsis.cz>
      Signed-off-by: default avatarVlastimil Setka <setka@vsis.cz>
      Signed-off-by: default avatarThor Thayer <tthayer@opensource.altera.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 0a8727e6)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      179eb5a7
    • Roland Dreier's avatar
      target: Don't call TFO->write_pending if data_length == 0 · b0e05292
      Roland Dreier authored
      If an initiator sends a zero-length command (e.g. TEST UNIT READY) but
      sets the transfer direction in the transport layer to indicate a
      data-out phase, we still shouldn't try to transfer data.  At best it's
      a NOP, and depending on the transport, we might crash on an
      uninitialized sg list.
      Reported-by: default avatarCraig Watson <craig.watson@vanguard-rugged.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Cc: <stable@vger.kernel.org> # 3.1
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      
      (cherry picked from commit 885e7b0e)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      b0e05292
    • Bart Van Assche's avatar
      srp-target: Retry when QP creation fails with ENOMEM · def2b911
      Bart Van Assche authored
      It is not guaranteed to that srp_sq_size is supported
      by the HCA. So if we failed to create the QP with ENOMEM,
      try with a smaller srp_sq_size. Keep it up until we hit
      MIN_SRPT_SQ_SIZE, then fail the connection.
      Reported-by: default avatarMark Lehrer <lehrer@gmail.com>
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
      Cc: <stable@vger.kernel.org> # 3.4+
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      
      (cherry picked from commit ab477c1f)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      def2b911
    • Greg Kroah-Hartman's avatar
      Input: xpad - use proper endpoint type · af403fb3
      Greg Kroah-Hartman authored
      The xpad wireless endpoint is not a bulk endpoint on my devices, but
      rather an interrupt one, so the USB core complains when it is submitted.
      I'm guessing that the author really did mean that this should be an
      interrupt urb, but as there are a zillion different xpad devices out
      there, let's cover out bases and handle both bulk and interrupt
      endpoints just as easily.
      Signed-off-by: default avatar"Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      
      (cherry picked from commit a1f9a407)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      af403fb3
    • Thomas Petazzoni's avatar
      ARM: 8222/1: mvebu: enable strex backoff delay · cff1f73b
      Thomas Petazzoni authored
      Under extremely rare conditions, in an MPCore node consisting of at
      least 3 CPUs, two CPUs trying to perform a STREX to data on the same
      shared cache line can enter a livelock situation.
      
      This patch enables the HW mechanism that overcomes the bug. This fixes
      the incorrect setup of the STREX backoff delay bit due to a wrong
      description in the specification.
      
      Note that enabling the STREX backoff delay mechanism is done by
      leaving the bit *cleared*, while the bit was currently being set by
      the proc-v7.S code.
      
      [Thomas: adapt to latest mainline, slightly reword the commit log, add
      stable markers.]
      
      Fixes: de490193 ("arm: mm: Add support for PJ4B cpu and init routines")
      
      Cc: <stable@vger.kernel.org> # v3.8+
      Signed-off-by: default avatarNadav Haklai <nadavh@marvell.com>
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Acked-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
      Acked-by: default avatarJason Cooper <jason@lakedaemon.net>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      
      (cherry picked from commit 995ab518)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      cff1f73b
    • Dmitry Eremin-Solenikov's avatar
      ARM: 8216/1: xscale: correct auxiliary register in suspend/resume · a7105c3c
      Dmitry Eremin-Solenikov authored
      According to the manuals I have, XScale auxiliary register should be
      reached with opc_2 = 1 instead of crn = 1. cpu_xscale_proc_init
      correctly uses c1, c0, 1 arguments, but cpu_xscale_do_suspend and
      cpu_xscale_do_resume use c1, c1, 0. Correct suspend/resume functions to
      also use c1, c0, 1.
      
      The issue was primarily noticed thanks to qemu reporing "unsupported
      instruction" on the pxa suspend path. Confirmed in PXA210/250 and PXA255
      XScale Core manuals and in PXA270 and PXA320 Developers Guides.
      
      Harware tested by me on tosa (pxa255). Robert confirmed on pxa270 board.
      Tested-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Acked-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      
      (cherry picked from commit ef59a20b)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a7105c3c