Skip to content
  1. Dec 01, 2021
    • Pali Rohár's avatar
      PCI: aardvark: Don't touch PCIe registers if no card connected · 62d87e12
      Pali Rohár authored
      commit 70e38025 upstream.
      
      When there is no PCIe card connected and advk_pcie_rd_conf() or
      advk_pcie_wr_conf() is called for PCI bus which doesn't belong to emulated
      root bridge, the aardvark driver throws the following error message:
      
        advk-pcie d0070000.pcie: config read/write timed out
      
      Obviously accessing PCIe registers of disconnected card is not possible.
      
      Extend check in advk_pcie_valid_device() function for validating
      availability of PCIe bus. If PCIe link is down, then the device is marked
      as Not Found and the driver does not try to access these registers.
      
      This is just an optimization to prevent accessing PCIe registers when card
      is disconnected. Trying to access PCIe registers of disconnected card does
      not cause any crash, kernel just needs to wait for a timeout. So if card
      disappear immediately after checking for PCIe link (before accessing PCIe
      registers), it does not cause any problems.
      
      Link: https://lore.kernel.org/r/20200702083036.12230-1-pali@kernel.org
      
      
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      62d87e12
    • Pali Rohár's avatar
      PCI: aardvark: Indicate error in 'val' when config read fails · 26fa8b31
      Pali Rohár authored
      commit b1bd5714 upstream.
      
      Most callers of config read do not check for return value. But most of the
      ones that do, checks for error indication in 'val' variable.
      
      This patch updates error handling in advk_pcie_rd_conf() function. If PIO
      transfer fails then 'val' variable is set to 0xffffffff which indicates
      failture.
      
      Link: https://lore.kernel.org/r/20200528162604.GA323482@bjorn-Precision-5520
      Link: https://lore.kernel.org/r/20200601130315.18895-1-pali@kernel.org
      
      
      Reported-by: default avatarBjorn Helgaas <helgaas@kernel.org>
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      26fa8b31
    • Pali Rohár's avatar
      PCI: aardvark: Replace custom macros by standard linux/pci_regs.h macros · 388ae5f8
      Pali Rohár authored
      commit 96be36db upstream.
      
      PCI-E capability macros are already defined in linux/pci_regs.h.
      Remove their reimplementation in pcie-aardvark.
      
      Link: https://lore.kernel.org/r/20200430080625.26070-9-pali@kernel.org
      
      
      Tested-by: default avatarTomasz Maciej Nowak <tmn505@gmail.com>
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      388ae5f8
    • Pali Rohár's avatar
      PCI: aardvark: Issue PERST via GPIO · 202a82b3
      Pali Rohár authored
      commit 5169a985 upstream.
      
      Add support for issuing PERST via GPIO specified in 'reset-gpios'
      property (as described in PCI device tree bindings).
      
      Some buggy cards (e.g. Compex WLE900VX or WLE1216) are not detected
      after reboot when PERST is not issued during driver initialization.
      
      If bootloader already enabled link training then issuing PERST has no
      effect for some buggy cards (e.g. Compex WLE900VX) and these cards are
      not detected. We therefore clear the LINK_TRAINING_EN register before.
      
      It was observed that Compex WLE900VX card needs to be in PERST reset
      for at least 10ms if bootloader enabled link training.
      
      Tested on Turris MOX.
      
      Link: https://lore.kernel.org/r/20200430080625.26070-6-pali@kernel.org
      
      
      Tested-by: default avatarTomasz Maciej Nowak <tmn505@gmail.com>
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      202a82b3
    • Marek Behún's avatar
      PCI: aardvark: Improve link training · 83e88068
      Marek Behún authored
      commit 43fc679c upstream.
      
      Currently the aardvark driver trains link in PCIe gen2 mode. This may
      cause some buggy gen1 cards (such as Compex WLE900VX) to be unstable or
      even not detected. Moreover when ASPM code tries to retrain link second
      time, these cards may stop responding and link goes down. If gen1 is
      used this does not happen.
      
      Unconditionally forcing gen1 is not a good solution since it may have
      performance impact on gen2 cards.
      
      To overcome this, read 'max-link-speed' property (as defined in PCI
      device tree bindings) and use this as max gen mode. Then iteratively try
      link training at this mode or lower until successful. After successful
      link training choose final controller gen based on Negotiated Link Speed
      from Link Status register, which should match card speed.
      
      Link: https://lore.kernel.org/r/20200430080625.26070-5-pali@kernel.org
      
      
      Tested-by: default avatarTomasz Maciej Nowak <tmn505@gmail.com>
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      83e88068
    • Pali Rohár's avatar
      PCI: aardvark: Train link immediately after enabling training · 0ca4db36
      Pali Rohár authored
      commit 69644945 upstream.
      
      Adding even 100ms (PCI_PM_D3COLD_WAIT) delay between enabling link
      training and starting link training causes detection issues with some
      buggy cards (such as Compex WLE900VX).
      
      Move the code which enables link training immediately before the one
      which starts link traning.
      
      This fixes detection issues of Compex WLE900VX card on Turris MOX after
      cold boot.
      
      Link: https://lore.kernel.org/r/20200430080625.26070-2-pali@kernel.org
      Fixes: f4c7d053
      
       ("PCI: aardvark: Wait for endpoint to be ready...")
      Tested-by: default avatarTomasz Maciej Nowak <tmn505@gmail.com>
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0ca4db36
    • Remi Pommarel's avatar
      PCI: aardvark: Wait for endpoint to be ready before training link · 78c6ab8e
      Remi Pommarel authored
      commit f4c7d053
      
       upstream.
      
      When configuring pcie reset pin from gpio (e.g. initially set by
      u-boot) to pcie function this pin goes low for a brief moment
      asserting the PERST# signal. Thus connected device enters fundamental
      reset process and link configuration can only begin after a minimal
      100ms delay (see [1]).
      
      Because the pin configuration comes from the "default" pinctrl it is
      implicitly configured before the probe callback is called:
      
      driver_probe_device()
        really_probe()
          ...
          pinctrl_bind_pins() /* Here pin goes from gpio to PCIE reset
                                 function and PERST# is asserted */
          ...
          drv->probe()
      
      [1] "PCI Express Base Specification", REV. 4.0
          PCI Express, February 19 2014, 6.6.1 Conventional Reset
      
      Signed-off-by: default avatarRemi Pommarel <repk@triplefau.lt>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      78c6ab8e
    • Wen Yang's avatar
      PCI: aardvark: Fix a leaked reference by adding missing of_node_put() · 53c71a91
      Wen Yang authored
      commit 3842f516
      
       upstream.
      
      The call to of_get_next_child() returns a node pointer with refcount
      incremented thus it must be explicitly decremented after the last
      usage.
      
      irq_domain_add_linear() also calls of_node_get() to increase refcount,
      so irq_domain will not be affected when it is released.
      
      Detected by coccinelle with the following warnings:
        ./drivers/pci/controller/pci-aardvark.c:826:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 798, but without a corresponding object release within this function.
      
      Signed-off-by: default avatarWen Yang <wen.yang99@zte.com.cn>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: linux-pci@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      53c71a91
    • David Hildenbrand's avatar
      proc/vmcore: fix clearing user buffer by properly using clear_user() · 9ef384ed
      David Hildenbrand authored
      commit c1e63117 upstream.
      
      To clear a user buffer we cannot simply use memset, we have to use
      clear_user().  With a virtio-mem device that registers a vmcore_cb and
      has some logically unplugged memory inside an added Linux memory block,
      I can easily trigger a BUG by copying the vmcore via "cp":
      
        systemd[1]: Starting Kdump Vmcore Save Service...
        kdump[420]: Kdump is using the default log level(3).
        kdump[453]: saving to /sysroot/var/crash/127.0.0.1-2021-11-11-14:59:22/
        kdump[458]: saving vmcore-dmesg.txt to /sysroot/var/crash/127.0.0.1-2021-11-11-14:59:22/
        kdump[465]: saving vmcore-dmesg.txt complete
        kdump[467]: saving vmcore
        BUG: unable to handle page fault for address: 00007f2374e01000
        #PF: supervisor write access in kernel mode
        #PF: error_code(0x0003) - permissions violation
        PGD 7a523067 P4D 7a523067 PUD 7a528067 PMD 7a525067 PTE 800000007048f867
        Oops: 0003 [#1] PREEMPT SMP NOPTI
        CPU: 0 PID: 468 Comm: cp Not tainted 5.15.0+ #6
        Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.14.0-27-g64f37cc530f1-prebuilt.qemu.org 04/01/2014
        RIP: 0010:read_from_oldmem.part.0.cold+0x1d/0x86
        Code: ff ff ff e8 05 ff fe ff e9 b9 e9 7f ff 48 89 de 48 c7 c7 38 3b 60 82 e8 f1 fe fe ff 83 fd 08 72 3c 49 8d 7d 08 4c 89 e9 89 e8 <49> c7 45 00 00 00 00 00 49 c7 44 05 f8 00 00 00 00 48 83 e7 f81
        RSP: 0018:ffffc9000073be08 EFLAGS: 00010212
        RAX: 0000000000001000 RBX: 00000000002fd000 RCX: 00007f2374e01000
        RDX: 0000000000000001 RSI: 00000000ffffdfff RDI: 00007f2374e01008
        RBP: 0000000000001000 R08: 0000000000000000 R09: ffffc9000073bc50
        R10: ffffc9000073bc48 R11: ffffffff829461a8 R12: 000000000000f000
        R13: 00007f2374e01000 R14: 0000000000000000 R15: ffff88807bd421e8
        FS:  00007f2374e12140(0000) GS:ffff88807f000000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 00007f2374e01000 CR3: 000000007a4aa000 CR4: 0000000000350eb0
        Call Trace:
         read_vmcore+0x236/0x2c0
         proc_reg_read+0x55/0xa0
         vfs_read+0x95/0x190
         ksys_read+0x4f/0xc0
         do_syscall_64+0x3b/0x90
         entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Some x86-64 CPUs have a CPU feature called "Supervisor Mode Access
      Prevention (SMAP)", which is used to detect wrong access from the kernel
      to user buffers like this: SMAP triggers a permissions violation on
      wrong access.  In the x86-64 variant of clear_user(), SMAP is properly
      handled via clac()+stac().
      
      To fix, properly use clear_user() when we're dealing with a user buffer.
      
      Link: https://lkml.kernel.org/r/20211112092750.6921-1-david@redhat.com
      Fixes: 997c136f
      
       ("fs/proc/vmcore.c: add hook to read_from_oldmem() to check for non-ram pages")
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Acked-by: default avatarBaoquan He <bhe@redhat.com>
      Cc: Dave Young <dyoung@redhat.com>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Vivek Goyal <vgoyal@redhat.com>
      Cc: Philipp Rudo <prudo@redhat.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9ef384ed
    • Randy Dunlap's avatar
      xtensa: use CONFIG_USE_OF instead of CONFIG_OF · 6e6cc157
      Randy Dunlap authored
      commit d67ed251 upstream.
      
      CONFIG_OF can be set by a randconfig or by a user -- without setting the
      early flattree option (OF_EARLY_FLATTREE).  This causes build errors.
      However, if randconfig or a user sets USE_OF in the Xtensa config,
      the right kconfig symbols are set to fix the build.
      
      Fixes these build errors:
      
      ../arch/xtensa/kernel/setup.c:67:19: error: ‘__dtb_start’ undeclared here (not in a function); did you mean ‘dtb_start’?
         67 | void *dtb_start = __dtb_start;
            |                   ^~~~~~~~~~~
      ../arch/xtensa/kernel/setup.c: In function 'xtensa_dt_io_area':
      ../arch/xtensa/kernel/setup.c:201:14: error: implicit declaration of function 'of_flat_dt_is_compatible'; did you mean 'of_machine_is_compatible'? [-Werror=implicit-function-declaration]
        201 |         if (!of_flat_dt_is_compatible(node, "simple-bus"))
      ../arch/xtensa/kernel/setup.c:204:18: error: implicit declaration of function 'of_get_flat_dt_prop' [-Werror=implicit-function-declaration]
        204 |         ranges = of_get_flat_dt_prop(node, "ranges", &len);
      ../arch/xtensa/kernel/setup.c:204:16: error: assignment to 'const __be32 *' {aka 'const unsigned int *'} from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
        204 |         ranges = of_get_flat_dt_prop(node, "ranges", &len);
            |                ^
      ../arch/xtensa/kernel/setup.c: In function 'early_init_devtree':
      ../arch/xtensa/kernel/setup.c:228:9: error: implicit declaration of function 'early_init_dt_scan'; did you mean 'early_init_devtree'? [-Werror=implicit-function-declaration]
        228 |         early_init_dt_scan(params);
      ../arch/xtensa/kernel/setup.c:229:9: error: implicit declaration of function 'of_scan_flat_dt' [-Werror=implicit-function-declaration]
        229 |         of_scan_flat_dt(xtensa_dt_io_area, NULL);
      
      xtensa-elf-ld: arch/xtensa/mm/mmu.o:(.text+0x0): undefined reference to `xtensa_kio_paddr'
      
      Fixes: da844a81 ("xtensa: add device trees support")
      Fixes: 6cb97111
      
       ("xtensa: remap io area defined in device tree")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6e6cc157
    • Steven Rostedt (VMware)'s avatar
      tracing: Fix pid filtering when triggers are attached · bbaf4fe5
      Steven Rostedt (VMware) authored
      commit a55f224f upstream.
      
      If a event is filtered by pid and a trigger that requires processing of
      the event to happen is a attached to the event, the discard portion does
      not take the pid filtering into account, and the event will then be
      recorded when it should not have been.
      
      Cc: stable@vger.kernel.org
      Fixes: 3fdaf80f
      
       ("tracing: Implement event pid filtering")
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bbaf4fe5
    • Stefano Stabellini's avatar
      xen: detect uninitialized xenbus in xenbus_init · 8963bf33
      Stefano Stabellini authored
      commit 36e8f60f
      
       upstream.
      
      If the xenstore page hasn't been allocated properly, reading the value
      of the related hvm_param (HVM_PARAM_STORE_PFN) won't actually return
      error. Instead, it will succeed and return zero. Instead of attempting
      to xen_remap a bad guest physical address, detect this condition and
      return early.
      
      Note that although a guest physical address of zero for
      HVM_PARAM_STORE_PFN is theoretically possible, it is not a good choice
      and zero has never been validly used in that capacity.
      
      Also recognize all bits set as an invalid value.
      
      For 32-bit Linux, any pfn above ULONG_MAX would get truncated. Pfns
      above ULONG_MAX should never be passed by the Xen tools to HVM guests
      anyway, so check for this condition and return early.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@xilinx.com>
      Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarJan Beulich <jbeulich@suse.com>
      Link: https://lore.kernel.org/r/20211123210748.1910236-1-sstabellini@kernel.org
      
      
      Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8963bf33
    • Stefano Stabellini's avatar
      xen: don't continue xenstore initialization in case of errors · 3ce18bda
      Stefano Stabellini authored
      commit 08f6c2b0
      
       upstream.
      
      In case of errors in xenbus_init (e.g. missing xen_store_gfn parameter),
      we goto out_error but we forget to reset xen_store_domain_type to
      XS_UNKNOWN. As a consequence xenbus_probe_initcall and other initcalls
      will still try to initialize xenstore resulting into a crash at boot.
      
      [    2.479830] Call trace:
      [    2.482314]  xb_init_comms+0x18/0x150
      [    2.486354]  xs_init+0x34/0x138
      [    2.489786]  xenbus_probe+0x4c/0x70
      [    2.498432]  xenbus_probe_initcall+0x2c/0x7c
      [    2.503944]  do_one_initcall+0x54/0x1b8
      [    2.507358]  kernel_init_freeable+0x1ac/0x210
      [    2.511617]  kernel_init+0x28/0x130
      [    2.516112]  ret_from_fork+0x10/0x20
      
      Cc: <Stable@vger.kernel.org>
      Cc: jbeulich@suse.com
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@xilinx.com>
      Link: https://lore.kernel.org/r/20211115222719.2558207-1-sstabellini@kernel.org
      
      
      Reviewed-by: default avatarJan Beulich <jbeulich@suse.com>
      Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3ce18bda
    • Miklos Szeredi's avatar
      fuse: fix page stealing · 65f1f3eb
      Miklos Szeredi authored
      commit 712a9510
      
       upstream.
      
      It is possible to trigger a crash by splicing anon pipe bufs to the fuse
      device.
      
      The reason for this is that anon_pipe_buf_release() will reuse buf->page if
      the refcount is 1, but that page might have already been stolen and its
      flags modified (e.g. PG_lru added).
      
      This happens in the unlikely case of fuse_dev_splice_write() getting around
      to calling pipe_buf_release() after a page has been stolen, added to the
      page cache and removed from the page cache.
      
      Fix by calling pipe_buf_release() right after the page was inserted into
      the page cache.  In this case the page has an elevated refcount so any
      release function will know that the page isn't reusable.
      
      Reported-by: default avatarFrank Dinoff <fdinoff@google.com>
      Link: https://lore.kernel.org/r/CAAmZXrsGg2xsP1CK+cbuEMumtrqdvD-NKnWzhNcvn71RV3c1yw@mail.gmail.com/
      Fixes: dd3bb14f
      
       ("fuse: support splice() writing to fuse device")
      Cc: <stable@vger.kernel.org> # v2.6.35
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      65f1f3eb
    • Dan Carpenter's avatar
      staging: rtl8192e: Fix use after free in _rtl92e_pci_disconnect() · bca19bb2
      Dan Carpenter authored
      commit b535917c upstream.
      
      The free_rtllib() function frees the "dev" pointer so there is use
      after free on the next line.  Re-arrange things to avoid that.
      
      Fixes: 66898177
      
       ("staging: rtl8192e: Fix unload/reload problem")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Link: https://lore.kernel.org/r/20211117072016.GA5237@kili
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bca19bb2
    • Jason Gerecke's avatar
      HID: wacom: Use "Confidence" flag to prevent reporting invalid contacts · 5bb56019
      Jason Gerecke authored
      commit 7fb0413b upstream.
      
      The HID descriptor of many of Wacom's touch input devices include a
      "Confidence" usage that signals if a particular touch collection contains
      useful data. The driver does not look at this flag, however, which causes
      even invalid contacts to be reported to userspace. A lucky combination of
      kernel event filtering and device behavior (specifically: contact ID 0 ==
      invalid, contact ID >0 == valid; and order all data so that all valid
      contacts are reported before any invalid contacts) spare most devices from
      any visibly-bad behavior.
      
      The DTH-2452 is one example of an unlucky device that misbehaves. It uses
      ID 0 for both the first valid contact and all invalid contacts. Because
      we report both the valid and invalid contacts, the kernel reports that
      contact 0 first goes down (valid) and then goes up (invalid) in every
      report. This causes ~100 clicks per second simply by touching the screen.
      
      This patch inroduces new `confidence` flag in our `hid_data` structure.
      The value is initially set to `true` at the start of a report and can be
      set to `false` if an invalid touch usage is seen.
      
      Link: https://github.com/linuxwacom/input-wacom/issues/270
      Fixes: f8b6a747
      
       ("HID: wacom: generic: Support multiple tools per report")
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      Tested-by: default avatarJoshua Dickens <joshua.dickens@wacom.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5bb56019
    • Hans Verkuil's avatar
      media: cec: copy sequence field for the reply · e4ca6cbd
      Hans Verkuil authored
      commit 13cbaa4c
      
       upstream.
      
      When the reply for a non-blocking transmit arrives, the sequence
      field for that reply was never filled in, so userspace would have no
      way of associating the reply to the original transmit.
      
      Copy the sequence field to ensure that this is now possible.
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Fixes: 0dbacebe
      
       ([media] cec: move the CEC framework out of staging and to media)
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e4ca6cbd
    • Takashi Iwai's avatar
      ALSA: ctxfi: Fix out-of-range access · de8f8b39
      Takashi Iwai authored
      commit 76c47183 upstream.
      
      The master and next_conj of rcs_ops are used for iterating the
      resource list entries, and currently those are supposed to return the
      current value.  The problem is that next_conf may go over the last
      entry before the loop abort condition is evaluated, and it may return
      the "current" value that is beyond the array size.  It was caught
      recently as a GPF, for example.
      
      Those return values are, however, never actually evaluated, hence
      basically we don't have to consider the current value as the return at
      all.  By dropping those return values, the potential out-of-range
      access above is also fixed automatically.
      
      This patch changes the return type of master and next_conj callbacks
      to void and drop the superfluous code accordingly.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214985
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20211118215729.26257-1-tiwai@suse.de
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      de8f8b39
    • Todd Kjos's avatar
      binder: fix test regression due to sender_euid change · c3b9f29f
      Todd Kjos authored
      commit c21a80ca upstream.
      
      This is a partial revert of commit
      29bc22ac ("binder: use euid from cred instead of using task").
      Setting sender_euid using proc->cred caused some Android system test
      regressions that need further investigation. It is a partial
      reversion because subsequent patches rely on proc->cred.
      
      Fixes: 29bc22ac
      
       ("binder: use euid from cred instead of using task")
      Cc: stable@vger.kernel.org # 4.4+
      Acked-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: default avatarTodd Kjos <tkjos@google.com>
      Change-Id: I9b1769a3510fed250bb21859ef8beebabe034c66
      Link: https://lore.kernel.org/r/20211112180720.2858135-1-tkjos@google.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c3b9f29f
    • Mathias Nyman's avatar
      usb: hub: Fix locking issues with address0_mutex · 84a43ffa
      Mathias Nyman authored
      commit 6cca13de upstream.
      
      Fix the circular lock dependency and unbalanced unlock of addess0_mutex
      introduced when fixing an address0_mutex enumeration retry race in commit
      ae6dc22d2d1 ("usb: hub: Fix usb enumeration issue due to address0 race")
      
      Make sure locking order between port_dev->status_lock and address0_mutex
      is correct, and that address0_mutex is not unlocked in hub_port_connect
      "done:" codepath which may be reached without locking address0_mutex
      
      Fixes: 6ae6dc22
      
       ("usb: hub: Fix usb enumeration issue due to address0 race")
      Cc: <stable@vger.kernel.org>
      Reported-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
      Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Acked-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Link: https://lore.kernel.org/r/20211123101656.1113518-1-mathias.nyman@linux.intel.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      84a43ffa
    • Mathias Nyman's avatar
      usb: hub: Fix usb enumeration issue due to address0 race · b8416a09
      Mathias Nyman authored
      commit 6ae6dc22 upstream.
      
      xHC hardware can only have one slot in default state with address 0
      waiting for a unique address at a time, otherwise "undefined behavior
      may occur" according to xhci spec 5.4.3.4
      
      The address0_mutex exists to prevent this across both xhci roothubs.
      
      If hub_port_init() fails, it may unlock the mutex and exit with a xhci
      slot in default state. If the other xhci roothub calls hub_port_init()
      at this point we end up with two slots in default state.
      
      Make sure the address0_mutex protects the slot default state across
      hub_port_init() retries, until slot is addressed or disabled.
      
      Note, one known minor case is not fixed by this patch.
      If device needs to be reset during resume, but fails all hub_port_init()
      retries in usb_reset_and_verify_device(), then it's possible the slot is
      still left in default state when address0_mutex is unlocked.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 638139eb
      
       ("usb: hub: allow to process more usb hub events in parallel")
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Link: https://lore.kernel.org/r/20211115221630.871204-1-mathias.nyman@linux.intel.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b8416a09
    • Nathan Chancellor's avatar
      usb: dwc2: hcd_queue: Fix use of floating point literal · c964b1bb
      Nathan Chancellor authored
      commit 310780e8 upstream.
      
      A new commit in LLVM causes an error on the use of 'long double' when
      '-mno-x87' is used, which the kernel does through an alias,
      '-mno-80387' (see the LLVM commit below for more details around why it
      does this).
      
       drivers/usb/dwc2/hcd_queue.c:1744:25: error: expression requires  'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it
                               delay = ktime_set(0, DWC2_RETRY_WAIT_DELAY);
                                                   ^
       drivers/usb/dwc2/hcd_queue.c:62:34: note: expanded from macro 'DWC2_RETRY_WAIT_DELAY'
       #define DWC2_RETRY_WAIT_DELAY (1 * 1E6L)
                                       ^
       1 error generated.
      
      This happens due to the use of a 'long double' literal. The 'E6' part of
      '1E6L' causes the literal to be a 'double' then the 'L' suffix promotes
      it to 'long double'.
      
      There is no visible reason for a floating point value in this driver, as
      the value is only used as a parameter to a function that expects an
      integer type. Use NSEC_PER_MSEC, which is the same integer value as
      '1E6L', to avoid changing functionality but fix the error.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/1497
      Link: https://github.com/llvm/llvm-project/commit/a8083d42b1c346e21623a1d36d1f0cadd7801d83
      Fixes: 6ed30a7d
      
       ("usb: dwc2: host: use hrtimer for NAK retries")
      Cc: stable <stable@vger.kernel.org>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarJohn Keeping <john@metanate.com>
      Acked-by: default avatarMinas Harutyunyan <Minas.Harutyunyan@synopsys.com>
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Link: https://lore.kernel.org/r/20211105145802.2520658-1-nathan@kernel.org
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c964b1bb
    • Mingjie Zhang's avatar
      USB: serial: option: add Fibocom FM101-GL variants · d9de0adf
      Mingjie Zhang authored
      commit 88459e3e
      
       upstream.
      
      Update the USB serial option driver support for the Fibocom
      FM101-GL Cat.6
      LTE modules as there are actually several different variants.
      - VID:PID 2cb7:01a2, FM101-GL are laptop M.2 cards (with
        MBIM interfaces for /Linux/Chrome OS)
      - VID:PID 2cb7:01a4, FM101-GL for laptop debug M.2 cards(with adb
        interface for /Linux/Chrome OS)
      
      0x01a2: mbim, tty, tty, diag, gnss
      0x01a4: mbim, diag, tty, adb, gnss, gnss
      
      Here are the outputs of lsusb -v and usb-devices:
      
      T:  Bus=02 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 86 Spd=5000 MxCh= 0
      D:  Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
      P:  Vendor=2cb7 ProdID=01a2 Rev= 5.04
      S:  Manufacturer=Fibocom Wireless Inc.
      S:  Product=Fibocom FM101-GL Module
      S:  SerialNumber=673326ce
      C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA
      A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
      I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
      I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=(none)
      I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=(none)
      I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=(none)
      I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=(none)
      
      Bus 002 Device 084: ID 2cb7:01a2 Fibocom Wireless Inc. Fibocom FM101-GL Module
      Device Descriptor:
        bLength                18
        bDescriptorType         1
        bcdUSB               3.20
        bDeviceClass            0
        bDeviceSubClass         0
        bDeviceProtocol         0
        bMaxPacketSize0         9
        idVendor           0x2cb7
        idProduct          0x01a2
        bcdDevice            5.04
        iManufacturer           1 Fibocom Wireless Inc.
        iProduct                2 Fibocom FM101-GL Module
        iSerial                 3 673326ce
        bNumConfigurations      1
        Configuration Descriptor:
          bLength                 9
          bDescriptorType         2
          wTotalLength       0x015d
          bNumInterfaces          6
          bConfigurationValue     1
          iConfiguration          4 MBIM_DUN_DUN_DIAG_NMEA
          bmAttributes         0xa0
            (Bus Powered)
            Remote Wakeup
          MaxPower              896mA
          Interface Association:
            bLength                 8
            bDescriptorType        11
            bFirstInterface         0
            bInterfaceCount         2
            bFunctionClass          2 Communications
            bFunctionSubClass      14
            bFunctionProtocol       0
            iFunction               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        0
            bAlternateSetting       0
            bNumEndpoints           1
            bInterfaceClass         2 Communications
            bInterfaceSubClass     14
            bInterfaceProtocol      0
            iInterface              5 Fibocom FM101-GL LTE Modem
            CDC Header:
              bcdCDC               1.10
            CDC Union:
              bMasterInterface        0
              bSlaveInterface         1
            CDC MBIM:
              bcdMBIMVersion       1.00
              wMaxControlMessage   4096
              bNumberFilters       32
              bMaxFilterSize       128
              wMaxSegmentSize      2048
              bmNetworkCapabilities 0x20
                8-byte ntb input size
            CDC MBIM Extended:
              bcdMBIMExtendedVersion           1.00
              bMaxOutstandingCommandMessages     64
              wMTU                             1500
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x81  EP 1 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0040  1x 64 bytes
              bInterval               9
              bMaxBurst               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        1
            bAlternateSetting       0
            bNumEndpoints           0
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0
            bInterfaceProtocol      2
            iInterface              0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        1
            bAlternateSetting       1
            bNumEndpoints           2
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0
            bInterfaceProtocol      2
            iInterface              6 MBIM Data
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x8e  EP 14 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               6
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x0f  EP 15 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               2
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        2
            bAlternateSetting       0
            bNumEndpoints           3
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass    255 Vendor Specific Subclass
            bInterfaceProtocol     64
            iInterface              0
            ** UNRECOGNIZED:  05 24 00 10 01
            ** UNRECOGNIZED:  05 24 01 00 00
            ** UNRECOGNIZED:  04 24 02 02
            ** UNRECOGNIZED:  05 24 06 00 00
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x83  EP 3 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x000a  1x 10 bytes
              bInterval               9
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x82  EP 2 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x01  EP 1 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        3
            bAlternateSetting       0
            bNumEndpoints           3
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass    255 Vendor Specific Subclass
            bInterfaceProtocol     64
            iInterface              0
            ** UNRECOGNIZED:  05 24 00 10 01
            ** UNRECOGNIZED:  05 24 01 00 00
            ** UNRECOGNIZED:  04 24 02 02
            ** UNRECOGNIZED:  05 24 06 00 00
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x85  EP 5 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x000a  1x 10 bytes
              bInterval               9
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x84  EP 4 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x02  EP 2 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        4
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass    255 Vendor Specific Subclass
            bInterfaceProtocol     48
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x03  EP 3 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x86  EP 6 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        5
            bAlternateSetting       0
            bNumEndpoints           3
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass      0
            bInterfaceProtocol     64
            iInterface              0
            ** UNRECOGNIZED:  05 24 00 10 01
            ** UNRECOGNIZED:  05 24 01 00 00
            ** UNRECOGNIZED:  04 24 02 02
            ** UNRECOGNIZED:  05 24 06 00 00
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x88  EP 8 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x000a  1x 10 bytes
              bInterval               9
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x87  EP 7 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x04  EP 4 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
      
      T:  Bus=02 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 85 Spd=5000 MxCh= 0
      D:  Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
      P:  Vendor=2cb7 ProdID=01a4 Rev= 5.04
      S:  Manufacturer=Fibocom Wireless Inc.
      S:  Product=Fibocom FM101-GL Module
      S:  SerialNumber=673326ce
      C:* #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=896mA
      A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
      I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
      I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=(none)
      I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=(none)
      I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
      I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=(none)
      I:* If#= 6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=(none)
      
      Bus 002 Device 085: ID 2cb7:01a4 Fibocom Wireless Inc. Fibocom FM101-GL Module
      Device Descriptor:
        bLength                18
        bDescriptorType         1
        bcdUSB               3.20
        bDeviceClass            0
        bDeviceSubClass         0
        bDeviceProtocol         0
        bMaxPacketSize0         9
        idVendor           0x2cb7
        idProduct          0x01a4
        bcdDevice            5.04
        iManufacturer           1 Fibocom Wireless Inc.
        iProduct                2 Fibocom FM101-GL Module
        iSerial                 3 673326ce
        bNumConfigurations      1
        Configuration Descriptor:
          bLength                 9
          bDescriptorType         2
          wTotalLength       0x0180
          bNumInterfaces          7
          bConfigurationValue     1
          iConfiguration          4 MBIM_DIAG_DUN_ADB_GNSS_GNSS
          bmAttributes         0xa0
            (Bus Powered)
            Remote Wakeup
          MaxPower              896mA
          Interface Association:
            bLength                 8
            bDescriptorType        11
            bFirstInterface         0
            bInterfaceCount         2
            bFunctionClass          2 Communications
            bFunctionSubClass      14
            bFunctionProtocol       0
            iFunction               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        0
            bAlternateSetting       0
            bNumEndpoints           1
            bInterfaceClass         2 Communications
            bInterfaceSubClass     14
            bInterfaceProtocol      0
            iInterface              5 Fibocom FM101-GL LTE Modem
            CDC Header:
              bcdCDC               1.10
            CDC Union:
              bMasterInterface        0
              bSlaveInterface         1
            CDC MBIM:
              bcdMBIMVersion       1.00
              wMaxControlMessage   4096
              bNumberFilters       32
              bMaxFilterSize       128
              wMaxSegmentSize      2048
              bmNetworkCapabilities 0x20
                8-byte ntb input size
            CDC MBIM Extended:
              bcdMBIMExtendedVersion           1.00
              bMaxOutstandingCommandMessages     64
              wMTU                             1500
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x81  EP 1 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0040  1x 64 bytes
              bInterval               9
              bMaxBurst               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        1
            bAlternateSetting       0
            bNumEndpoints           0
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0
            bInterfaceProtocol      2
            iInterface              0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        1
            bAlternateSetting       1
            bNumEndpoints           2
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0
            bInterfaceProtocol      2
            iInterface              6 MBIM Data
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x8e  EP 14 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               6
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x0f  EP 15 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               2
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        2
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass    255 Vendor Specific Subclass
            bInterfaceProtocol     48
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x01  EP 1 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x82  EP 2 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        3
            bAlternateSetting       0
            bNumEndpoints           3
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass    255 Vendor Specific Subclass
            bInterfaceProtocol     64
            iInterface              0
            ** UNRECOGNIZED:  05 24 00 10 01
            ** UNRECOGNIZED:  05 24 01 00 00
            ** UNRECOGNIZED:  04 24 02 02
            ** UNRECOGNIZED:  05 24 06 00 00
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x84  EP 4 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x000a  1x 10 bytes
              bInterval               9
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x83  EP 3 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x02  EP 2 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        4
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass     66
            bInterfaceProtocol      1
            iInterface              8 ADB Interface
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x03  EP 3 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x85  EP 5 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        5
            bAlternateSetting       0
            bNumEndpoints           3
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass      0
            bInterfaceProtocol     64
            iInterface              0
            ** UNRECOGNIZED:  05 24 00 10 01
            ** UNRECOGNIZED:  05 24 01 00 00
            ** UNRECOGNIZED:  04 24 02 02
            ** UNRECOGNIZED:  05 24 06 00 00
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x87  EP 7 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x000a  1x 10 bytes
              bInterval               9
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x86  EP 6 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x04  EP 4 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        6
            bAlternateSetting       0
            bNumEndpoints           3
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass      0
            bInterfaceProtocol     64
            iInterface              0
            ** UNRECOGNIZED:  05 24 00 10 01
            ** UNRECOGNIZED:  05 24 01 00 00
            ** UNRECOGNIZED:  04 24 02 02
            ** UNRECOGNIZED:  05 24 06 00 00
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x89  EP 9 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x000a  1x 10 bytes
              bInterval               9
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x88  EP 8 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x05  EP 5 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0400  1x 1024 bytes
              bInterval               0
              bMaxBurst               0
      
      Signed-off-by: default avatarMingjie Zhang <superzmj@fibocom.com>
      Link: https://lore.kernel.org/r/20211123133757.37475-1-superzmj@fibocom.com
      
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d9de0adf
    • Daniele Palmas's avatar
      USB: serial: option: add Telit LE910S1 0x9200 composition · 022d16c9
      Daniele Palmas authored
      commit e353f3e8
      
       upstream.
      
      Add the following Telit LE910S1 composition:
      
      0x9200: tty
      
      Signed-off-by: default avatarDaniele Palmas <dnlplm@gmail.com>
      Link: https://lore.kernel.org/r/20211119140319.10448-1-dnlplm@gmail.com
      
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      022d16c9
  2. Nov 26, 2021