1. 26 Feb, 2014 5 commits
    • Geert Uytterhoeven's avatar
      ipv4: Fix runtime WARNING in rtmsg_ifa() · 0c360776
      Geert Uytterhoeven authored
      [ Upstream commit 63b5f152 ]
      
      On m68k/ARAnyM:
      
      WARNING: CPU: 0 PID: 407 at net/ipv4/devinet.c:1599 0x316a99()
      Modules linked in:
      CPU: 0 PID: 407 Comm: ifconfig Not tainted
      3.13.0-atari-09263-g0c71d68014d1 #1378
      Stack from 10c4fdf0:
              10c4fdf0 002ffabb 000243e8 00000000 008ced6c 00024416 00316a99 0000063f
              00316a99 00000009 00000000 002501b4 00316a99 0000063f c0a86117 00000080
              c0a86117 00ad0c90 00250a5a 00000014 00ad0c90 00000000 00000000 00000001
              00b02dd0 00356594 00000000 00356594 c0a86117 eff6c9e4 008ced6c 00000002
              008ced60 0024f9b4 00250b52 00ad0c90 00000000 00000000 00252390 00ad0c90
              eff6c9e4 0000004f 00000000 00000000 eff6c9e4 8000e25c eff6c9e4 80001020
      Call Trace: [<000243e8>] warn_slowpath_common+0x52/0x6c
       [<00024416>] warn_slowpath_null+0x14/0x1a
       [<002501b4>] rtmsg_ifa+0xdc/0xf0
       [<00250a5a>] __inet_insert_ifa+0xd6/0x1c2
       [<0024f9b4>] inet_abc_len+0x0/0x42
       [<00250b52>] inet_insert_ifa+0xc/0x12
       [<00252390>] devinet_ioctl+0x2ae/0x5d6
      
      Adding some debugging code reveals that net_fill_ifaddr() fails in
      
          put_cacheinfo(skb, ifa->ifa_cstamp, ifa->ifa_tstamp,
                                    preferred, valid))
      
      nla_put complains:
      
          lib/nlattr.c:454: skb_tailroom(skb) = 12, nla_total_size(attrlen) = 20
      
      Apparently commit 5c766d64 ("ipv4:
      introduce address lifetime") forgot to take into account the addition of
      struct ifa_cacheinfo in inet_nlmsg_size(). Hence add it, like is already
      done for ipv6.
      Suggested-by: default avatarCong Wang <cwang@twopensource.com>
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarCong Wang <cwang@twopensource.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      0c360776
    • Oliver Hartkopp's avatar
      can: add destructor for self generated skbs · b3097b17
      Oliver Hartkopp authored
      [ Upstream commit 0ae89beb ]
      
      Self generated skbuffs in net/can/bcm.c are setting a skb->sk reference but
      no explicit destructor which is enforced since Linux 3.11 with commit
      376c7311 (net: add a temporary sanity check in skb_orphan()).
      
      This patch adds some helper functions to make sure that a destructor is
      properly defined when a sock reference is assigned to a CAN related skb.
      To create an unshared skb owned by the original sock a common helper function
      has been introduced to replace open coded functions to create CAN echo skbs.
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Tested-by: default avatarAndre Naujoks <nautsch2@gmail.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      b3097b17
    • Cong Wang's avatar
      bridge: fix netconsole setup over bridge · d7691e10
      Cong Wang authored
      [ Upstream commit dbe17307 ]
      
      Commit 93d8bf9f ("bridge: cleanup netpoll code") introduced
      a check in br_netpoll_enable(), but this check is incorrect for
      br_netpoll_setup(). This patch moves the code after the check
      into __br_netpoll_enable() and calls it in br_netpoll_setup().
      For br_add_if(), the check is still needed.
      
      Fixes: 93d8bf9f ("bridge: cleanup netpoll code")
      Cc: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarCong Wang <cwang@twopensource.com>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: default avatarToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Tested-by: default avatarToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      d7691e10
    • Richard Yao's avatar
      9p/trans_virtio.c: Fix broken zero-copy on vmalloc() buffers · ef9daf83
      Richard Yao authored
      [ Upstream commit b6f52ae2 ]
      
      The 9p-virtio transport does zero copy on things larger than 1024 bytes
      in size. It accomplishes this by returning the physical addresses of
      pages to the virtio-pci device. At present, the translation is usually a
      bit shift.
      
      That approach produces an invalid page address when we read/write to
      vmalloc buffers, such as those used for Linux kernel modules. Any
      attempt to load a Linux kernel module from 9p-virtio produces the
      following stack.
      
      [<ffffffff814878ce>] p9_virtio_zc_request+0x45e/0x510
      [<ffffffff814814ed>] p9_client_zc_rpc.constprop.16+0xfd/0x4f0
      [<ffffffff814839dd>] p9_client_read+0x15d/0x240
      [<ffffffff811c8440>] v9fs_fid_readn+0x50/0xa0
      [<ffffffff811c84a0>] v9fs_file_readn+0x10/0x20
      [<ffffffff811c84e7>] v9fs_file_read+0x37/0x70
      [<ffffffff8114e3fb>] vfs_read+0x9b/0x160
      [<ffffffff81153571>] kernel_read+0x41/0x60
      [<ffffffff810c83ab>] copy_module_from_fd.isra.34+0xfb/0x180
      
      Subsequently, QEMU will die printing:
      
      qemu-system-x86_64: virtio: trying to map MMIO memory
      
      This patch enables 9p-virtio to correctly handle this case. This not
      only enables us to load Linux kernel modules off virtfs, but also
      enables ZFS file-based vdevs on virtfs to be used without killing QEMU.
      
      Special thanks to both Avi Kivity and Alexander Graf for their
      interpretation of QEMU backtraces. Without their guidence, tracking down
      this bug would have taken much longer. Also, special thanks to Linus
      Torvalds for his insightful explanation of why this should use
      is_vmalloc_addr() instead of is_vmalloc_or_module_addr():
      
      https://lkml.org/lkml/2014/2/8/272Signed-off-by: default avatarRichard Yao <ryao@gentoo.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      ef9daf83
    • Eric Dumazet's avatar
      6lowpan: fix lockdep splats · 9399fb67
      Eric Dumazet authored
      [ Upstream commit 20e7c4e8 ]
      
      When a device ndo_start_xmit() calls again dev_queue_xmit(),
      lockdep can complain because dev_queue_xmit() is re-entered and the
      spinlocks protecting tx queues share a common lockdep class.
      
      Same issue was fixed for bonding/l2tp/ppp in commits
      
      0daa2303 ("[PATCH] bonding: lockdep annotation")
      49ee4920 ("bonding: set qdisc_tx_busylock to avoid LOCKDEP splat")
      23d3b8bf ("net: qdisc busylock needs lockdep annotations ")
      303c07db ("ppp: set qdisc_tx_busylock to avoid LOCKDEP splat ")
      Reported-by: default avatarAlexander Aring <alex.aring@gmail.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Tested-by: default avatarAlexander Aring <alex.aring@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      9399fb67
  2. 22 Feb, 2014 35 commits
    • Greg Kroah-Hartman's avatar
      Linux 3.12.13 · 1e91ad22
      Greg Kroah-Hartman authored
      1e91ad22
    • Borislav Petkov's avatar
      EDAC: Correct workqueue setup path · c7e30e0a
      Borislav Petkov authored
      commit cb6ef42e upstream.
      
      We're using edac_mc_workq_setup() both on the init path, when
      we load an edac driver and when we change the polling period
      (edac_mc_reset_delay_period) through /sys/.../edac_mc_poll_msec.
      
      On that second path we don't need to init the workqueue which has been
      initialized already.
      
      Thanks to Tejun for workqueue insights.
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Link: http://lkml.kernel.org/r/1391457913-881-1-git-send-email-prarit@redhat.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c7e30e0a
    • Borislav Petkov's avatar
      EDAC: Poll timeout cannot be zero, p2 · 0e790ebd
      Borislav Petkov authored
      commit 9da21b15 upstream.
      
      Sanitize code even more to accept unsigned longs only and to not allow
      polling intervals below 1 second as this is unnecessary and doesn't make
      much sense anyway for polling errors.
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Link: http://lkml.kernel.org/r/1391457913-881-1-git-send-email-prarit@redhat.com
      Cc: Doug Thompson <dougthompson@xmission.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0e790ebd
    • Prarit Bhargava's avatar
      drivers/edac/edac_mc_sysfs.c: poll timeout cannot be zero · 3e475641
      Prarit Bhargava authored
      commit 79040cad upstream.
      
      If you do
      
        echo 0 > /sys/module/edac_core/parameters/edac_mc_poll_msec
      
      the following stack trace is output because the edac module is not
      designed to poll with a timeout of zero.
      
        WARNING: CPU: 12 PID: 0 at lib/list_debug.c:33 __list_add+0xac/0xc0()
        list_add corruption. prev->next should be next (ffff8808291dd1b8), but was           (null). (prev=ffff8808286fe3f8).
        Modules linked in: sg nfsv3 rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache cfg80211 rfkill x86_pkg_temp_thermal coretemp kvm_intel kvm ixgbe e1000e crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper cryptd iTCO_wdt ptp sb_edac iTCO_vendor_support pps_core mdio ipmi_devintf edac_core ioatdma microcode shpchp lpc_ich pcspkr i2c_i801 dca mfd_core ipmi_si wmi ipmi_msghandler nfsd auth_rpcgss nfs_acl lockd sunrpc xfs libcrc32c sd_mod sr_mod cdrom crc_t10dif crct10dif_common mgag200 syscopyarea sysfillrect sysimgblt isci i2c_algo_bit drm_kms_helper ttm drm libsas ahci libahci scsi_transport_sas libata i2c_core dm_mirror dm_region_hash dm_log dm_mod
        CPU: 12 PID: 0 Comm: swapper/12 Not tainted 3.13.0+ #1
        Hardware name: Intel Corporation LH Pass ........../SVRBD-ROW_T, BIOS SE5C600.86B.01.08.0003.022620131521 02/26/2013
        Call Trace:
         <IRQ>
          __list_add+0xac/0xc0
          __internal_add_timer+0xab/0x130
          internal_add_timer+0x17/0x40
          mod_timer_pinned+0xca/0x170
          intel_pstate_timer_func+0x28a/0x380
          call_timer_fn+0x36/0x100
          run_timer_softirq+0x1ff/0x2f0
          __do_softirq+0xf5/0x2e0
          irq_exit+0x10d/0x120
          smp_apic_timer_interrupt+0x45/0x60
          apic_timer_interrupt+0x6d/0x80
         <EOI>
          cpuidle_idle_call+0xb9/0x1f0
          arch_cpu_idle+0xe/0x30
          cpu_startup_entry+0x9e/0x240
          start_secondary+0x1e4/0x290
      
        kernel BUG at kernel/timer.c:1084!
        invalid opcode: 0000 [#1] SMP
        Modules linked in: sg nfsv3 rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache cfg80211 rfkill x86_pkg_temp_thermal coretemp kvm_intel kvm ixgbe e1000e crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper cryptd iTCO_wdt ptp sb_edac iTCO_vendor_support pps_core mdio ipmi_devintf edac_core ioatdma microcode shpchp lpc_ich pcspkr i2c_i801 dca mfd_core ipmi_si wmi ipmi_msghandler nfsd auth_rpcgss nfs_acl lockd sunrpc xfs libcrc32c sd_mod sr_mod cdrom crc_t10dif crct10dif_common mgag200 syscopyarea sysfillrect sysimgblt isci i2c_algo_bit drm_kms_helper ttm drm libsas ahci libahci scsi_transport_sas libata i2c_core dm_mirror dm_region_hash dm_log dm_mod
        CPU: 12 PID: 0 Comm: swapper/12 Tainted: G        W    3.13.0+ #1
        Hardware name: Intel Corporation LH Pass ........../SVRBD-ROW_T, BIOS SE5C600.86B.01.08.0003.022620131521 02/26/2013
        Call Trace:
         <IRQ>
          run_timer_softirq+0x245/0x2f0
          __do_softirq+0xf5/0x2e0
          irq_exit+0x10d/0x120
          smp_apic_timer_interrupt+0x45/0x60
          apic_timer_interrupt+0x6d/0x80
         <EOI>
          cpuidle_idle_call+0xb9/0x1f0
          arch_cpu_idle+0xe/0x30
          cpu_startup_entry+0x9e/0x240
          start_secondary+0x1e4/0x290
        RIP   cascade+0x93/0xa0
      
        WARNING: CPU: 36 PID: 1154 at kernel/workqueue.c:1461 __queue_delayed_work+0xed/0x1a0()
        Modules linked in: sg nfsv3 rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache cfg80211 rfkill x86_pkg_temp_thermal coretemp kvm_intel kvm ixgbe e1000e crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper cryptd iTCO_wdt ptp sb_edac iTCO_vendor_support pps_core mdio ipmi_devintf edac_core ioatdma microcode shpchp lpc_ich pcspkr i2c_i801 dca mfd_core ipmi_si wmi ipmi_msghandler nfsd auth_rpcgss nfs_acl lockd sunrpc xfs libcrc32c sd_mod sr_mod cdrom crc_t10dif crct10dif_common mgag200 syscopyarea sysfillrect sysimgblt isci i2c_algo_bit drm_kms_helper ttm drm libsas ahci libahci scsi_transport_sas libata i2c_core dm_mirror dm_region_hash dm_log dm_mod
        CPU: 36 PID: 1154 Comm: kworker/u481:3 Tainted: G        W    3.13.0+ #1
        Hardware name: Intel Corporation LH Pass ........../SVRBD-ROW_T, BIOS SE5C600.86B.01.08.0003.022620131521 02/26/2013
        Workqueue: edac-poller edac_mc_workq_function [edac_core]
        Call Trace:
          dump_stack+0x45/0x56
          warn_slowpath_common+0x7d/0xa0
          warn_slowpath_null+0x1a/0x20
          __queue_delayed_work+0xed/0x1a0
          queue_delayed_work_on+0x27/0x50
          edac_mc_workq_function+0x72/0xa0 [edac_core]
          process_one_work+0x17b/0x460
          worker_thread+0x11b/0x400
          kthread+0xd2/0xf0
          ret_from_fork+0x7c/0xb0
      
      This patch adds a range check in the edac_mc_poll_msec code to check for 0.
      Signed-off-by: default avatarPrarit Bhargava <prarit@redhat.com>
      Cc: Doug Thompson <dougthompson@xmission.com>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.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>
      3e475641
    • Paul Gortmaker's avatar
      genirq: Add missing irq_to_desc export for CONFIG_SPARSE_IRQ=n · d588c3d8
      Paul Gortmaker authored
      commit 2c45aada upstream.
      
      In allmodconfig builds for sparc and any other arch which does
      not set CONFIG_SPARSE_IRQ, the following will be seen at modpost:
      
        CC [M]  lib/cpu-notifier-error-inject.o
        CC [M]  lib/pm-notifier-error-inject.o
      ERROR: "irq_to_desc" [drivers/gpio/gpio-mcp23s08.ko] undefined!
      make[2]: *** [__modpost] Error 1
      
      This happens because commit 3911ff30 ("genirq: export
      handle_edge_irq() and irq_to_desc()") added one export for it, but
      there were actually two instances of it, in an if/else clause for
      CONFIG_SPARSE_IRQ.  Add the second one.
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Link: http://lkml.kernel.org/r/1392057610-11514-1-git-send-email-paul.gortmaker@windriver.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d588c3d8
    • Nicholas Bellinger's avatar
      target: Fix free-after-use regression in PR unregister · e495ac8f
      Nicholas Bellinger authored
      commit fc09149d upstream.
      
      This patch addresses a >= v3.11 free-after-use regression
      in core_scsi3_emulate_pro_register() that was introduced
      in the following commit:
      
      commit bc118fe4
      Author: Andy Grover <agrover@redhat.com>
      Date:   Thu May 16 10:41:04 2013 -0700
      
          target: Further refactoring of core_scsi3_emulate_pro_register()
      
      To avoid the free-after-use, save an type value before hand, and
      only call core_scsi3_put_pr_reg() with a valid *pr_reg.
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: Andy Grover <agrover@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e495ac8f
    • Steven Rostedt (Red Hat)'s avatar
      ring-buffer: Fix first commit on sub-buffer having non-zero delta · fd60cc9e
      Steven Rostedt (Red Hat) authored
      commit d651aa1d upstream.
      
      Each sub-buffer (buffer page) has a full 64 bit timestamp. The events on
      that page use a 27 bit delta against that timestamp in order to save on
      bits written to the ring buffer. If the time between events is larger than
      what the 27 bits can hold, a "time extend" event is added to hold the
      entire 64 bit timestamp again and the events after that hold a delta from
      that timestamp.
      
      As a "time extend" is always paired with an event, it is logical to just
      allocate the event with the time extend, to make things a bit more efficient.
      
      Unfortunately, when the pairing code was written, it removed the "delta = 0"
      from the first commit on a page, causing the events on the page to be
      slightly skewed.
      
      Fixes: 69d1b839 "ring-buffer: Bind time extend and data events together"
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fd60cc9e
    • Krzysztof Kozlowski's avatar
      power: max17040: Fix NULL pointer dereference when there is no platform_data · c12b12ed
      Krzysztof Kozlowski authored
      commit ac323d8d upstream.
      
      Fix NULL pointer dereference of "chip->pdata" if platform_data was not
      supplied to the driver.
      
      The driver during probe stored the pointer to the platform_data:
      	chip->pdata = client->dev.platform_data;
      Later it was dereferenced in max17040_get_online() and
      max17040_get_status().
      
      If platform_data was not supplied, the NULL pointer exception would
      happen:
      
      [    6.626094] Unable to handle kernel  of a at virtual address 00000000
      [    6.628557] pgd = c0004000
      [    6.632868] [00000000] *pgd=66262564
      [    6.634636] Unable to handle kernel paging request at virtual address e6262000
      [    6.642014] pgd = de468000
      [    6.644700] [e6262000] *pgd=00000000
      [    6.648265] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
      [    6.653552] Modules linked in:
      [    6.656598] CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 3.10.14-02717-gc58b4b4 #505
      [    6.664334] Workqueue: events max17040_work
      [    6.668488] task: dfa11b80 ti: df9f6000 task.ti: df9f6000
      [    6.673873] PC is at show_pte+0x80/0xb8
      [    6.677687] LR is at show_pte+0x3c/0xb8
      [    6.681503] pc : [<c001b7b8>]    lr : [<c001b774>]    psr: 600f0113
      [    6.681503] sp : df9f7d58  ip : 600f0113  fp : 00000009
      [    6.692965] r10: 00000000  r9 : 00000000  r8 : dfa11b80
      [    6.698171] r7 : df9f7ea0  r6 : e6262000  r5 : 00000000  r4 : 00000000
      [    6.704680] r3 : 00000000  r2 : e6262000  r1 : 600f0193  r0 : c05b3750
      [    6.711194] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      [    6.718485] Control: 10c53c7d  Table: 5e46806a  DAC: 00000015
      [    6.724218] Process kworker/0:1 (pid: 31, stack limit = 0xdf9f6238)
      [    6.730465] Stack: (0xdf9f7d58 to 0xdf9f8000)
      [    6.914325] [<c001b7b8>] (show_pte+0x80/0xb8) from [<c047107c>] (__do_kernel_fault.part.9+0x44/0x74)
      [    6.923425] [<c047107c>] (__do_kernel_fault.part.9+0x44/0x74) from [<c001bb7c>] (do_page_fault+0x2c4/0x360)
      [    6.933144] [<c001bb7c>] (do_page_fault+0x2c4/0x360) from [<c0008400>] (do_DataAbort+0x34/0x9c)
      [    6.941825] [<c0008400>] (do_DataAbort+0x34/0x9c) from [<c000e5d8>] (__dabt_svc+0x38/0x60)
      [    6.950058] Exception stack(0xdf9f7ea0 to 0xdf9f7ee8)
      [    6.955099] 7ea0: df0c1790 00000000 00000002 00000000 df0c1794 df0c1790 df0c1790 00000042
      [    6.963271] 7ec0: df0c1794 00000001 00000000 00000009 00000000 df9f7ee8 c0306268 c0306270
      [    6.971419] 7ee0: a00f0113 ffffffff
      [    6.974902] [<c000e5d8>] (__dabt_svc+0x38/0x60) from [<c0306270>] (max17040_work+0x8c/0x144)
      [    6.983317] [<c0306270>] (max17040_work+0x8c/0x144) from [<c003f364>] (process_one_work+0x138/0x440)
      [    6.992429] [<c003f364>] (process_one_work+0x138/0x440) from [<c003fa64>] (worker_thread+0x134/0x3b8)
      [    7.001628] [<c003fa64>] (worker_thread+0x134/0x3b8) from [<c00454bc>] (kthread+0xa4/0xb0)
      [    7.009875] [<c00454bc>] (kthread+0xa4/0xb0) from [<c000eb28>] (ret_from_fork+0x14/0x2c)
      [    7.017943] Code: e1a03005 e2422480 e0826104 e59f002c (e7922104)
      [    7.024017] ---[ end trace 73bc7006b9cc5c79 ]---
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Fixes: c6f4a42dSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c12b12ed
    • Mikulas Patocka's avatar
      time: Fix overflow when HZ is smaller than 60 · 536bfe9d
      Mikulas Patocka authored
      commit 80d767d7 upstream.
      
      When compiling for the IA-64 ski emulator, HZ is set to 32 because the
      emulation is slow and we don't want to waste too many cycles processing
      timers. Alpha also has an option to set HZ to 32.
      
      This causes integer underflow in
      kernel/time/jiffies.c:
      kernel/time/jiffies.c:66:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
        .mult  = NSEC_PER_JIFFY << JIFFIES_SHIFT, /* details above */
        ^
      
      This patch reduces the JIFFIES_SHIFT value to avoid the overflow.
      Signed-off-by: default avatarMikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
      Link: http://lkml.kernel.org/r/alpine.LRH.2.02.1401241639100.23871@file01.intranet.prod.int.rdu2.redhat.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      536bfe9d
    • Wolfram Sang's avatar
      i2c: mv64xxx: refactor message start to ensure proper initialization · 3bf3519d
      Wolfram Sang authored
      commit 79970db2 upstream.
      
      Because the offload mechanism can fall back to a standard transfer,
      having two seperate initialization states is unfortunate. Let's just
      have one state which does things consistently. This fixes a bug where
      some preparation was missing when the fallback happened. And it makes
      the code much easier to follow. To implement this, we put the check
      if offload is possible at the top of the offload setup function.
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      Tested-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
      Fixes: 930ab3d4 (i2c: mv64xxx: Add I2C Transaction Generator support)
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3bf3519d
    • Oleg Nesterov's avatar
      md/raid5: Fix CPU hotplug callback registration · 2d470eab
      Oleg Nesterov authored
      commit 789b5e03 upstream.
      
      Subsystems that want to register CPU hotplug callbacks, as well as perform
      initialization for the CPUs that are already online, often do it as shown
      below:
      
      	get_online_cpus();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      	put_online_cpus();
      
      This is wrong, since it is prone to ABBA deadlocks involving the
      cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
      with CPU hotplug operations).
      
      Interestingly, the raid5 code can actually prevent double initialization and
      hence can use the following simplified form of callback registration:
      
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      	get_online_cpus();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	put_online_cpus();
      
      A hotplug operation that occurs between registering the notifier and calling
      get_online_cpus(), won't disrupt anything, because the code takes care to
      perform the memory allocations only once.
      
      So reorganize the code in raid5 this way to fix the deadlock with callback
      registration.
      
      Cc: linux-raid@vger.kernel.org
      Fixes: 36d1c647Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      [Srivatsa: Fixed the unregister_cpu_notifier() deadlock, added the
      free_scratch_buffer() helper to condense code further and wrote the changelog.]
      Signed-off-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2d470eab
    • NeilBrown's avatar
      md/raid1: restore ability for check and repair to fix read errors. · 93bc0551
      NeilBrown authored
      commit 1877db75 upstream.
      
      commit 30bc9b53
          md/raid1: fix bio handling problems in process_checks()
      
      Move the bio_reset() to a point before where BIO_UPTODATE is checked,
      so that check now always report that the bio is uptodate, even if it is not.
      
      This causes process_check() to sometimes treat read-errors as
      successful matches so the good data isn't written out.
      
      This patch preserves the flag until it is needed.
      
      Bug was introduced in 3.11, but backported to 3.10-stable (as it fixed
      an even worse bug).  So suitable for any -stable since 3.10.
      Reported-and-tested-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      Fixed: 30bc9b53Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      93bc0551
    • Thomas Gleixner's avatar
      tick: Clear broadcast pending bit when switching to oneshot · fb4251e4
      Thomas Gleixner authored
      commit dd5fd9b9 upstream.
      
      AMD systems which use the C1E workaround in the amd_e400_idle routine
      trigger the WARN_ON_ONCE in the broadcast code when onlining a CPU.
      
      The reason is that the idle routine of those AMD systems switches the
      cpu into forced broadcast mode early on before the newly brought up
      CPU can switch over to high resolution / NOHZ mode. The timer related
      CPU1 bringup looks like this:
      
        clockevent_register_device(local_apic);
        tick_setup(local_apic);
        ...
        idle()
      	tick_broadcast_on_off(FORCE);
      	tick_broadcast_oneshot_control(ENTER)
      	  cpumask_set(cpu, broadcast_oneshot_mask);
      	halt();
      
      Now the broadcast interrupt on CPU0 sets CPU1 in the
      broadcast_pending_mask and wakes CPU1. So CPU1 continues:
      
      	local_apic_timer_interrupt()
      	   tick_handle_periodic();
      	   softirq()
      	     tick_init_highres();
      	       cpumask_clr(cpu, broadcast_oneshot_mask);
      
      	tick_broadcast_oneshot_control(ENTER)
      	   WARN_ON(cpumask_test(cpu, broadcast_pending_mask);
      
      So while we remove CPU1 from the broadcast_oneshot_mask when we switch
      over to highres mode, we do not clear the pending bit, which then
      triggers the warning when we go back to idle.
      
      The reason why this is only visible on C1E affected AMD systems is
      that the other machines enter the deep sleep states via
      acpi_idle/intel_idle and exit the broadcast mode before executing the
      remote triggered local_apic_timer_interrupt. So the pending bit is
      already cleared when the switch over to highres mode is clearing the
      oneshot mask.
      
      The solution is simple: Clear the pending bit together with the mask
      bit when we switch over to highres mode.
      
      Stanislaw came up independently with the same patch by enforcing the
      C1E workaround and debugging the fallout. I picked mine, because mine
      has a changelog :)
      Reported-by: default avatarpoma <pomidorabelisima@gmail.com>
      Debugged-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Olaf Hering <olaf@aepfle.de>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Justin M. Forbes <jforbes@redhat.com>
      Cc: Josh Boyer <jwboyer@redhat.com>
      Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1402111434180.21991@ionos.tec.linutronix.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fb4251e4
    • Dan Carpenter's avatar
      KVM: return an error code in kvm_vm_ioctl_register_coalesced_mmio() · 3f77ba33
      Dan Carpenter authored
      commit aac5c422 upstream.
      
      If kvm_io_bus_register_dev() fails then it returns success but it should
      return an error code.
      
      I also did a little cleanup like removing an impossible NULL test.
      
      Fixes: 2b3c246a ('KVM: Make coalesced mmio use a device per zone')
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3f77ba33
    • Mike Marciniszyn's avatar
      IB/qib: Add missing serdes init sequence · 309c2572
      Mike Marciniszyn authored
      commit 2f75e12c upstream.
      
      Research has shown that commit a77fcf89 ("IB/qib: Use a single
      txselect module parameter for serdes tuning") missed a key serdes init
      sequence.
      
      This patch add that sequence.
      Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      309c2572
    • Steven Noonan's avatar
      compiler/gcc4: Make quirk for asm_volatile_goto() unconditional · a6ad68bc
      Steven Noonan authored
      commit a9f18034 upstream.
      
      I started noticing problems with KVM guest destruction on Linux
      3.12+, where guest memory wasn't being cleaned up. I bisected it
      down to the commit introducing the new 'asm goto'-based atomics,
      and found this quirk was later applied to those.
      
      Unfortunately, even with GCC 4.8.2 (which ostensibly fixed the
      known 'asm goto' bug) I am still getting some kind of
      miscompilation. If I enable the asm_volatile_goto quirk for my
      compiler, KVM guests are destroyed correctly and the memory is
      cleaned up.
      
      So make the quirk unconditional for now, until bug is found
      and fixed.
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarSteven Noonan <steven@uplinklabs.net>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jakub Jelinek <jakub@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Link: http://lkml.kernel.org/r/1392274867-15236-1-git-send-email-steven@uplinklabs.net
      Link: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a6ad68bc
    • Mika Westerberg's avatar
      ACPI / hotplug / PCI: Relax the checking of _STA return values · 1f258194
      Mika Westerberg authored
      commit 72820594 upstream.
      
      The ACPI specification (ACPI 5.0A, Section 6.3.7) says:
      
       _STA may return bit 0 clear (not present) with bit 3 set (device is
       functional). This case is used to indicate a valid device for which
       no device driver should be loaded (for example, a bridge device.)
       Children of this device may be present and valid. OSPM should
       continue enumeration below a device whose _STA returns this bit
       combination.
      
      Evidently, some BIOSes follow that and return 0x0A from _STA, which
      causes problems to happen when they trigger bus check or device check
      notifications for those devices too.  Namely, ACPIPHP thinks that they
      are gone and may drop them, for example, if such a notification is
      triggered during a resume from system suspend.
      
      To fix that, modify ACPICA to regard devies as present and
      functioning if _STA returns both the ACPI_STA_DEVICE_ENABLED
      and ACPI_STA_DEVICE_FUNCTIONING bits set for them.
      Reported-and-tested-by: default avatarPeter Wu <lekensteyn@gmail.com>
      [rjw: Subject and changelog, minor code modifications]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1f258194
    • Jens Axboe's avatar
      block: add cond_resched() to potentially long running ioctl discard loop · 50f9027c
      Jens Axboe authored
      commit c8123f8c upstream.
      
      When mkfs issues a full device discard and the device only
      supports discards of a smallish size, we can loop in
      blkdev_issue_discard() for a long time. If preempt isn't enabled,
      this can turn into a softlock situation and the kernel will
      start complaining.
      
      Add an explicit cond_resched() at the end of the loop to avoid
      that.
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      50f9027c
    • Martin K. Petersen's avatar
      block: Fix nr_vecs for inline integrity vectors · e028fddc
      Martin K. Petersen authored
      commit 08778795 upstream.
      
      Commit 9f060e22 changed the way we handle allocations for the
      integrity vectors. When the vectors are inline there is no associated
      slab and consequently bvec_nr_vecs() returns 0. Ensure that we check
      against BIP_INLINE_VECS in that case.
      Reported-by: default avatarDavid Milburn <dmilburn@redhat.com>
      Tested-by: default avatarDavid Milburn <dmilburn@redhat.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e028fddc
    • Tejun Heo's avatar
      block: __elv_next_request() shouldn't call into the elevator if bypassing · b98625aa
      Tejun Heo authored
      commit 556ee818 upstream.
      
      request_queue bypassing is used to suppress higher-level function of a
      request_queue so that they can be switched, reconfigured and shut
      down.  A request_queue does the followings while bypassing.
      
      * bypasses elevator and io_cq association and queues requests directly
        to the FIFO dispatch queue.
      
      * bypasses block cgroup request_list lookup and always uses the root
        request_list.
      
      Once confirmed to be bypassing, specific elevator and block cgroup
      policy implementations can assume that nothing is in flight for them
      and perform various operations which would be dangerous otherwise.
      
      Such confirmation is acheived by short-circuiting all new requests
      directly to the dispatch queue and waiting for all the requests which
      were issued before to finish.  Unfortunately, while the request
      allocating and draining sides were properly handled, we forgot to
      actually plug the request dispatch path.  Even after bypassing mode is
      confirmed, if the attached driver tries to fetch a request and the
      dispatch queue is empty, __elv_next_request() would invoke the current
      elevator's elevator_dispatch_fn() callback.  As all in-flight requests
      were drained, the elevator wouldn't contain any request but once
      bypass is confirmed we don't even know whether the elevator is even
      there.  It might be in the process of being switched and half torn
      down.
      
      Frank Mayhar reports that this actually happened while switching
      elevators, leading to an oops.
      
      Let's fix it by making __elv_next_request() avoid invoking the
      elevator_dispatch_fn() callback if the queue is bypassing.  It already
      avoids invoking the callback if the queue is dying.  As a dying queue
      is guaranteed to be bypassing, we can simply replace blk_queue_dying()
      check with blk_queue_bypass().
      Reported-by: default avatarFrank Mayhar <fmayhar@google.com>
      References: http://lkml.kernel.org/g/1390319905.20232.38.camel@bobble.lax.corp.google.comTested-by: default avatarFrank Mayhar <fmayhar@google.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b98625aa
    • Jan Moskyto Matejka's avatar
      Modpost: fixed USB alias generation for ranges including 0x9 and 0xA · f3affbef
      Jan Moskyto Matejka authored
      commit 03b56329 upstream.
      
      Commit afe2dab4 ("USB: add hex/bcd detection to usb modalias generation")
      changed the routine that generates alias ranges. Before that change, only
      digits 0-9 were supported; the commit tried to fix the case when the range
      includes higher values than 0x9.
      
      Unfortunately, the commit didn't fix the case when the range includes both
      0x9 and 0xA, meaning that the final range must look like [x-9A-y] where
      x <= 0x9 and y >= 0xA -- instead the [x-9A-x] range was produced.
      
      Modprobe doesn't complain as it sees no difference between no-match and
      bad-pattern results of fnmatch().
      
      Fixing this simple bug to fix the aliases.
      Also changing the hardcoded beginning of the range to uppercase as all the
      other letters are also uppercase in the device version numbers.
      
      Fortunately, this affects only the dvb-usb-dib0700 module, AFAIK.
      Signed-off-by: default avatarJan Moskyto Matejka <mq@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f3affbef
    • Sarah Sharp's avatar
      Revert "usbcore: set lpm_capable field for LPM capable root hubs" · bda24434
      Sarah Sharp authored
      commit 140e3026 upstream.
      
      Commit 9df89d85 "usbcore: set
      lpm_capable field for LPM capable root hubs" was created under the
      assumption that all USB host controllers should have USB 3.0 Link PM
      enabled for all devices under the hosts.
      
      Unfortunately, that's not the case.  The xHCI driver relies on knowledge
      of the host hardware scheduler to calculate the LPM U1/U2 timeout
      values, and it only sets lpm_capable to one for Intel host controllers
      (that have the XHCI_LPM_SUPPORT quirk set).
      
      When LPM is enabled for some Fresco Logic hosts, it causes failures with
      a AgeStar 3UBT USB 3.0 hard drive dock:
      
      Jan 11 13:59:03 sg-laptop kernel: usb 3-1: new SuperSpeed USB device number 2 using xhci_hcd
      Jan 11 13:59:03 sg-laptop kernel: usb 3-1: Set SEL for device-initiated U1 failed.
      Jan 11 13:59:08 sg-laptop kernel: usb 3-1: Set SEL for device-initiated U2 failed.
      Jan 11 13:59:08 sg-laptop kernel: usb-storage 3-1:1.0: USB Mass Storage device detected
      Jan 11 13:59:08 sg-laptop mtp-probe[613]: checking bus 3, device 2: "/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb3/3-1"
      Jan 11 13:59:08 sg-laptop mtp-probe[613]: bus: 3, device: 2 was not an MTP device
      Jan 11 13:59:08 sg-laptop kernel: scsi6 : usb-storage 3-1:1.0
      Jan 11 13:59:13 sg-laptop kernel: usb 3-1: Set SEL for device-initiated U1 failed.
      Jan 11 13:59:18 sg-laptop kernel: usb 3-1: Set SEL for device-initiated U2 failed.
      Jan 11 13:59:18 sg-laptop kernel: usbcore: registered new interface driver usb-storage
      Jan 11 13:59:40 sg-laptop kernel: usb 3-1: reset SuperSpeed USB device number 2 using xhci_hcd
      Jan 11 13:59:41 sg-laptop kernel: usb 3-1: device descriptor read/8, error -71
      Jan 11 13:59:41 sg-laptop kernel: usb 3-1: reset SuperSpeed USB device number 2 using xhci_hcd
      Jan 11 13:59:46 sg-laptop kernel: usb 3-1: device descriptor read/8, error -110
      Jan 11 13:59:46 sg-laptop kernel: scsi 6:0:0:0: Device offlined - not ready after error recovery
      Jan 11 13:59:46 sg-laptop kernel: usb 3-1: USB disconnect, device number 2
      
      lspci for the affected host:
      
      04:00.0 0c03: 1b73:1000 (rev 04) (prog-if 30 [XHCI])
              Subsystem: 1043:1039
              Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
              Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
              Latency: 0, Cache Line Size: 64 bytes
              Interrupt: pin A routed to IRQ 19
              Region 0: Memory at dd200000 (32-bit, non-prefetchable) [size=64K]
              Capabilities: [50] Power Management version 3
                      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold-)
                      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
              Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
                      Address: 0000000000000000  Data: 0000
              Capabilities: [80] Express (v1) Endpoint, MSI 00
                      DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <2us, L1 <32us
                              ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
                      DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                              RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
                              MaxPayload 128 bytes, MaxReadReq 512 bytes
                      DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
                      LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 unlimited
                              ClockPM- Surprise- LLActRep- BwNot-
                      LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
                              ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                      LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
              Kernel driver in use: xhci_hcd
              Kernel modules: xhci_hcd
      
      The commit was backported to stable kernels, and will need to be
      reverted there as well.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@intel.com>
      Reported-by: default avatarSergey Galanov <sergey.e.galanov@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bda24434
    • Sarah Sharp's avatar
      Revert "usb: xhci: Link TRB must not occur within a USB payload burst" · aad850bd
      Sarah Sharp authored
      commit 3d4b81ed upstream.
      
      This reverts commit 35773dac.  It's a
      hack that caused regressions in the usb-storage and userspace USB
      drivers that use usbfs and libusb.  Commit 70cabb7d992f "xhci 1.0: Limit
      arbitrarily-aligned scatter gather." should fix the issues seen with the
      ax88179_178a driver on xHCI 1.0 hosts, without causing regressions.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aad850bd
    • Sarah Sharp's avatar
      Revert "xhci: Avoid infinite loop when sg urb requires too many trbs" · f47a7fb0
      Sarah Sharp authored
      commit 9cf00d91 upstream.
      
      This reverts commit d6c9ea90.
      
      We are ripping out commit 35773dac "usb:
      xhci: Link TRB must not occur within a USB payload burst" because it's a
      hack that caused regressions in the usb-storage and userspace USB
      drivers that use usbfs and libusb.  This commit attempted to fix the
      issues with that patch.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f47a7fb0
    • Sarah Sharp's avatar
      Revert "xhci: Set scatter-gather limit to avoid failed block writes." · 563f0109
      Sarah Sharp authored
      commit 1386ff75 upstream.
      
      This reverts commit f2d9b991.
      
      We are ripping out commit 35773dac "usb:
      xhci: Link TRB must not occur within a USB payload burst" because it's a
      hack that caused regressions in the usb-storage and userspace USB
      drivers that use usbfs and libusb.  This commit attempted to fix the
      issues with that patch.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      563f0109
    • Sarah Sharp's avatar
      xhci 1.0: Limit arbitrarily-aligned scatter gather. · d6472e8a
      Sarah Sharp authored
      commit 247bf557 upstream.
      
      xHCI 1.0 hosts have a set of requirements on how to align transfer
      buffers on the endpoint rings called "TD fragment" rules.  When the
      ax88179_178a driver added support for scatter gather in 3.12, with
      commit 804fad45411b48233b48003e33a78f290d227c8 "USBNET: ax88179_178a:
      enable tso if usb host supports sg dma", it broke the device under xHCI
      1.0 hosts.  Under certain network loads, the device would see an
      unexpected short packet from the host, which would cause the device to
      stop sending ethernet packets, even through USB packets would still be
      sent.
      
      Commit 35773dac "usb: xhci: Link TRB must not occur within a USB
      payload burst" attempted to fix this.  It was a quick hack to partially
      implement the TD fragment rules.  However, it caused regressions in the
      usb-storage layer and userspace USB drivers using libusb.  The patches
      to attempt to fix this are too far reaching into the USB core, and we
      really need to implement the TD fragment rules correctly in the xHCI
      driver, instead of continuing to wallpaper over the issues.
      
      Disable arbitrarily-aligned scatter-gather in the xHCI driver for 1.0
      hosts.  Only the ax88179_178a driver checks the no_sg_constraint flag,
      so don't set it for 1.0 hosts.  This should not impact usb-storage or
      usbfs behavior, since they pass down max packet sized aligned sg-list
      entries (512 for USB 2.0 and 1024 for USB 3.0).
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: default avatarMark Lord <mlord@pobox.com>
      Cc: David Laight <David.Laight@ACULAB.COM>
      Cc: Bjørn Mork <bjorn@mork.no>
      Cc: Freddy Xin <freddy@asix.com.tw>
      Cc: Ming Lei <ming.lei@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d6472e8a
    • Kristóf Ralovich's avatar
      USB: simple: add Dynastream ANT USB-m Stick device support · f72d5bdd
      Kristóf Ralovich authored
      commit 2240c365 upstream.
      
      Add support for ANT USB-m Stick from Dynastream Innovations, by listing
      USB pid
      
      [34366.944805] usb 6-1: New USB device found, idVendor=0fcf, idProduct=1009
      [34366.944817] usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      [34366.944824] usb 6-1: Product: ANT USB-m Stick
      [34366.944831] usb 6-1: Manufacturer: Dynastream Innovations
      
      Device reported (https://code.google.com/p/antpm/issues/detail?id=5) to
      work through:
      $ modprobe usbserial vendor=0x0fcf product=0x1009
      Signed-off-by: default avatarKristóf Ralovich <kristof.ralovich@gmail.com>
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f72d5bdd
    • Raymond Wanyoike's avatar
      usb: option: blacklist ZTE MF667 net interface · 2a4183d2
      Raymond Wanyoike authored
      commit 3635c7e2 upstream.
      
      Interface #5 of 19d2:1270 is a net interface which has been submitted to the
      qmi_wwan driver so consequently remove it from the option driver.
      Signed-off-by: default avatarRaymond Wanyoike <raymond.wanyoike@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2a4183d2
    • Alan Stern's avatar
      usb-storage: enable multi-LUN scanning when needed · dc73eb45
      Alan Stern authored
      commit 823d12c9 upstream.
      
      People sometimes create their own custom-configured kernels and forget
      to enable CONFIG_SCSI_MULTI_LUN.  This causes problems when they plug
      in a USB storage device (such as a card reader) with more than one
      LUN.
      
      Fortunately, we can tell fairly easily when a storage device claims to
      have more than one LUN.  When that happens, this patch asks the SCSI
      layer to probe all the LUNs automatically, regardless of the config
      setting.
      
      The patch also updates the Kconfig help text for usb-storage,
      explaining that CONFIG_SCSI_MULTI_LUN may be necessary.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-by: default avatarThomas Raschbacher <lordvan@lordvan.com>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      CC: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dc73eb45
    • Alan Stern's avatar
      usb-storage: restrict bcdDevice range for Super Top in Cypress ATACB · 4c43e4ac
      Alan Stern authored
      commit a9c143c8 upstream.
      
      The Cypress ATACB unusual-devs entry for the Super Top SATA bridge
      causes problems.  Although it was originally reported only for
      bcdDevice = 0x160, its range was much larger.  This resulted in a bug
      report for bcdDevice 0x220, so the range was capped at 0x219.  Now
      Milan reports errors with bcdDevice 0x150.
      
      Therefore this patch restricts the range to just 0x160.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: default avatarMilan Svoboda <milan.svoboda@centrum.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4c43e4ac
    • Alan Stern's avatar
      usb-storage: add unusual-devs entry for BlackBerry 9000 · 52c95efe
      Alan Stern authored
      commit c5637e51 upstream.
      
      This patch adds an unusual-devs entry for the BlackBerry 9000.  This
      fixes Bugzilla #22442.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-by: default avatarMoritz Moeller-Herrmann <moritz-kernel@moeller-herrmann.de>
      Tested-by: default avatarMoritz Moeller-Herrmann <moritz-kernel@moeller-herrmann.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      52c95efe
    • Ulrich Hahn's avatar
      USB: ftdi_sio: add Tagsys RFID Reader IDs · ee01689d
      Ulrich Hahn authored
      commit 76f24e3f upstream.
      
      Adding two more IDs to the ftdi_sio usb serial driver.
      It now connects Tagsys RFID readers.
      There might be more IDs out there for other Tagsys models.
      Signed-off-by: default avatarUlrich Hahn <uhahn@eanco.de>
      Cc: Johan Hovold <johan@hovold.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ee01689d
    • Bjørn Mork's avatar
      usb: ftdi_sio: add Mindstorms EV3 console adapter · 82105904
      Bjørn Mork authored
      commit 67847bae upstream.
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      82105904
    • K. Y. Srinivasan's avatar
      Drivers: hv: vmbus: Don't timeout during the initial connection with host · 261fae78
      K. Y. Srinivasan authored
      commit 269f9794 upstream.
      
      When the guest attempts to connect with the host when there may already be a
      connection with the host (as would be the case during the kdump/kexec path),
      it is difficult to guarantee timely response from the host. Starting with
      WS2012 R2, the host supports this ability to re-connect with the host
      (explicitly to support kexec). Prior to responding to the guest, the host
      needs to ensure that device states based on the previous connection to
      the host have been properly torn down. This may introduce unbounded delays.
      To deal with this issue, don't do a timed wait during the initial connect
      with the host.
      Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      261fae78
    • Martyn Welch's avatar
      VME: Correct read/write alignment algorithm · 83d0c11c
      Martyn Welch authored
      commit f0342e66 upstream.
      
      In order to ensure the correct width cycles on the VME bus, the VME bridge
      drivers implement an algorithm to utilise the largest possible width reads and
      writes whilst maintaining natural alignment constraints. The algorithm
      currently looks at the start address rather than the current read/write address
      when determining whether a 16-bit width cycle is required to get to 32-bit
      alignment.  This results in incorrect alignment,
      Reported-by: default avatarJim Strouth <james.strouth@ge.com>
      Tested-by: default avatarJim Strouth <james.strouth@ge.com>
      Signed-off-by: default avatarMartyn Welch <martyn.welch@ge.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      83d0c11c