Skip to content
  1. Dec 01, 2021
    • Florent Fourcot's avatar
      netfilter: ctnetlink: fix filtering with CTA_TUPLE_REPLY · a3d829e5
      Florent Fourcot authored
      [ Upstream commit ad81d4da ]
      
      filter->orig_flags was used for a reply context.
      
      Fixes: cb8aa9a3
      
       ("netfilter: ctnetlink: add kernel side filtering for dump")
      Signed-off-by: default avatarFlorent Fourcot <florent.fourcot@wifirst.fr>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      a3d829e5
    • David Hildenbrand's avatar
      proc/vmcore: fix clearing user buffer by properly using clear_user() · a8a91705
      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 avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a8a91705
    • Pali Rohár's avatar
      PCI: aardvark: Fix link training · 1f520a0d
      Pali Rohár authored
      commit f76b36d4 upstream.
      
      Fix multiple link training issues in aardvark driver. The main reason of
      these issues was misunderstanding of what certain registers do, since their
      names and comments were misleading: before commit 96be36db ("PCI:
      aardvark: Replace custom macros by standard linux/pci_regs.h macros"), the
      pci-aardvark.c driver used custom macros for accessing standard PCIe Root
      Bridge registers, and misleading comments did not help to understand what
      the code was really doing.
      
      After doing more tests and experiments I've come to the conclusion that the
      SPEED_GEN register in aardvark sets the PCIe revision / generation
      compliance and forces maximal link speed. Both GEN3 and GEN2 values set the
      read-only PCI_EXP_FLAGS_VERS bits (PCIe capabilities version of Root
      Bridge) to value 2, while GEN1 value sets PCI_EXP_FLAGS_VERS to 1, which
      matches with PCI Express specifications revisions 3, 2 and 1 respectively.
      Changing SPEED_GEN also sets the read-only bits PCI_EXP_LNKCAP_SLS and
      PCI_EXP_LNKCAP2_SLS to corresponding speed.
      
      (Note that PCI Express rev 1 specification does not define PCI_EXP_LNKCAP2
       and PCI_EXP_LNKCTL2 registers and when SPEED_GEN is set to GEN1 (which
       also sets PCI_EXP_FLAGS_VERS set to 1), lspci cannot access
       PCI_EXP_LNKCAP2 and PCI_EXP_LNKCTL2 registers.)
      
      Changing PCIe link speed can be done via PCI_EXP_LNKCTL2_TLS bits of
      PCI_EXP_LNKCTL2 register. Armada 3700 Functional Specifications says that
      the default value of PCI_EXP_LNKCTL2_TLS is based on SPEED_GEN value, but
      tests showed that the default value is always 8.0 GT/s, independently of
      speed set by SPEED_GEN. So after setting SPEED_GEN, we must also set value
      in PCI_EXP_LNKCTL2 register via PCI_EXP_LNKCTL2_TLS bits.
      
      Triggering PCI_EXP_LNKCTL_RL bit immediately after setting LINK_TRAINING_EN
      bit actually doesn't do anything. Tests have shown that a delay is needed
      after enabling LINK_TRAINING_EN bit. As triggering PCI_EXP_LNKCTL_RL
      currently does nothing, remove it.
      
      Commit 43fc679c ("PCI: aardvark: Improve link training") introduced
      code which sets SPEED_GEN register based on negotiated link speed from
      PCI_EXP_LNKSTA_CLS bits of PCI_EXP_LNKSTA register. This code was added to
      fix detection of Compex WLE900VX (Atheros QCA9880) WiFi GEN1 PCIe cards, as
      otherwise these cards were "invisible" on PCIe bus (probably because they
      crashed). But apparently more people reported the same issues with these
      cards also with other PCIe controllers [1] and I was able to reproduce this
      issue also with other "noname" WiFi cards based on Atheros QCA9890 chip
      (with the same PCI vendor/device ids as Atheros QCA9880). So this is not an
      issue in aardvark but rather an issue in Atheros QCA98xx chips. Also, this
      issue only exists if the kernel is compiled with PCIe ASPM support, and a
      generic workaround for this is to change PCIe Bridge to 2.5 GT/s link speed
      via PCI_EXP_LNKCTL2_TLS_2_5GT bits in PCI_EXP_LNKCTL2 register [2], before
      triggering PCI_EXP_LNKCTL_RL bit. This workaround also works when SPEED_GEN
      is set to value GEN2 (5 GT/s). So remove this hack completely in the
      aardvark driver and always set SPEED_GEN to value from 'max-link-speed' DT
      property. Fix for Atheros QCA98xx chips is handled separately by patch [2].
      
      These two things (code for triggering PCI_EXP_LNKCTL_RL bit and changing
      SPEED_GEN value) also explain why commit 69644945 ("PCI: aardvark:
      Train link immediately after enabling training") somehow fixed detection of
      those problematic Compex cards with Atheros chips: if triggering link
      retraining (via PCI_EXP_LNKCTL_RL bit) was done immediately after enabling
      link training (via LINK_TRAINING_EN), it did nothing. If there was a
      specific delay, aardvark HW already initialized PCIe link and therefore
      triggering link retraining caused the above issue. Compex cards triggered
      link down event and disappeared from the PCIe bus.
      
      Commit f4c7d053 ("PCI: aardvark: Wait for endpoint to be ready before
      training link") added 100ms sleep before calling 'Start link training'
      command and explained that it is a requirement of PCI Express
      specification. But the code after this 100ms sleep was not doing 'Start
      link training', rather it triggered PCI_EXP_LNKCTL_RL bit via PCIe Root
      Bridge to put link into Recovery state.
      
      The required delay after fundamental reset is already done in function
      advk_pcie_wait_for_link() which also checks whether PCIe link is up.
      So after removing the code which triggers PCI_EXP_LNKCTL_RL bit on PCIe
      Root Bridge, there is no need to wait 100ms again. Remove the extra
      msleep() call and update comment about the delay required by the PCI
      Express specification.
      
      According to Marvell Armada 3700 Functional Specifications, Link training
      should be enabled via aardvark register LINK_TRAINING_EN after selecting
      PCIe generation and x1 lane. There is no need to disable it prior resetting
      card via PERST# signal. This disabling code was introduced in commit
      5169a985
      
       ("PCI: aardvark: Issue PERST via GPIO") as a workaround for
      some Atheros cards. It turns out that this also is Atheros specific issue
      and affects any PCIe controller, not only aardvark. Moreover this Atheros
      issue was triggered by juggling with PCI_EXP_LNKCTL_RL, LINK_TRAINING_EN
      and SPEED_GEN bits interleaved with sleeps. Now, after removing triggering
      PCI_EXP_LNKCTL_RL, there is no need to explicitly disable LINK_TRAINING_EN
      bit. So remove this code too. The problematic Compex cards described in
      previous git commits are correctly detected in advk_pcie_train_link()
      function even after applying all these changes.
      
      Note that with this patch, and also prior this patch, some NVMe disks which
      support PCIe GEN3 with 8 GT/s speed are negotiated only at the lowest link
      speed 2.5 GT/s, independently of SPEED_GEN value. After manually triggering
      PCI_EXP_LNKCTL_RL bit (e.g. from userspace via setpci), these NVMe disks
      change link speed to 5 GT/s when SPEED_GEN was configured to GEN2. This
      issue first needs to be properly investigated. I will send a fix in the
      future.
      
      On the other hand, some other GEN2 PCIe cards with 5 GT/s speed are
      autonomously by HW autonegotiated at full 5 GT/s speed without need of any
      software interaction.
      
      Armada 3700 Functional Specifications describes the following steps for
      link training: set SPEED_GEN to GEN2, enable LINK_TRAINING_EN, poll until
      link training is complete, trigger PCI_EXP_LNKCTL_RL, poll until signal
      rate is 5 GT/s, poll until link training is complete, enable ASPM L0s.
      
      The requirement for triggering PCI_EXP_LNKCTL_RL can be explained by the
      need to achieve 5 GT/s speed (as changing link speed is done by throw to
      recovery state entered by PCI_EXP_LNKCTL_RL) or maybe as a part of enabling
      ASPM L0s (but in this case ASPM L0s should have been enabled prior
      PCI_EXP_LNKCTL_RL).
      
      It is unknown why the original pci-aardvark.c driver was triggering
      PCI_EXP_LNKCTL_RL bit before waiting for the link to be up. This does not
      align with neither PCIe base specifications nor with Armada 3700 Functional
      Specification. (Note that in older versions of aardvark, this bit was
      called incorrectly PCIE_CORE_LINK_TRAINING, so this may be the reason.)
      
      It is also unknown why Armada 3700 Functional Specification says that it is
      needed to trigger PCI_EXP_LNKCTL_RL for GEN2 mode, as according to PCIe
      base specification 5 GT/s speed negotiation is supposed to be entirely
      autonomous, even if initial speed is 2.5 GT/s.
      
      [1] - https://lore.kernel.org/linux-pci/87h7l8axqp.fsf@toke.dk/
      [2] - https://lore.kernel.org/linux-pci/20210326124326.21163-1-pali@kernel.org/
      
      Link: https://lore.kernel.org/r/20211005180952.6812-12-kabel@kernel.org
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reviewed-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1f520a0d
    • Pali Rohár's avatar
      PCI: aardvark: Simplify initialization of rootcap on virtual bridge · aec0751f
      Pali Rohár authored
      commit 454c5327
      
       upstream.
      
      PCIe config space can be initialized also before pci_bridge_emul_init()
      call, so move rootcap initialization after PCI config space initialization.
      
      This simplifies the function a little since it removes one if (ret < 0)
      check.
      
      Link: https://lore.kernel.org/r/20211005180952.6812-11-kabel@kernel.org
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reviewed-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aec0751f
    • Pali Rohár's avatar
      PCI: aardvark: Implement re-issuing config requests on CRS response · df574809
      Pali Rohár authored
      commit 223dec14 upstream.
      
      Commit 43f5c77b
      
       ("PCI: aardvark: Fix reporting CRS value") fixed
      handling of CRS response and when CRSSVE flag was not enabled it marked CRS
      response as failed transaction (due to simplicity).
      
      But pci-aardvark.c driver is already waiting up to the PIO_RETRY_CNT count
      for PIO config response and so we can with a small change implement
      re-issuing of config requests as described in PCIe base specification.
      
      This change implements re-issuing of config requests when response is CRS.
      Set upper bound of wait cycles to around PIO_RETRY_CNT, afterwards the
      transaction is marked as failed and an all-ones value is returned as
      before.
      
      We do this by returning appropriate error codes from function
      advk_pcie_check_pio_status(). On CRS we return -EAGAIN and caller then
      reissues transaction.
      
      Link: https://lore.kernel.org/r/20211005180952.6812-10-kabel@kernel.org
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reviewed-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      df574809
    • Pali Rohár's avatar
      PCI: aardvark: Update comment about disabling link training · e7f2e2c7
      Pali Rohár authored
      commit 1d1cd163
      
       upstream.
      
      According to PCI Express Base Specifications (rev 4.0, 6.6.1
      "Conventional reset"), after fundamental reset a 100ms delay is needed
      prior to enabling link training.
      
      Update comment in code to reflect this requirement.
      
      Link: https://lore.kernel.org/r/20201202184659.3795-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>
      e7f2e2c7
    • Marek Behún's avatar
      PCI: aardvark: Deduplicate code in advk_pcie_rd_conf() · 2b7bc1c4
      Marek Behún authored
      commit 67cb2a4c upstream.
      
      Avoid code repetition in advk_pcie_rd_conf() by handling errors with
      goto jump, as is customary in kernel.
      
      Link: https://lore.kernel.org/r/20211005180952.6812-9-kabel@kernel.org
      Fixes: 43f5c77b
      
       ("PCI: aardvark: Fix reporting CRS value")
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2b7bc1c4
    • Christophe Leroy's avatar
      powerpc/32: Fix hardlockup on vmap stack overflow · dfe906da
      Christophe Leroy authored
      commit 5bb60ea6 upstream.
      
      Since the commit c118c730 ("powerpc/32: Fix vmap stack - Do not
      activate MMU before reading task struct") a vmap stack overflow
      results in a hard lockup. This is because emergency_ctx is still
      addressed with its virtual address allthough data MMU is not active
      anymore at that time.
      
      Fix it by using a physical address instead.
      
      Fixes: c118c730
      
       ("powerpc/32: Fix vmap stack - Do not activate MMU before reading task struct")
      Cc: stable@vger.kernel.org # v5.10+
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/ce30364fb7ccda489272af4a1612b6aa147e1d23.1637227521.git.christophe.leroy@csgroup.eu
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dfe906da
    • Dylan Hung's avatar
      mdio: aspeed: Fix "Link is Down" issue · bf00edd9
      Dylan Hung authored
      commit 9dbe33cf upstream.
      
      The issue happened randomly in runtime.  The message "Link is Down" is
      popped but soon it recovered to "Link is Up".
      
      The "Link is Down" results from the incorrect read data for reading the
      PHY register via MDIO bus.  The correct sequence for reading the data
      shall be:
      1. fire the command
      2. wait for command done (this step was missing)
      3. wait for data idle
      4. read data from data register
      
      Cc: stable@vger.kernel.org
      Fixes: f160e994
      
       ("net: phy: Add mdio-aspeed")
      Reviewed-by: default avatarJoel Stanley <joel@jms.id.au>
      Signed-off-by: default avatarDylan Hung <dylan_hung@aspeedtech.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Link: https://lore.kernel.org/r/20211125024432.15809-1-dylan_hung@aspeedtech.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bf00edd9
    • Adrian Hunter's avatar
      mmc: sdhci: Fix ADMA for PAGE_SIZE >= 64KiB · 14c3ce30
      Adrian Hunter authored
      commit 3d7c194b
      
       upstream.
      
      The block layer forces a minimum segment size of PAGE_SIZE, so a segment
      can be too big for the ADMA table, if PAGE_SIZE >= 64KiB. Fix by writing
      multiple descriptors, noting that the ADMA table is sized for 4KiB chunks
      anyway, so it will be big enough.
      
      Reported-and-tested-by: default avatarBough Chen <haibo.chen@nxp.com>
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20211115082345.802238-1-adrian.hunter@intel.com
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      14c3ce30
    • Tim Harvey's avatar
      mmc: sdhci-esdhc-imx: disable CMDQ support · 63195705
      Tim Harvey authored
      commit adab993c upstream.
      
      On IMX SoC's which support CMDQ the following can occur during high a
      high cpu load:
      
      mmc2: cqhci: ============ CQHCI REGISTER DUMP ===========
      mmc2: cqhci: Caps:      0x0000310a | Version:  0x00000510
      mmc2: cqhci: Config:    0x00001001 | Control:  0x00000000
      mmc2: cqhci: Int stat:  0x00000000 | Int enab: 0x00000006
      mmc2: cqhci: Int sig:   0x00000006 | Int Coal: 0x00000000
      mmc2: cqhci: TDL base:  0x8003f000 | TDL up32: 0x00000000
      mmc2: cqhci: Doorbell:  0xbf01dfff | TCN:      0x00000000
      mmc2: cqhci: Dev queue: 0x00000000 | Dev Pend: 0x08000000
      mmc2: cqhci: Task clr:  0x00000000 | SSC1:     0x00011000
      mmc2: cqhci: SSC2:      0x00000001 | DCMD rsp: 0x00000800
      mmc2: cqhci: RED mask:  0xfdf9a080 | TERRI:    0x00000000
      mmc2: cqhci: Resp idx:  0x0000000d | Resp arg: 0x00000000
      mmc2: sdhci: ============ SDHCI REGISTER DUMP ===========
      mmc2: sdhci: Sys addr:  0x7c722000 | Version:  0x00000002
      mmc2: sdhci: Blk size:  0x00000200 | Blk cnt:  0x00000020
      mmc2: sdhci: Argument:  0x00018000 | Trn mode: 0x00000023
      mmc2: sdhci: Present:   0x01f88008 | Host ctl: 0x00000030
      mmc2: sdhci: Power:     0x00000002 | Blk gap:  0x00000080
      mmc2: sdhci: Wake-up:   0x00000008 | Clock:    0x0000000f
      mmc2: sdhci: Timeout:   0x0000008f | Int stat: 0x00000000
      mmc2: sdhci: Int enab:  0x107f4000 | Sig enab: 0x107f4000
      mmc2: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000502
      mmc2: sdhci: Caps:      0x07eb0000 | Caps_1:   0x8000b407
      mmc2: sdhci: Cmd:       0x00000d1a | Max curr: 0x00ffffff
      mmc2: sdhci: Resp[0]:   0x00000000 | Resp[1]:  0xffc003ff
      mmc2: sdhci: Resp[2]:   0x328f5903 | Resp[3]:  0x00d07f01
      mmc2: sdhci: Host ctl2: 0x00000088
      mmc2: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0xfe179020
      mmc2: sdhci-esdhc-imx: ========= ESDHC IMX DEBUG STATUS DUMP ====
      mmc2: sdhci-esdhc-imx: cmd debug status:  0x2120
      mmc2: sdhci-esdhc-imx: data debug status:  0x2200
      mmc2: sdhci-esdhc-imx: trans debug status:  0x2300
      mmc2: sdhci-esdhc-imx: dma debug status:  0x2400
      mmc2: sdhci-esdhc-imx: adma debug status:  0x2510
      mmc2: sdhci-esdhc-imx: fifo debug status:  0x2680
      mmc2: sdhci-esdhc-imx: async fifo debug status:  0x2750
      mmc2: sdhci: ============================================
      
      For now, disable CMDQ support on the imx8qm/imx8qxp/imx8mm until the
      issue is found and resolved.
      
      Fixes: bb6e3581 ("mmc: sdhci-esdhc-imx: add CMDQ support")
      Fixes: cde5e8e9
      
       ("mmc: sdhci-esdhc-imx: Add an new esdhc_soc_data for i.MX8MM")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarTim Harvey <tharvey@gateworks.com>
      Reviewed-by: default avatarHaibo Chen <haibo.chen@nxp.com>
      Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Link: https://lore.kernel.org/r/20211103165415.2016-1-tharvey@gateworks.com
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      63195705
    • Steven Rostedt (VMware)'s avatar
      tracing: Fix pid filtering when triggers are attached · 092a58f0
      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>
      092a58f0
    • Jiri Olsa's avatar
      tracing/uprobe: Fix uprobe_perf_open probes iteration · 68fa6bf7
      Jiri Olsa authored
      commit 1880ed71 upstream.
      
      Add missing 'tu' variable initialization in the probes loop,
      otherwise the head 'tu' is used instead of added probes.
      
      Link: https://lkml.kernel.org/r/20211123142801.182530-1-jolsa@kernel.org
      
      Cc: stable@vger.kernel.org
      Fixes: 99c9a923
      
       ("tracing/uprobe: Fix double perf_event linking on multiprobe uprobe")
      Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      68fa6bf7
    • Nicholas Piggin's avatar
      KVM: PPC: Book3S HV: Prevent POWER7/8 TLB flush flushing SLB · b777c866
      Nicholas Piggin authored
      commit cf0b0e37 upstream.
      
      The POWER9 ERAT flush instruction is a SLBIA with IH=7, which is a
      reserved value on POWER7/8. On POWER8 this invalidates the SLB entries
      above index 0, similarly to SLBIA IH=0.
      
      If the SLB entries are invalidated, and then the guest is bypassed, the
      host SLB does not get re-loaded, so the bolted entries above 0 will be
      lost. This can result in kernel stack access causing a SLB fault.
      
      Kernel stack access causing a SLB fault was responsible for the infamous
      mega bug (search "Fix SLB reload bug"). Although since commit
      48e7b769 ("powerpc/64s/hash: Convert SLB miss handlers to C") that
      starts using the kernel stack in the SLB miss handler, it might only
      result in an infinite loop of SLB faults. In any case it's a bug.
      
      Fix this by only executing the instruction on >= POWER9 where IH=7 is
      defined not to invalidate the SLB. POWER7/8 don't require this ERAT
      flush.
      
      Fixes: 50087112
      
       ("KVM: PPC: Book3S HV: Invalidate ERAT when flushing guest TLB entries")
      Cc: stable@vger.kernel.org # v5.2+
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Reviewed-by: default avatarFabiano Rosas <farosas@linux.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20211119031627.577853-1-npiggin@gmail.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b777c866
    • Stefano Stabellini's avatar
      xen: detect uninitialized xenbus in xenbus_init · bfed9c2f
      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>
      bfed9c2f
    • Stefano Stabellini's avatar
      xen: don't continue xenstore initialization in case of errors · e1d492c2
      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>
      e1d492c2
    • Miklos Szeredi's avatar
      fuse: release pipe buf after last use · 8f4d0719
      Miklos Szeredi authored
      commit 47344172
      
       upstream.
      
      Checking buf->flags should be done before the pipe_buf_release() is called
      on the pipe buffer, since releasing the buffer might modify the flags.
      
      This is exactly what page_cache_pipe_buf_release() does, and which results
      in the same VM_BUG_ON_PAGE(PageLRU(page)) that the original patch was
      trying to fix.
      
      Reported-by: default avatarJustin Forbes <jmforbes@linuxtx.org>
      Fixes: 712a9510
      
       ("fuse: fix page stealing")
      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>
      8f4d0719
    • Dan Carpenter's avatar
      staging: rtl8192e: Fix use after free in _rtl92e_pci_disconnect() · 8d0163ce
      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>
      8d0163ce
    • Takashi Iwai's avatar
      staging: greybus: Add missing rwsem around snd_ctl_remove() calls · 0bfed81b
      Takashi Iwai authored
      commit ffcf7ae9 upstream.
      
      snd_ctl_remove() has to be called with card->controls_rwsem held (when
      called after the card instantiation).  This patch adds the missing
      rwsem calls around it.
      
      Fixes: 510e340e
      
       ("staging: greybus: audio: Add helper APIs for dynamic audio modules")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Link: https://lore.kernel.org/r/20211116072027.18466-1-tiwai@suse.de
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0bfed81b
    • Noralf Trønnes's avatar
      staging/fbtft: Fix backlight · 146283f1
      Noralf Trønnes authored
      commit 7865dd24 upstream.
      
      Commit b4a1ed0c ("fbdev: make FB_BACKLIGHT a tristate") forgot to
      update fbtft breaking its backlight support when FB_BACKLIGHT is a module.
      
      Since FB_TFT selects FB_BACKLIGHT there's no need for this conditional
      so just remove it and we're good.
      
      Fixes: b4a1ed0c
      
       ("fbdev: make FB_BACKLIGHT a tristate")
      Cc: <stable@vger.kernel.org>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
      Link: https://lore.kernel.org/r/20211105204358.2991-1-noralf@tronnes.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      146283f1
    • Jason Gerecke's avatar
      HID: wacom: Use "Confidence" flag to prevent reporting invalid contacts · 8fc5e3c7
      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>
      8fc5e3c7
    • Helge Deller's avatar
      Revert "parisc: Fix backtrace to always include init funtion names" · 6ca32e2e
      Helge Deller authored
      commit 98400ad7 upstream.
      
      This reverts commit 279917e2
      
      .
      
      With the CONFIG_HARDENED_USERCOPY option enabled, this patch triggers
      kernel bugs at runtime:
      
        usercopy: Kernel memory overwrite attempt detected to kernel text (offset 2084839, size 6)!
        kernel BUG at mm/usercopy.c:99!
       Backtrace:
        IAOQ[0]: usercopy_abort+0xc4/0xe8
        [<00000000406ed1c8>] __check_object_size+0x174/0x238
        [<00000000407086d4>] copy_strings.isra.0+0x3e8/0x708
        [<0000000040709a20>] do_execveat_common.isra.0+0x1bc/0x328
        [<000000004070b760>] compat_sys_execve+0x7c/0xb8
        [<0000000040303eb8>] syscall_exit+0x0/0x14
      
      The problem is, that we have an init section of at least 2MB size which
      starts at _stext and is freed after bootup.
      
      If then later some kernel data is (temporarily) stored in this free
      memory, check_kernel_text_object() will trigger a bug since the data
      appears to be inside the kernel text (>=_stext) area:
              if (overlaps(ptr, len, _stext, _etext))
                      usercopy_abort("kernel text");
      
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Cc: stable@kernel.org # 5.4+
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6ca32e2e
    • Hans Verkuil's avatar
      media: cec: copy sequence field for the reply · 3a4aeb37
      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>
      3a4aeb37
    • Takashi Iwai's avatar
      ALSA: hda/realtek: Fix LED on HP ProBook 435 G7 · 3798218a
      Takashi Iwai authored
      commit 05ec7161
      
       upstream.
      
      HP ProBook 435 G7 (SSID 103c:8735) needs the similar quirk as another
      HP ProBook for enabling the mute and the mic-mute LEDs.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215021
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20211118071636.14738-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3798218a
    • Werner Sembach's avatar
      ALSA: hda/realtek: Add quirk for ASRock NUC Box 1100 · 60274e24
      Werner Sembach authored
      commit 174a7fb3
      
       upstream.
      
      This applies a SND_PCI_QUIRK(...) to the ASRock NUC Box 1100 series. This
      fixes the issue of the headphone jack not being detected unless warm
      rebooted from a certain other OS.
      
      When booting a certain other OS some coeff settings are changed that enable
      the audio jack. These settings are preserved on a warm reboot and can be
      easily dumped.
      
      The relevant indexes and values where gathered by naively diff-ing and
      reading a working and a non-working coeff dump.
      
      Signed-off-by: default avatarWerner Sembach <wse@tuxedocomputers.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20211112110704.1022501-1-wse@tuxedocomputers.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      60274e24
    • Takashi Iwai's avatar
      ALSA: ctxfi: Fix out-of-range access · 172167bc
      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>
      172167bc
    • Todd Kjos's avatar
      binder: fix test regression due to sender_euid change · 4402cf04
      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>
      4402cf04
    • Mathias Nyman's avatar
      usb: hub: Fix locking issues with address0_mutex · aea184ae
      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>
      aea184ae
    • Mathias Nyman's avatar
      usb: hub: Fix usb enumeration issue due to address0 race · 5bf3a0c7
      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>
      5bf3a0c7
    • Ondrej Jirman's avatar
      usb: typec: fusb302: Fix masking of comparator and bc_lvl interrupts · 00f1038c
      Ondrej Jirman authored
      commit 36246883 upstream.
      
      The code that enables either BC_LVL or COMP_CHNG interrupt in tcpm_set_cc
      wrongly assumes that the interrupt is unmasked by writing 1 to the apropriate
      bit in the mask register. In fact, interrupts are enabled when the mask
      is 0, so the tcpm_set_cc enables interrupt for COMP_CHNG when it expects
      BC_LVL interrupt to be enabled.
      
      This causes inability of the driver to recognize cable unplug events
      in host mode (unplug is recognized only via a COMP_CHNG interrupt).
      
      In device mode this bug was masked by simultaneous triggering of the VBUS
      change interrupt, because of loss of VBUS when the port peer is providing
      power.
      
      Fixes: 48242e30
      
       ("usb: typec: fusb302: Revert "Resolve fixed power role contract setup"")
      Cc: stable <stable@vger.kernel.org>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarOndrej Jirman <megous@megous.com>
      Link: https://lore.kernel.org/r/20211108102833.2793803-1-megous@megous.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      00f1038c
    • Dan Carpenter's avatar
      usb: chipidea: ci_hdrc_imx: fix potential error pointer dereference in probe · 56fbab49
      Dan Carpenter authored
      commit d4d2e532 upstream.
      
      If the first call to devm_usb_get_phy_by_phandle(dev, "fsl,usbphy", 0)
      fails with something other than -ENODEV then it leads to an error
      pointer dereference.  For those errors we should just jump directly to
      the error handling.
      
      Fixes: 8253a34b
      
       ("usb: chipidea: ci_hdrc_imx: Also search for 'phys' phandle")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Link: https://lore.kernel.org/r/20211117074923.GF5237@kili
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      56fbab49
    • Nikolay Aleksandrov's avatar
      net: nexthop: fix null pointer dereference when IPv6 is not enabled · b70ff391
      Nikolay Aleksandrov authored
      commit 1c743127 upstream.
      
      When we try to add an IPv6 nexthop and IPv6 is not enabled
      (!CONFIG_IPV6) we'll hit a NULL pointer dereference[1] in the error path
      of nh_create_ipv6() due to calling ipv6_stub->fib6_nh_release. The bug
      has been present since the beginning of IPv6 nexthop gateway support.
      Commit 1aefd3de ("ipv6: Add fib6_nh_init and release to stubs") tells
      us that only fib6_nh_init has a dummy stub because fib6_nh_release should
      not be called if fib6_nh_init returns an error, but the commit below added
      a call to ipv6_stub->fib6_nh_release in its error path. To fix it return
      the dummy stub's -EAFNOSUPPORT error directly without calling
      ipv6_stub->fib6_nh_release in nh_create_ipv6()'s error path.
      
      [1]
       Output is a bit truncated, but it clearly shows the error.
       BUG: kernel NULL pointer dereference, address: 000000000000000000
       #PF: supervisor instruction fetch in kernel modede
       #PF: error_code(0x0010) - not-present pagege
       PGD 0 P4D 0
       Oops: 0010 [#1] PREEMPT SMP NOPTI
       CPU: 4 PID: 638 Comm: ip Kdump: loaded Not tainted 5.16.0-rc1+ #446
       Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-4.fc34 04/01/2014
       RIP: 0010:0x0
       Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
       RSP: 0018:ffff888109f5b8f0 EFLAGS: 00010286^Ac
       RAX: 0000000000000000 RBX: ffff888109f5ba28 RCX: 0000000000000000
       RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8881008a2860
       RBP: ffff888109f5b9d8 R08: 0000000000000000 R09: 0000000000000000
       R10: ffff888109f5b978 R11: ffff888109f5b948 R12: 00000000ffffff9f
       R13: ffff8881008a2a80 R14: ffff8881008a2860 R15: ffff8881008a2840
       FS:  00007f98de70f100(0000) GS:ffff88822bf00000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: ffffffffffffffd6 CR3: 0000000100efc000 CR4: 00000000000006e0
       Call Trace:
        <TASK>
        nh_create_ipv6+0xed/0x10c
        rtm_new_nexthop+0x6d7/0x13f3
        ? check_preemption_disabled+0x3d/0xf2
        ? lock_is_held_type+0xbe/0xfd
        rtnetlink_rcv_msg+0x23f/0x26a
        ? check_preemption_disabled+0x3d/0xf2
        ? rtnl_calcit.isra.0+0x147/0x147
        netlink_rcv_skb+0x61/0xb2
        netlink_unicast+0x100/0x187
        netlink_sendmsg+0x37f/0x3a0
        ? netlink_unicast+0x187/0x187
        sock_sendmsg_nosec+0x67/0x9b
        ____sys_sendmsg+0x19d/0x1f9
        ? copy_msghdr_from_user+0x4c/0x5e
        ? rcu_read_lock_any_held+0x2a/0x78
        ___sys_sendmsg+0x6c/0x8c
        ? asm_sysvec_apic_timer_interrupt+0x12/0x20
        ? lockdep_hardirqs_on+0xd9/0x102
        ? sockfd_lookup_light+0x69/0x99
        __sys_sendmsg+0x50/0x6e
        do_syscall_64+0xcb/0xf2
        entry_SYSCALL_64_after_hwframe+0x44/0xae
       RIP: 0033:0x7f98dea28914
       Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b5 0f 1f 80 00 00 00 00 48 8d 05 e9 5d 0c 00 8b 00 85 c0 75 13 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 41 54 41 89 d4 55 48 89 f5 53
       RSP: 002b:00007fff859f5e68 EFLAGS: 00000246 ORIG_RAX: 000000000000002e2e
       RAX: ffffffffffffffda RBX: 00000000619cb810 RCX: 00007f98dea28914
       RDX: 0000000000000000 RSI: 00007fff859f5ed0 RDI: 0000000000000003
       RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000008
       R10: fffffffffffffce6 R11: 0000000000000246 R12: 0000000000000001
       R13: 000055c0097ae520 R14: 000055c0097957fd R15: 00007fff859f63a0
       </TASK>
       Modules linked in: bridge stp llc bonding virtio_net
      
      Cc: stable@vger.kernel.org
      Fixes: 53010f99
      
       ("nexthop: Add support for IPv6 gateways")
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b70ff391
    • Albert Wang's avatar
      usb: dwc3: gadget: Fix null pointer exception · 0755f3f3
      Albert Wang authored
      commit 26288448 upstream.
      
      In the endpoint interrupt functions
      dwc3_gadget_endpoint_transfer_in_progress() and
      dwc3_gadget_endpoint_trbs_complete() will dereference the endpoint
      descriptor. But it could be cleared in __dwc3_gadget_ep_disable()
      when accessory disconnected. So we need to check whether it is null
      or not before dereferencing it.
      
      Fixes: f09ddcfc
      
       ("usb: dwc3: gadget: Prevent EP queuing while stopping transfers")
      Cc: stable <stable@vger.kernel.org>
      Reviewed-by: default avatarJack Pham <quic_jackp@quicinc.com>
      Signed-off-by: default avatarAlbert Wang <albertccwang@google.com>
      Link: https://lore.kernel.org/r/20211109092642.3507692-1-albertccwang@google.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0755f3f3
    • Thinh Nguyen's avatar
      usb: dwc3: gadget: Check for L1/L2/U3 for Start Transfer · 140e2df4
      Thinh Nguyen authored
      commit 63c4c320 upstream.
      
      The programming guide noted that the driver needs to verify if the link
      state is in U0 before executing the Start Transfer command. If it's not
      in U0, the driver needs to perform remote wakeup. This is not accurate.
      If the link state is in U1/U2, then the controller will not respond to
      link recovery request from DCTL.ULSTCHNGREQ. The Start Transfer command
      will trigger a link recovery if it is in U1/U2. A clarification will be
      added to the programming guide for all controller versions.
      
      The current implementation shouldn't cause any functional issue. It may
      occasionally report an invalid time out warning from failed link
      recovery request. The driver will still go ahead with the Start Transfer
      command if the remote wakeup fails. The new change only initiates remote
      wakeup where it is needed, which is when the link state is in L1/L2/U3.
      
      Fixes: c36d8e94
      
       ("usb: dwc3: gadget: put link to U0 before Start Transfer")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarThinh Nguyen <Thinh.Nguyen@synopsys.com>
      Link: https://lore.kernel.org/r/05b4a5fbfbd0863fc9b1d7af934a366219e3d0b4.1635204761.git.Thinh.Nguyen@synopsys.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      140e2df4
    • Thinh Nguyen's avatar
      usb: dwc3: gadget: Ignore NoStream after End Transfer · 3abf746e
      Thinh Nguyen authored
      commit d74dc3e9 upstream.
      
      The End Transfer command from a stream endpoint will generate a NoStream
      event, and we should ignore it. Currently we set the flag
      DWC3_EP_IGNORE_NEXT_NOSTREAM to track this prior to sending the command,
      and it will be cleared on the next stream event. However, a stream event
      may be generated before the End Transfer command completion and
      prematurely clear the flag. Fix this by setting the flag on End Transfer
      completion instead.
      
      Fixes: 140ca4cf
      
       ("usb: dwc3: gadget: Handle stream transfers")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarThinh Nguyen <Thinh.Nguyen@synopsys.com>
      Link: https://lore.kernel.org/r/cee1253af4c3600edb878d11c9c08b040817ae23.1635203975.git.Thinh.Nguyen@synopsys.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3abf746e
    • Nathan Chancellor's avatar
      usb: dwc2: hcd_queue: Fix use of floating point literal · 2b7ab82f
      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>
      2b7ab82f
    • Minas Harutyunyan's avatar
      usb: dwc2: gadget: Fix ISOC flow for elapsed frames · 4b18ccad
      Minas Harutyunyan authored
      commit 7ad4a0b1 upstream.
      
      Added updating of request frame number for elapsed frames,
      otherwise frame number will remain as previous use of request.
      This will allow function driver to correctly track frames in
      case of Missed ISOC occurs.
      
      Added setting request actual length to 0 for elapsed frames.
      In Slave mode when pushing data to RxFIFO by dwords, request
      actual length incrementing accordingly. But before whole packet
      will be pushed into RxFIFO and send to host can occurs Missed
      ISOC and data will not send to host. So, in this case request
      actual length should be reset to 0.
      
      Fixes: 91bb163e
      
       ("usb: dwc2: gadget: Fix ISOC flow for BDMA and Slave")
      Cc: stable <stable@vger.kernel.org>
      Reviewed-by: default avatarJohn Keeping <john@metanate.com>
      Signed-off-by: default avatarMinas Harutyunyan <Minas.Harutyunyan@synopsys.com>
      Link: https://lore.kernel.org/r/c356baade6e9716d312d43df08d53ae557cb8037.1636011277.git.Minas.Harutyunyan@synopsys.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4b18ccad
    • Mingjie Zhang's avatar
      USB: serial: option: add Fibocom FM101-GL variants · 16f1cac8
      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>
      16f1cac8
    • Daniele Palmas's avatar
      USB: serial: option: add Telit LE910S1 0x9200 composition · ff721286
      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>
      ff721286
    • Sakari Ailus's avatar
      ACPI: Get acpi_device's parent from the parent field · 854c14b2
      Sakari Ailus authored
      commit 9054fc6d upstream.
      
      Printk modifier %pfw is used to print the full path of the device name.
      This is obtained device by device until a device no longer has a parent.
      
      On ACPI getting the parent fwnode is done by calling acpi_get_parent()
      which tries to down() a semaphore. But local IRQs are now disabled in
      vprintk_store() before the mutex is acquired. This is obviously a problem.
      
      Luckily struct device, embedded in struct acpi_device, has a parent field
      already. Use that field to get the parent instead of relying on
      acpi_get_parent().
      
      Fixes: 3bd32d6a
      
       ("lib/vsprintf: Add %pfw conversion specifier for printing fwnode names")
      Cc: 5.5+ <stable@vger.kernel.org> # 5.5+
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      854c14b2