1. 21 Nov, 2014 40 commits
    • Sinclair Yeh's avatar
      When screen objects are enabled, the bpp is assumed to be 32, otherwise it is set to 16. · d7556482
      Sinclair Yeh authored
      v2:
      * Use u32 instead of u64 for assumed_bpp.
      * Fixed mechanism to check for screen objects
      * Limit the back buffer size to VRAM.
      
      v3:
      * Backported for 3.12-stable
      Signed-off-by: default avatarSinclair Yeh <syeh@vmware.com>
      Reviewed-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      (cherry picked from commit 2edb76f3)
      
      (cherry picked from commit HEAD)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      d7556482
    • Grant Likely's avatar
      of: Fix overflow bug in string property parsing functions · 26cd5f4a
      Grant Likely authored
      The string property read helpers will run off the end of the buffer if
      it is handed a malformed string property. Rework the parsers to make
      sure that doesn't happen. At the same time add new test cases to make
      sure the functions behave themselves.
      
      The original implementations of of_property_read_string_index() and
      of_property_count_strings() both open-coded the same block of parsing
      code, each with it's own subtly different bugs. The fix here merges
      functions into a single helper and makes the original functions static
      inline wrappers around the helper.
      
      One non-bugfix aspect of this patch is the addition of a new wrapper,
      of_property_read_string_array(). The new wrapper is needed by the
      device_properties feature that Rafael is working on and planning to
      merge for v3.19. The implementation is identical both with and without
      the new static inline wrapper, so it just got left in to reduce the
      churn on the header file.
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Darren Hart <darren.hart@intel.com>
      Cc: <stable@vger.kernel.org>  # v3.3+: Drop selftest hunks that don't apply
      
      (cherry picked from commit a87fa1d8)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      26cd5f4a
    • Canek Peláez Valdés's avatar
      rt2x00: support Ralink 5362. · 804463b5
      Canek Peláez Valdés authored
      Signed-off-by: default avatarCanek Peláez Valdés <canek@ciencias.unam.mx>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      
      (cherry picked from commit ac0372ab)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      804463b5
    • Perry Hung's avatar
      usb: serial: ftdi_sio: add "bricked" FTDI device PID · 42e8d21d
      Perry Hung authored
      An official recent Windows driver from FTDI detects counterfeit devices
      and reprograms the internal EEPROM containing the USB PID to 0, effectively
      bricking the device.
      
      Add support for this VID/PID pair to correctly bind the driver on these
      devices.
      
      See:
      http://hackaday.com/2014/10/22/watch-that-windows-update-ftdi-drivers-are-killing-fake-chips/Signed-off-by: default avatarPerry Hung <iperry@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      
      (cherry picked from commit 7f2719f0)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      42e8d21d
    • Cong Wang's avatar
      freezer: Do not freeze tasks killed by OOM killer · 6c6f9dc4
      Cong Wang authored
      Since f660daac (oom: thaw threads if oom killed thread is frozen
      before deferring) OOM killer relies on being able to thaw a frozen task
      to handle OOM situation but a3201227 (freezer: make freezing() test
      freeze conditions in effect instead of TIF_FREEZE) has reorganized the
      code and stopped clearing freeze flag in __thaw_task. This means that
      the target task only wakes up and goes into the fridge again because the
      freezing condition hasn't changed for it. This reintroduces the bug
      fixed by f660daac.
      
      Fix the issue by checking for TIF_MEMDIE thread flag in
      freezing_slow_path and exclude the task from freezing completely. If a
      task was already frozen it would get woken by __thaw_task from OOM killer
      and get out of freezer after rechecking freezing().
      
      Changes since v1
      - put TIF_MEMDIE check into freezing_slowpath rather than in __refrigerator
        as per Oleg
      - return __thaw_task into oom_scan_process_thread because
        oom_kill_process will not wake task in the fridge because it is
        sleeping uninterruptible
      
      [mhocko@suse.cz: rewrote the changelog]
      Fixes: a3201227 (freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE)
      Cc: 3.3+ <stable@vger.kernel.org> # 3.3+
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarMichal Hocko <mhocko@suse.cz>
      Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      (cherry picked from commit 51fae6da)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      6c6f9dc4
    • Dirk Brandewie's avatar
      cpufreq: expose scaling_cur_freq sysfs file for set_policy() drivers · 76e2c3a5
      Dirk Brandewie authored
      Currently the core does not expose scaling_cur_freq for set_policy()
      drivers this breaks some userspace monitoring tools.
      Change the core to expose this file for all drivers and if the
      set_policy() driver supports the get() callback use it to retrieve the
      current frequency.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=73741
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: default avatarDirk Brandewie <dirk.j.brandewie@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      (cherry picked from commit c034b02e)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      76e2c3a5
    • Markos Chandras's avatar
      MIPS: ftrace: Fix a microMIPS build problem · 00ff53ca
      Markos Chandras authored
      Code before the .fixup section needs to have the .insn directive.
      This has no side effects on MIPS32/64 but it affects the way microMIPS
      loads the address for the return label.
      
      Fixes the following build problem:
      mips-linux-gnu-ld: arch/mips/built-in.o: .fixup+0x4a0: Unsupported jump between
      ISA modes; consider recompiling with interlinking enabled.
      mips-linux-gnu-ld: final link failed: Bad value
      Makefile:819: recipe for target 'vmlinux' failed
      
      The fix is similar to 1658f914 ("MIPS: microMIPS:
      Disable LL/SC and fix linker bug.")
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: stable@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/8117/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      (cherry picked from commit aedd153f)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      00ff53ca
    • Guenter Roeck's avatar
      Revert "percpu: free percpu allocation info for uniprocessor system" · 40bf0226
      Guenter Roeck authored
      This reverts commit 3189eddb ("percpu: free percpu allocation info for
      uniprocessor system").
      
      The commit causes a hang with a crisv32 image. This may be an architecture
      problem, but at least for now the revert is necessary to be able to boot a
      crisv32 image.
      
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Honggang Li <enjoymindful@gmail.com>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Fixes: 3189eddb ("percpu: free percpu allocation info for uniprocessor system")
      Cc: stable@vger.kernel.org # Please don't apply 3189eddb
      
      (cherry picked from commit bb2e226b)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      40bf0226
    • Quentin Casasnovas's avatar
      regmap: fix kernel hang on regmap_bulk_write with zero val_count. · 3465e6b4
      Quentin Casasnovas authored
      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.
      
      In 3.12, this was introduced by a0b8d8d9
      ("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 avatarJiri Slaby <jslaby@suse.cz>
      (cherry picked from commit a7a2830c)
      
      (cherry picked from commit HEAD)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      3465e6b4
    • Cesar Eduardo Barros's avatar
      crypto: memneq - fix for archs without efficient unaligned access · 23de8dab
      Cesar Eduardo Barros authored
      Commit fe8c8a12 introduced a possible build error for archs
      that do not have CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS set. :/
      Fix this up by bringing else braces outside of the ifdef.
      Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Fixes: fe8c8a12 ("crypto: more robust crypto_memneq")
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Acked-By: default avatarCesar Eduardo Barros <cesarb@cesarb.eti.br>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      
      crytpo: ccp - fix coccinelle warnings
      
      drivers/crypto/ccp/ccp-crypto-aes.c:344:1-7: Replace memcpy with struct assignment
      drivers/crypto/ccp/ccp-crypto-sha.c:398:1-7: Replace memcpy with struct assignment
      drivers/crypto/ccp/ccp-dev.c:578:2-3: Unneeded semicolon
      /c/kernel-tests/src/cocci/drivers/crypto/ccp/ccp-dev.c:565:2-3: Unneeded semicolon
      
      Generated by: coccinelle/misc/memcpy-assign.cocci
      
      CC: Tom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      
      crypto: omap-aes - add error check for pm_runtime_get_sync
      
      The AES driver currently assumes that pm_runtime_get_sync will always
      succeed, which may not always be true, so add error handling for the
      same.
      
      This scenario was reported in the following bug:
      place.  https://bugzilla.kernel.org/show_bug.cgi?id=66441Reported-by: default avatarTobias Jakobi <tjakobi@math.uni-bielefeld.de>
      Signed-off-by: default avatarNishanth Menon <nm@ti.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      
      padata: Fix wrong usage of rcu_dereference()
      
      A kernel with enabled lockdep complains about the wrong usage of
      rcu_dereference() under a rcu_read_lock_bh() protected region.
      
        ===============================
        [ INFO: suspicious RCU usage. ]
        3.13.0-rc1+ #126 Not tainted
        -------------------------------
        linux/kernel/padata.c:115 suspicious rcu_dereference_check() usage!
      
        other info that might help us debug this:
      
        rcu_scheduler_active = 1, debug_locks = 1
        1 lock held by cryptomgr_test/153:
         #0:  (rcu_read_lock_bh){.+....}, at: [<ffffffff8115c235>] padata_do_parallel+0x5/0x270
      
      Fix that by using rcu_dereference_bh() instead.
      Signed-off-by: default avatarMathias Krause <minipli@googlemail.com>
      Acked-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      
      crypto: pcrypt - Fix wrong usage of rcu_dereference()
      
      A kernel with enabled lockdep complains about the wrong usage of
      rcu_dereference() under a rcu_read_lock_bh() protected region.
      
        ===============================
        [ INFO: suspicious RCU usage. ]
        3.13.0-rc1+ #126 Not tainted
        -------------------------------
        linux/crypto/pcrypt.c:81 suspicious rcu_dereference_check() usage!
      
        other info that might help us debug this:
      
        rcu_scheduler_active = 1, debug_locks = 1
        1 lock held by cryptomgr_test/153:
         #0:  (rcu_read_lock_bh){.+....}, at: [<ffffffff812c8075>] pcrypt_do_parallel.isra.2+0x5/0x200
      
      Fix that by using rcu_dereference_bh() instead.
      Signed-off-by: default avatarMathias Krause <minipli@googlemail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Acked-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      
      crypto: more robust crypto_memneq
      
      Disabling compiler optimizations can be fragile, since a new
      optimization could be added to -O0 or -Os that breaks the assumptions
      the code is making.
      
      Instead of disabling compiler optimizations, use a dummy inline assembly
      (based on RELOC_HIDE) to block the problematic kinds of optimization,
      while still allowing other optimizations to be applied to the code.
      
      The dummy inline assembly is added after every OR, and has the
      accumulator variable as its input and output. The compiler is forced to
      assume that the dummy inline assembly could both depend on the
      accumulator variable and change the accumulator variable, so it is
      forced to compute the value correctly before the inline assembly, and
      cannot assume anything about its value after the inline assembly.
      
      This change should be enough to make crypto_memneq work correctly (with
      data-independent timing) even if it is inlined at its call sites. That
      can be done later in a followup patch.
      
      Compile-tested on x86_64.
      Signed-off-by: default avatarCesar Eduardo Barros <cesarb@cesarb.eti.br>
      Acked-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      
      (cherry picked from commit e37b94eb
      fe8c8a12)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      23de8dab
    • Richard Leitner's avatar
      Input: serio - avoid negative serio device numbers · 69f68686
      Richard Leitner authored
      Fix the format string for serio device name generation to avoid negative
      device numbers when the id exceeds the maximum signed integer value.
      Signed-off-by: default avatarRichard Leitner <richard.leitner@skidata.com>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      
      (cherry picked from commit 0224ec9e)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      69f68686
    • Petr Sebor's avatar
      Input: xpad - add new USB IDs for Logitech F310 and F710 · 43328c22
      Petr Sebor authored
      This enables the rumble force feedback on the F710 unit since
      it is no longer treated as XTYPE_UNKNOWN type.
      Signed-off-by: default avatarPetr Sebor <petr@scssoft.com>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      
      (cherry picked from commit 8e2f2325)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      43328c22
    • Vincent Zwanenburg's avatar
      Add a new PID/VID 0227/0930 for AR3012. · 45ea1bce
      Vincent Zwanenburg authored
      usb devices info:
      
      T:  Bus=01 Lev=02 Prnt=05 Port=00 Cnt=01 Dev#= 20 Spd=12   MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0930 ProdID=0227 Rev= 0.02
      C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      Signed-off-by: default avatarVincent Zwanenburg <vincentz@topmail.ie>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      
      (cherry picked from commit 89d2975f)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      45ea1bce
    • Anantha Krishnan's avatar
      Bluetooth: Add support for Acer [13D3:3432] · 50ada1ee
      Anantha Krishnan authored
      Add support for the QCA6174 chip.
      
          T:  Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 30 Spd=12  MxCh= 0
          D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
          P:  Vendor=13d3 ProdID=3432 Rev=00.02
          C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
          I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
          I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      Signed-off-by: default avatarAnantha Krishnan <ananthk@codeaurora.org>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      
      (cherry picked from commit fa2f1394)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      50ada1ee
    • Andy Shevchenko's avatar
      Bluetooth: append new supported device to the list [0b05:17d0] · 972be056
      Andy Shevchenko authored
      The device found on Asus Z87 Expert motherboard requires firmware to work
      correctly.
      
      T:  Bus=03 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#=  3 Spd=12  MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0b05 ProdID=17d0 Rev=00.02
      C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      
      (cherry picked from commit a735f9e2)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      972be056
    • Andy Shevchenko's avatar
      Bluetooth: sort the list of IDs in the source code · f7787e8e
      Andy Shevchenko authored
      This will help to manage table of supported IDs.
      
      There is no functional change.
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      
      (cherry picked from commit 0b880062)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      f7787e8e
    • Oliver Neukum's avatar
      Bluetooth: Add firmware update for Atheros 0cf3:311f · cf0bb39a
      Oliver Neukum authored
      The device is not functional without firmware.
      
      The device without firmware:
      T:  Bus=02 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0cf3 ProdID=311f Rev=00.01
      C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      
      The device with firmware:
      T:  Bus=02 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0cf3 ProdID=3007 Rev=00.01
      C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      
      (cherry picked from commit 1e56f1eb)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      cf0bb39a
    • Oliver Neukum's avatar
      Bluetooth: Enable Atheros 0cf3:311e for firmware upload · 7af35b95
      Oliver Neukum authored
      The device will bind to btusb without firmware, but with the original
      buggy firmware device discovery does not work. No devices are detected.
      
      Device descriptor without firmware:
      T:  Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0cf3 ProdID=311e Rev= 0.01
      C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      
      with firmware:
      T:  Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  3 Spd=12   MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0cf3 ProdID=311e Rev= 0.02
      C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      
      (cherry picked from commit b131237c)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      7af35b95
    • Marco Piazza's avatar
      Bluetooth: Add support for Toshiba Bluetooth device [0930:0220] · 8e640758
      Marco Piazza authored
      This patch adds support for new Toshiba Bluetooth device.
      
      T:  Bus=05 Lev=01 Prnt=01 Port=02 Cnt=02 Dev#=  4 Spd=12  MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0930 ProdID=0220 Rev=00.02
      C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      Signed-off-by: default avatarMarco Piazza <mpiazza@gmail.com>
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      
      (cherry picked from commit bd0976dd)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8e640758
    • Sujith Manoharan's avatar
      Bluetooth: ath3k: Add support for a new AR3012 device · 9d72effb
      Sujith Manoharan authored
      T:  Bus=02 Lev=01 Prnt=01 Port=04 Cnt=01 Dev#=  9 Spd=12   MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0489 ProdID=e05f Rev= 0.02
      C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      Reported-by: default avatarJoshua Richenhagen <richenhagen@gmail.com>
      Signed-off-by: default avatarSujith Manoharan <sujith@msujith.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      
      (cherry picked from commit 35580d22)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      9d72effb
    • Sujith Manoharan's avatar
      Bluetooth: ath3k: Add support for another AR3012 card · 7d6df83e
      Sujith Manoharan authored
      T:  Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=04ca ProdID=300b Rev= 0.01
      C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      Reported-by: default avatarFace <falazemi@gmail.com>
      Signed-off-by: default avatarSujith Manoharan <sujith@msujith.org>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      
      (cherry picked from commit bd0fca1b)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      7d6df83e
    • Anatol Pomozov's avatar
      Bluetooth: Fix crash in the Marvell driver initialization codepath · 4901c96f
      Anatol Pomozov authored
      btmrvl_add_card() function calls kthread_run that might return error
      (e.g. if current thread is killed). If one tries to use the error
      value as a pointer then invalid memory access oops happens.
      
      Check kthread_run() return value, if it is an error then release resources
      correctly.
      
      TEST=boot computer with BT modules enabled. I see the error message that
      BT device initialization failed. Now kernel does not crash. Hint: to enable
      BT run 'rmmod btmrvl_sdio; modprobe btmrvl_sdio'
      Signed-off-by: default avatarAnatol Pomozov <anatol.pomozov@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      
      (cherry picked from commit 8500d791)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      4901c96f
    • Marcel Holtmann's avatar
      Bluetooth: Fix endian and alignment issue with ath3k version handling · c6e8976d
      Marcel Holtmann authored
      The ath3k driver is treating the version information badly when it
      comes to loading the right firmware version and comparing that it
      actually matches with the hardware.
      
      Initially this showed up as this:
      
        CHECK   drivers/bluetooth/ath3k.c
      drivers/bluetooth/ath3k.c:373:17: warning: cast to restricted __le32
      drivers/bluetooth/ath3k.c:435:17: warning: cast to restricted __le32
      
      However when fixing this by actually using __packed and __le32 for
      the ath3_version structure, more issues came up:
      
        CHECK   drivers/bluetooth/ath3k.c
      drivers/bluetooth/ath3k.c:381:32: warning: incorrect type in assignment (different base types)
      drivers/bluetooth/ath3k.c:381:32:    expected restricted __le32 [usertype] rom_version
      drivers/bluetooth/ath3k.c:381:32:    got int [signed] <noident>
      drivers/bluetooth/ath3k.c:382:34: warning: incorrect type in assignment (different base types)
      drivers/bluetooth/ath3k.c:382:34:    expected restricted __le32 [usertype] build_version
      drivers/bluetooth/ath3k.c:382:34:    got int [signed] <noident>
      drivers/bluetooth/ath3k.c:386:28: warning: restricted __le32 degrades to integer
      drivers/bluetooth/ath3k.c:386:56: warning: restricted __le32 degrades to integer
      
      This patch fixes every instance of the firmware version handling and
      makes sure it is endian safe and uses proper unaligned access.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      
      (cherry picked from commit 72dd2b2a)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c6e8976d
    • Peng Chen's avatar
      Bluetooth: Fix endianess issue in the ath3k driver · 315087c5
      Peng Chen authored
      The version is always in little endian format. This patch makes the
      driver work on both little and big endian CPUs.
      Signed-off-by: default avatarPeng Chen <pengchen@qca.qualcomm.com>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      
      (cherry picked from commit b9e2535a)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      315087c5
    • John Sung's avatar
      HID: usbhid: quirk for PM1610 and PM1640 Touchscreen. · c0eeb253
      John Sung authored
      These device needs to be added to the quirks list with HID_QUIRK_NOGET,
      otherwise they will reset upon receiving the get input report requests.
      Signed-off-by: default avatarJohn Sung <penmount.touch@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      
      (cherry picked from commit 66e54827)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c0eeb253
    • Wen-chien Jesse Sung's avatar
      HID: use multi input quirk for 22b9:2968 · 99b47335
      Wen-chien Jesse Sung authored
      This device generates ABS_Z and ABS_RX events instead of ABS_X and
      ABS_Y.
      Signed-off-by: default avatarWen-chien Jesse Sung <jesse.sung@canonical.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      
      HID: add quirk for 0x04d9:0xa096 device
      
      I am using a USB keyborad that give me "usb_submit_urb(ctrl) failed: -1" error
      when I plugin it.  and I need to wait for 10s for this device to be ready.
      
      By adding this quirks, the usb keyborad is usable right after plugin
      Signed-off-by: default avatarWangzhao Cai <microcaicai@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      
      HID: use multi input quirk for 22b9:2968
      
      This device generates ABS_Z and ABS_RX events instead of ABS_X and
      ABS_Y.
      Signed-off-by: default avatarWen-chien Jesse Sung <jesse.sung@canonical.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      
      HID: picolcd: remove unnecessary NULL test before debugfs_remove
      
      Fix checkpatch warning:
      WARNING: debugfs_remove(NULL) is safe this check is probably not required
      Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      
      HID: roccat: Drop cast
      
      This patch removes the cast on data of type void* as it is not needed.
      The following Coccinelle semantic patch was used for making the change:
      
      @r@
      expression x;
      void* e;
      type T;
      identifier f;
      @@
      
      (
        *((T *)e)
      |
        ((T *)x)[...]
      |
        ((T *)x)->f
      |
      - (T *)
        e
      )
      Signed-off-by: default avatarHimangi Saraogi <himangi774@gmail.com>
      Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      
      HID: Kconfig: drop remove Unicode non-breaking space from Kconfig
      
      There is a UTF-8 non-breaking space character (0xc2 0xa0) after the "Y"
      in "Say Y here". This is probably not intentional. Replace it with a
      standard ASCII space (0x20).
      
      If you can't see a difference here, I don't blame you :)
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      
      HID: usbhid: remove unneeded initialization of quirks_param[]
      
      The quirks_param array is located in the BSS, no need to explicitly
      initialize it with NULL.
      Signed-off-by: default avatarMathias Krause <minipli@googlemail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      
      (cherry picked from commit d90b1cf0
      3179e8e6)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      99b47335
    • Reyad Attiyat's avatar
      HID: usbhid: Use flag HID_DISCONNECTED when a usb device is removed · 7efab936
      Reyad Attiyat authored
      Set disconnected flag in struct usbhid when a usb device is removed. Check for
      disconnected flag before sending urb requests. This prevents a kernel panic
      when a hid driver calls hid_hw_request() after removing a usb device.
      
       BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
       IP: [<ffffffff8161746f>] hid_submit_ctrl+0x7f/0x290
       PGD 0
       Oops: 0002 [#1] PREEMPT SMP
       CPU: 2 PID: 39 Comm: khubd Tainted: G          IO  3.16.0-rc5+ #112
       Hardware name: Microsoft Corporation Surface Pro 2/Surface Pro 2, BIOS 2.03.0250 09/06/2013
       task: ffff880118aba6e0 ti: ffff8800daf80000 task.ti: ffff8800daf80000
       RIP: 0010:[<ffffffff8161746f>]  [<ffffffff8161746f>] hid_submit_ctrl+0x7f/0x290
       RSP: 0018:ffff8800daf83750  EFLAGS: 00010086
       RAX: 0000000080000300 RBX: ffff88003f60c000 RCX: 0000000000000000
       RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff880117f78000
       RBP: ffff8800daf83788 R08: 0000000000000001 R09: 0000000000000001
       R10: 0000000000000001 R11: 0000000000000000 R12: ffff880117f78000
       R13: ffff88003f11a290 R14: 000000000000000c R15: ffff880091cb3ab8
       FS:  0000000000000000(0000) GS:ffff88011b000000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000000000000058 CR3: 0000000001c11000 CR4: 00000000001407e0
       Stack:
        ffff880117f3dcd0 ffff880117f78000 ffff88003f60c000 ffff880117f78000
        ffff880117f78000 ffff88003f11a290 0000000000000000 ffff8800daf837b0
        ffffffff81617707 ffff880117f78000 ffff88003f60c000 0000000000000013
       Call Trace:
        [<ffffffff81617707>] usbhid_restart_ctrl_queue+0x87/0x140
        [<ffffffff81617a88>] usbhid_submit_report+0x2c8/0x370
        [<ffffffff81617b4a>] usbhid_request+0x1a/0x30
        [<ffffffffa020edfb>] sensor_hub_set_feature+0x8b/0xd0 [hid_sensor_hub]
        [<ffffffffa02d9084>] hid_sensor_power_state+0x84/0x110 [hid_sensor_trigger]
        [<ffffffffa02d9129>] hid_sensor_data_rdy_trigger_set_state+0x19/0x20 [hid_sensor_trigger]
        [<ffffffffa034d5b7>] iio_triggered_buffer_predisable+0xa7/0xb0 [industrialio]
        [<ffffffffa034cc4a>] iio_disable_all_buffers+0x3a/0xc0 [industrialio]
        [<ffffffffa03487d3>] iio_device_unregister+0x53/0x80 [industrialio]
        [<ffffffffa026c06a>] hid_accel_3d_remove+0x2a/0x50 [hid_sensor_accel_3d]
        [<ffffffff814f433d>] platform_drv_remove+0x1d/0x40
        [<ffffffff814f18bf>] __device_release_driver+0x7f/0xf0
        [<ffffffff814f1955>] device_release_driver+0x25/0x40
        [<ffffffff814f121c>] bus_remove_device+0x11c/0x1a0
        [<ffffffff814ed7d6>] device_del+0x136/0x1e0
        [<ffffffff81512190>] ? mfd_cell_disable+0x80/0x80
        [<ffffffff814f41d1>] platform_device_del+0x21/0xc0
        [<ffffffff814f4282>] platform_device_unregister+0x12/0x30
        [<ffffffff815121d3>] mfd_remove_devices_fn+0x43/0x50
        [<ffffffff814ed3e3>] device_for_each_child+0x43/0x70
        [<ffffffff81512105>] mfd_remove_devices+0x25/0x30
        [<ffffffffa020ebd7>] sensor_hub_remove+0x87/0x140 [hid_sensor_hub]
        [<ffffffff81607c5b>] hid_device_remove+0x6b/0xd0
        [<ffffffff814f18bf>] __device_release_driver+0x7f/0xf0
        [<ffffffff814f1955>] device_release_driver+0x25/0x40
        [<ffffffff814f121c>] bus_remove_device+0x11c/0x1a0
        [<ffffffff814ed7d6>] device_del+0x136/0x1e0
        [<ffffffff81607d47>] hid_destroy_device+0x27/0x60
        [<ffffffff81616972>] usbhid_disconnect+0x22/0x50
        [<ffffffff81568597>] usb_unbind_interface+0x77/0x2b0
        [<ffffffff814f18bf>] __device_release_driver+0x7f/0xf0
        [<ffffffff814f1955>] device_release_driver+0x25/0x40
        [<ffffffff814f121c>] bus_remove_device+0x11c/0x1a0
        [<ffffffff814ed7d6>] device_del+0x136/0x1e0
        [<ffffffff81565cd1>] usb_disable_device+0x91/0x2a0
        [<ffffffff8155b046>] usb_disconnect+0x96/0x2e0
        [<ffffffff8155d74a>] hub_thread+0xb5a/0x1840
      Signed-off-by: default avatarReyad Attiyat <reyad.attiyat@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      
      (cherry picked from commit 46df9ded)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      7efab936
    • Sergio Gelato's avatar
      nfsd: fix NFS regression · 0a592908
      Sergio Gelato authored
      Fix regression introduced in pre-3.14 kernels by cherry-picking
      aa07c713 (NFSD: Call ->set_acl with a
      NULL ACL structure if no entries). This is in v3.12.22 as commit
      723ac81c.
      
      The affected code was removed in 3.14 by commit
      4ac7249e (nfsd: use get_acl
      and ->set_acl). The ->set_acl methods are already able to cope with a
      NULL argument. So this is not needed for >= 3.14.
      Signed-off-by: default avatarSergio Gelato <Sergio.Gelato@astro.su.se>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      (cherry picked from commit ba1816b4)
      
      (cherry picked from commit HEAD)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      0a592908
    • Xiubo Li's avatar
      regmap: debugfs: fix possbile NULL pointer dereference · 4370f838
      Xiubo Li authored
      If 'map->dev' is NULL and there will lead dev_name() to be NULL pointer
      dereference. So before dev_name(), we need to have check of the map->dev
      pionter.
      
      We also should make sure that the 'name' pointer shouldn't be NULL for
      debugfs_create_dir(). So here using one default "dummy" debugfs name when
      the 'name' pointer and 'map->dev' are both NULL.
      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 2c98e0c1)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      4370f838
    • Eliad Peller's avatar
      regulatory: fix misapplied alpha2 fix · f86e77ea
      Eliad Peller authored
      Upstream commit a5fe8e76 (regulatory:
      add NUL to alpha2) contained a hunk that was supposed to be applied to
      struct ieee80211_reg_rule.  However in stable 3.12 (3.12.31 in
      particular), it ended up in struct regulatory_request. Fix that now.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Eliad Peller <eliadx.peller@intel.com>
      Cc: Johannes Berg <johannes.berg@intel.com>
      (cherry picked from commit 84197d64)
      
      (cherry picked from commit HEAD)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      f86e77ea
    • Eliad Peller's avatar
      regulatory: add NUL to alpha2 · f05bbdba
      Eliad Peller authored
      alpha2 is defined as 2-chars array, but is used in multiple
      places as string (e.g. with nla_put_string calls), which
      might leak kernel data.
      
      Solve it by simply adding an extra char for the NULL
      terminator, making such operations safe.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarEliad Peller <eliadx.peller@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      
      (cherry picked from commit a5fe8e76)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      f05bbdba
    • Honggang Li's avatar
      Revert "percpu: free percpu allocation info for uniprocessor system" · 38dc4ffb
      Honggang Li authored
      This reverts commit 3189eddb ("percpu: free percpu allocation info for
      uniprocessor system").
      
      The commit causes a hang with a crisv32 image. This may be an architecture
      problem, but at least for now the revert is necessary to be able to boot a
      crisv32 image.
      
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Honggang Li <enjoymindful@gmail.com>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Fixes: 3189eddb ("percpu: free percpu allocation info for uniprocessor system")
      Cc: stable@vger.kernel.org # Please don't apply 3189eddb
      
      percpu-refcount: make percpu_ref based on longs instead of ints
      
      percpu_ref is currently based on ints and the number of refs it can
      cover is (1 << 31).  This makes it impossible to use a percpu_ref to
      count memory objects or pages on 64bit machines as it may overflow.
      This forces those users to somehow aggregate the references before
      contributing to the percpu_ref which is often cumbersome and sometimes
      challenging to get the same level of performance as using the
      percpu_ref directly.
      
      While using ints for the percpu counters makes them pack tighter on
      64bit machines, the possible gain from using ints instead of longs is
      extremely small compared to the overall gain from per-cpu operation.
      This patch makes percpu_ref based on longs so that it can be used to
      directly count memory objects or pages.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Kent Overstreet <kmo@daterainc.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      
      percpu-refcount: improve WARN messages
      
      percpu_ref's WARN messages can be a lot more helpful by indicating
      who's the culprit.  Make them report the release function that the
      offending percpu-refcount is associated with.  This should make it a
      lot easier to track down the reported invalid refcnting operations.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Kent Overstreet <kmo@daterainc.com>
      
      percpu: fix locking regression in the failure path of pcpu_alloc()
      
      While updating locking, b38d08f3 ("percpu: restructure locking")
      broke pcpu_create_chunk() creation path in pcpu_alloc().  It returns
      without releasing pcpu_alloc_mutex.  Fix it.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
      
      percpu-refcount: add @gfp to percpu_ref_init()
      
      Percpu allocator now supports allocation mask.  Add @gfp to
      percpu_ref_init() so that !GFP_KERNEL allocation masks can be used
      with percpu_refs too.
      
      This patch doesn't make any functional difference.
      
      v2: blk-mq conversion was missing.  Updated.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Kent Overstreet <koverstreet@google.com>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      
      proportions: add @gfp to init functions
      
      Percpu allocator now supports allocation mask.  Add @gfp to
      [flex_]proportions init functions so that !GFP_KERNEL allocation masks
      can be used with them too.
      
      This patch doesn't make any functional difference.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      
      percpu_counter: add @gfp to percpu_counter_init()
      
      Percpu allocator now supports allocation mask.  Add @gfp to
      percpu_counter_init() so that !GFP_KERNEL allocation masks can be used
      with percpu_counters too.
      
      We could have left percpu_counter_init() alone and added
      percpu_counter_init_gfp(); however, the number of users isn't that
      high and introducing _gfp variants to all percpu data structures would
      be quite ugly, so let's just do the conversion.  This is the one with
      the most users.  Other percpu data structures are a lot easier to
      convert.
      
      This patch doesn't make any functional difference.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarJan Kara <jack@suse.cz>
      Acked-by: default avatar"David S. Miller" <davem@davemloft.net>
      Cc: x86@kernel.org
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      
      percpu_counter: make percpu_counters_lock irq-safe
      
      percpu_counter is scheduled to grow @gfp support to allow atomic
      initialization.  This patch makes percpu_counters_lock irq-safe so
      that it can be safely used from atomic contexts.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      percpu: implement asynchronous chunk population
      
      The percpu allocator now supports atomic allocations by only
      allocating from already populated areas but the mechanism to ensure
      that there's adequate amount of populated areas was missing.
      
      This patch expands pcpu_balance_work so that in addition to freeing
      excess free chunks it also populates chunks to maintain an adequate
      level of populated areas.  pcpu_alloc() schedules pcpu_balance_work if
      the amount of free populated areas is too low or after an atomic
      allocation failure.
      
      * PERPCU_DYNAMIC_RESERVE is increased by two pages to account for
        PCPU_EMPTY_POP_PAGES_LOW.
      
      * pcpu_async_enabled is added to gate both async jobs -
        chunk->map_extend_work and pcpu_balance_work - so that we don't end
        up scheduling them while the needed subsystems aren't up yet.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      percpu: rename pcpu_reclaim_work to pcpu_balance_work
      
      pcpu_reclaim_work will also be used to populate chunks asynchronously.
      Rename it to pcpu_balance_work in preparation.  pcpu_reclaim() is
      renamed to pcpu_balance_workfn() and some of its local variables are
      renamed too.
      
      This is pure rename.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      percpu: implmeent pcpu_nr_empty_pop_pages and chunk->nr_populated
      
      pcpu_nr_empty_pop_pages counts the number of empty populated pages
      across all chunks and chunk->nr_populated counts the number of
      populated pages in a chunk.  Both will be used to implement pre/async
      population for atomic allocations.
      
      pcpu_chunk_[de]populated() are added to update chunk->populated,
      chunk->nr_populated and pcpu_nr_empty_pop_pages together.  All
      successful chunk [de]populations should be followed by the
      corresponding pcpu_chunk_[de]populated() calls.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      percpu: make sure chunk->map array has available space
      
      An allocation attempt may require extending chunk->map array which
      requires GFP_KERNEL context which isn't available for atomic
      allocations.  This patch ensures that chunk->map array usually keeps
      some amount of available space by directly allocating buffer space
      during GFP_KERNEL allocations and scheduling async extension during
      atomic ones.  This should make atomic allocation failures from map
      space exhaustion rare.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      percpu: implement [__]alloc_percpu_gfp()
      
      Now that pcpu_alloc_area() can allocate only from populated areas,
      it's easy to add atomic allocation support to [__]alloc_percpu().
      Update pcpu_alloc() so that it accepts @gfp and skips all the blocking
      operations and allocates only from the populated areas if @gfp doesn't
      contain GFP_KERNEL.  New interface functions [__]alloc_percpu_gfp()
      are added.
      
      While this means that atomic allocations are possible, this isn't
      complete yet as there's no mechanism to ensure that certain amount of
      populated areas is kept available and atomic allocations may keep
      failing under certain conditions.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      percpu: indent the population block in pcpu_alloc()
      
      The next patch will conditionalize the population block in
      pcpu_alloc() which will end up making a rather large indentation
      change obfuscating the actual logic change.  This patch puts the block
      under "if (true)" so that the next patch can avoid indentation
      changes.  The defintions of the local variables which are used only in
      the block are moved into the block.
      
      This patch is purely cosmetic.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      percpu: make pcpu_alloc_area() capable of allocating only from populated areas
      
      Update pcpu_alloc_area() so that it can skip unpopulated areas if the
      new parameter @pop_only is true.  This is implemented by a new
      function, pcpu_fit_in_area(), which determines the amount of head
      padding considering the alignment and populated state.
      
      @pop_only is currently always false but this will be used to implement
      atomic allocation.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      percpu: restructure locking
      
      At first, the percpu allocator required a sleepable context for both
      alloc and free paths and used pcpu_alloc_mutex to protect everything.
      Later, pcpu_lock was introduced to protect the index data structure so
      that the free path can be invoked from atomic contexts.  The
      conversion only updated what's necessary and left most of the
      allocation path under pcpu_alloc_mutex.
      
      The percpu allocator is planned to add support for atomic allocation
      and this patch restructures locking so that the coverage of
      pcpu_alloc_mutex is further reduced.
      
      * pcpu_alloc() now grab pcpu_alloc_mutex only while creating a new
        chunk and populating the allocated area.  Everything else is now
        protected soley by pcpu_lock.
      
        After this change, multiple instances of pcpu_extend_area_map() may
        race but the function already implements sufficient synchronization
        using pcpu_lock.
      
        This also allows multiple allocators to arrive at new chunk
        creation.  To avoid creating multiple empty chunks back-to-back, a
        new chunk is created iff there is no other empty chunk after
        grabbing pcpu_alloc_mutex.
      
      * pcpu_lock is now held while modifying chunk->populated bitmap.
        After this, all data structures are protected by pcpu_lock.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      percpu: make percpu-km set chunk->populated bitmap properly
      
      percpu-km instantiates the whole chunk on creation and doesn't make
      use of chunk->populated bitmap and leaves it as zero.  While this
      currently doesn't cause any problem, the inconsistency makes it
      difficult to build further logic on top of chunk->populated.  This
      patch makes percpu-km fill chunk->populated on creation so that the
      bitmap is always consistent.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarChristoph Lameter <cl@linux.com>
      
      percpu: move region iterations out of pcpu_[de]populate_chunk()
      
      Previously, pcpu_[de]populate_chunk() were called with the range which
      may contain multiple target regions in it and
      pcpu_[de]populate_chunk() iterated over the regions.  This has the
      benefit of batching up cache flushes for all the regions; however,
      we're planning to add more bookkeeping logic around [de]population to
      support atomic allocations and this delegation of iterations gets in
      the way.
      
      This patch moves the region iterations out of
      pcpu_[de]populate_chunk() into its callers - pcpu_alloc() and
      pcpu_reclaim() - so that we can later add logic to track more states
      around them.  This change may make cache and tlb flushes more frequent
      but multi-region [de]populations are rare anyway and if this actually
      becomes a problem, it's not difficult to factor out cache flushes as
      separate callbacks which are directly invoked from percpu.c.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      percpu: move common parts out of pcpu_[de]populate_chunk()
      
      percpu-vm and percpu-km implement separate versions of
      pcpu_[de]populate_chunk() and some part which is or should be common
      are currently in the specific implementations.  Make the following
      changes.
      
      * Allocate area clearing is moved from the pcpu_populate_chunk()
        implementations to pcpu_alloc().  This makes percpu-km's version
        noop.
      
      * Quick exit tests in pcpu_[de]populate_chunk() of percpu-vm are moved
        to their respective callers so that they are applied to percpu-km
        too.  This doesn't make any meaningful difference as both functions
        are noop for percpu-km; however, this is more consistent and will
        help implementing atomic allocation support.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      percpu: remove @may_alloc from pcpu_get_pages()
      
      pcpu_get_pages() creates the temp pages array if not already allocated
      and returns the pointer to it.  As the function is called from both
      [de]population paths and depopulation can only happen after at least
      one successful population, the param doesn't make any difference - the
      allocation will always happen on the population path anyway.
      
      Remove @may_alloc from pcpu_get_pages().  Also, add an lockdep
      assertion pcpu_alloc_mutex instead of vaguely stating that the
      exclusion is the caller's responsibility.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      percpu: remove the usage of separate populated bitmap in percpu-vm
      
      percpu-vm uses pcpu_get_pages_and_bitmap() to acquire temp pages array
      and populated bitmap and uses the two during [de]population.  The temp
      bitmap is used only to build the new bitmap that is copied to
      chunk->populated after the operation succeeds; however, the new bitmap
      can be trivially set after success without using the temp bitmap.
      
      This patch removes the temp populated bitmap usage from percpu-vm.c.
      
      * pcpu_get_pages_and_bitmap() is renamed to pcpu_get_pages() and no
        longer hands out the temp bitmap.
      
      * @populated arugment is dropped from all the related functions.
        @populated updates in pcpu_[un]map_pages() are dropped.
      
      * Two loops in pcpu_map_pages() are merged.
      
      * pcpu_[de]populated_chunk() modify chunk->populated bitmap directly
        from @page_start and @page_end after success.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarChristoph Lameter <cl@linux.com>
      
      percpu: free percpu allocation info for uniprocessor system
      
      Currently, only SMP system free the percpu allocation info.
      Uniprocessor system should free it too. For example, one x86 UML
      virtual machine with 256MB memory, UML kernel wastes one page memory.
      Signed-off-by: default avatarHonggang Li <enjoymindful@gmail.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit bb2e226b
      3189eddb)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      38dc4ffb
    • Quentin Casasnovas's avatar
      regmap: fix kernel hang on regmap_bulk_write with zero val_count. · fdb289ea
      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>
      fdb289ea
    • Ben Dooks's avatar
      ARM: probes: fix instruction fetch order with <asm/opcodes.h> · 8d122406
      Ben Dooks authored
      If we are running BE8, the data and instruction endianness do not
      match, so use <asm/opcodes.h> to correctly translate memory accesses
      into ARM instructions.
      Acked-by: default avatarJon Medhurst <tixy@linaro.org>
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      [taras.kondratiuk@linaro.org: fixed Thumb instruction fetch order]
      Signed-off-by: default avatarTaras Kondratiuk <taras.kondratiuk@linaro.org>
      
      (cherry picked from commit 888be254)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8d122406
    • Andreas Larsson's avatar
      sparc32: Implement xchg and atomic_xchg using ATOMIC_HASH locks · 3c4b3f0a
      Andreas Larsson authored
      Atomicity between xchg and cmpxchg cannot be guaranteed when xchg is
      implemented with a swap and cmpxchg is implemented with locks.
      Without this, e.g. mcs_spin_lock and mcs_spin_unlock are broken.
      Signed-off-by: default avatarAndreas Larsson <andreas@gaisler.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit 1a17fdc4)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      3c4b3f0a
    • Hans de Goede's avatar
      acer-wmi: Add acpi_backlight=video quirk for the Acer KAV80 · a4964236
      Hans de Goede authored
      The acpi-video backlight interface on the Acer KAV80 is broken, and worse
      it causes the entire machine to slow down significantly after a suspend/resume.
      
      Blacklist it, and use the acer-wmi backlight interface instead. Note that
      the KAV80 is somewhat unique in that it is the only Acer model where we
      fall back to acer-wmi after blacklisting, rather then using the native
      (e.g. intel) backlight driver. This is done because there is no native
      backlight interface on this model.
      
      BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1128309
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
      
      (cherry picked from commit 183fd8fc)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a4964236
    • Felipe Balbi's avatar
      usb: gadget: udc: core: fix kernel oops with soft-connect · 315113d5
      Felipe Balbi authored
      Currently, there's no guarantee that udc->driver
      will be valid when using soft_connect sysfs
      interface. In fact, we can very easily trigger
      a NULL pointer dereference by trying to disconnect
      when a gadget driver isn't loaded.
      
      Fix this bug:
      
      ~# echo disconnect > soft_connect
      [   33.685743] Unable to handle kernel NULL pointer dereference at virtual address 00000014
      [   33.694221] pgd = ed0cc000
      [   33.697174] [00000014] *pgd=ae351831, *pte=00000000, *ppte=00000000
      [   33.703766] Internal error: Oops: 17 [#1] SMP ARM
      [   33.708697] Modules linked in: xhci_plat_hcd xhci_hcd snd_soc_davinci_mcasp snd_soc_tlv320aic3x snd_soc_edma snd_soc_omap snd_soc_evm snd_soc_core dwc3 snd_compress snd_pcm_dmaengine snd_pcm snd_timer snd lis3lv02d_i2c matrix_keypad lis3lv02d dwc3_omap input_polldev soundcore
      [   33.734372] CPU: 0 PID: 1457 Comm: bash Not tainted 3.17.0-09740-ga93416e-dirty #345
      [   33.742457] task: ee71ce00 ti: ee68a000 task.ti: ee68a000
      [   33.748116] PC is at usb_udc_softconn_store+0xa4/0xec
      [   33.753416] LR is at mark_held_locks+0x78/0x90
      [   33.758057] pc : [<c04df128>]    lr : [<c00896a4>]    psr: 20000013
      [   33.758057] sp : ee68bec8  ip : c0c00008  fp : ee68bee4
      [   33.770050] r10: ee6b394c  r9 : ee68bf80  r8 : ee6062c0
      [   33.775508] r7 : 00000000  r6 : ee6062c0  r5 : 0000000b  r4 : ee739408
      [   33.782346] r3 : 00000000  r2 : 00000000  r1 : ee71d390  r0 : ee664170
      [   33.789168] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      [   33.796636] Control: 10c5387d  Table: ad0cc059  DAC: 00000015
      [   33.802638] Process bash (pid: 1457, stack limit = 0xee68a248)
      [   33.808740] Stack: (0xee68bec8 to 0xee68c000)
      [   33.813299] bec0:                   0000000b c0411284 ee6062c0 00000000 ee68bef4 ee68bee8
      [   33.821862] bee0: c04112ac c04df090 ee68bf14 ee68bef8 c01c2868 c0411290 0000000b ee6b3940
      [   33.830419] bf00: 00000000 00000000 ee68bf4c ee68bf18 c01c1a24 c01c2818 00000000 00000000
      [   33.838990] bf20: ee61b940 ee2f47c0 0000000b 000ce408 ee68bf80 c000f304 ee68a000 00000000
      [   33.847544] bf40: ee68bf7c ee68bf50 c0152dd8 c01c1960 ee68bf7c c0170af8 ee68bf7c ee2f47c0
      [   33.856099] bf60: ee2f47c0 000ce408 0000000b c000f304 ee68bfa4 ee68bf80 c0153330 c0152d34
      [   33.864653] bf80: 00000000 00000000 0000000b 000ce408 b6e7fb50 00000004 00000000 ee68bfa8
      [   33.873204] bfa0: c000f080 c01532e8 0000000b 000ce408 00000001 000ce408 0000000b 00000000
      [   33.881763] bfc0: 0000000b 000ce408 b6e7fb50 00000004 0000000b 00000000 000c5758 00000000
      [   33.890319] bfe0: 00000000 bec2c924 b6de422d b6e1d226 40000030 00000001 75716d2f 00657565
      [   33.898890] [<c04df128>] (usb_udc_softconn_store) from [<c04112ac>] (dev_attr_store+0x28/0x34)
      [   33.907920] [<c04112ac>] (dev_attr_store) from [<c01c2868>] (sysfs_kf_write+0x5c/0x60)
      [   33.916200] [<c01c2868>] (sysfs_kf_write) from [<c01c1a24>] (kernfs_fop_write+0xd0/0x194)
      [   33.924773] [<c01c1a24>] (kernfs_fop_write) from [<c0152dd8>] (vfs_write+0xb0/0x1bc)
      [   33.932874] [<c0152dd8>] (vfs_write) from [<c0153330>] (SyS_write+0x54/0xb0)
      [   33.940247] [<c0153330>] (SyS_write) from [<c000f080>] (ret_fast_syscall+0x0/0x48)
      [   33.948160] Code: e1a01007 e12fff33 e5140004 e5143008 (e5933014)
      [   33.954625] ---[ end trace f849bead94eab7ea ]---
      
      Fixes: 2ccea03a (usb: gadget: introduce UDC Class)
      Cc: <stable@vger.kernel.org> # v3.1+
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      
      (cherry picked from commit bfa6b18c)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      315113d5
    • Felipe Balbi's avatar
      usb: gadget: function: acm: make f_acm pass USB20CV Chapter9 · 582af8f4
      Felipe Balbi authored
      During Halt Endpoint Test, our interrupt endpoint
      will be disabled, which will clear out ep->desc
      to NULL. Unless we call config_ep_by_speed() again,
      we will not be able to enable this endpoint which
      will make us fail that test.
      
      Fixes: f9c56cdd (usb: gadget: Clear usb_endpoint_descriptor
      	inside the struct usb_ep on disable)
      Cc: <stable@vger.kernel.org> # v3.4+
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      
      (cherry picked from commit 52ec49a5)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      582af8f4
    • Mathias Krause's avatar
      posix-timers: Fix stack info leak in timer_create() · 5a46a0be
      Mathias Krause authored
      If userland creates a timer without specifying a sigevent info, we'll
      create one ourself, using a stack local variable. Particularly will we
      use the timer ID as sival_int. But as sigev_value is a union containing
      a pointer and an int, that assignment will only partially initialize
      sigev_value on systems where the size of a pointer is bigger than the
      size of an int. On such systems we'll copy the uninitialized stack bytes
      from the timer_create() call to userland when the timer actually fires
      and we're going to deliver the signal.
      
      Initialize sigev_value with 0 to plug the stack info leak.
      
      Found in the PaX patch, written by the PaX Team.
      
      Fixes: 5a9fa730 ("posix-timers: kill ->it_sigev_signo and...")
      Signed-off-by: default avatarMathias Krause <minipli@googlemail.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Brad Spengler <spender@grsecurity.net>
      Cc: PaX Team <pageexec@freemail.hu>
      Cc: <stable@vger.kernel.org>	# v2.6.28+
      Link: http://lkml.kernel.org/r/1412456799-32339-1-git-send-email-minipli@googlemail.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      
      (cherry picked from commit 6891c450)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      5a46a0be
    • Johan Hovold's avatar
      USB: core: add device-qualifier quirk · 261f1b7d
      Johan Hovold authored
      Add new quirk for devices that cannot handle requests for the
      device_qualifier descriptor.
      
      A USB-2.0 compliant device must respond to requests for the
      device_qualifier descriptor (even if it's with a request error), but at
      least one device is known to misbehave after such a request.
      Suggested-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit 2a159389)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      261f1b7d