Skip to content
Permalink
Maciej-W-Rozyc…
Switch branches/tags

Commits on Jun 16, 2021

  1. serial: 8250: Define RX trigger levels for OxSemi 950 devices

    Oxford Semiconductor 950 serial port devices have a 128-byte FIFO and in
    the enhanced (650) mode, which we select in `autoconfig_has_efr' with
    the ECB bit set in the EFR register, they support the receive interrupt
    trigger level selectable with FCR bits 7:6 from the set of 16, 32, 112,
    120.  This applies to the original OX16C950 discrete UART[1] as well as
    950 cores embedded into more complex devices.
    
    For these devices we set the default to 112, which sets an excessively
    high level of 112 or 7/8 of the FIFO capacity, unlike with other port
    types where we choose at most 1/2 of their respective FIFO capacities.
    Additionally we don't make the trigger level configurable.  Consequently
    frequent input overruns happen with high bit rates where hardware flow
    control cannot be used (e.g. terminal applications) even with otherwise
    highly-performant systems.
    
    Lower the default receive interrupt trigger level to 32 then, and make
    it configurable.  Document the trigger levels along with other port
    types, including the set of 16, 32, 64, 112 for the transmit interrupt
    as well[2].
    
    References:
    
    [1] "OX16C950 rev B High Performance UART with 128 byte FIFOs", Oxford
        Semiconductor, Inc., DS-0031, Sep 05, Table 10: "Receiver Trigger
        Levels", p. 22
    
    [2] same, Table 9: "Transmit Interrupt Trigger Levels", p. 22
    
    Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
    Maciej W. Rozycki authored and intel-lab-lkp committed Jun 16, 2021
  2. serial: 8250: Add proper clock handling for OxSemi PCIe devices

    Oxford Semiconductor PCIe (Tornado) serial port devices are driven by a
    fixed 62.5MHz clock input derived from the 100MHz PCI Express clock.
    
    We currently drive the device using its default oversampling rate of 16
    and the clock prescaler disabled, consequently yielding the baud base of
    3906250.  This base is inadequate for some of the high-speed baud rates
    such as 460800bps, for which the closest rate possible can be obtained
    by dividing the baud base by 8, yielding the baud rate of 488281.25bps,
    which is off by 5.9638%.  This is enough for data communication to break
    with the remote end talking actual 460800bps where missed stop bits have
    been observed.
    
    We can do better however, by taking advantage of a reduced oversampling
    rate, which can be set to any integer value from 4 to 16 inclusive by
    programming the TCR register, and by using the clock prescaler, which
    can be set to any value from 1 to 63.875 in increments of 0.125 in the
    CPR/CPR2 register pair[1][2][3][4].  The prescaler has to be explicitly
    enabled though by setting bit 7 in the MCR or otherwise it is bypassed
    as if the value of 1 was used.
    
    By using these parameters rates from 15625000bps down to 1bps can be
    obtained, with either exact or highly-accurate actual bit rates for
    standard and many non-standard rates.
    
    Make use of these features then as follows:
    
    - Set the baud base to 15625000, reflecting the minimum oversampling
      rate of 4 with the clock prescaler and divisor both set to 1.
    
    - Set the MCR mask and force bits in the UART template so as to have
      MCR[7] always set and then have 8250 core propagate those settings, if
      supplied as non-zero, overriding the ALPHA_KLUDGE_MCR default.
    
    - Override the `get_divisor' handler and determine a good combination of
      parameters by using a lookup table with predetermined value pairs of
      the oversampling rate and the clock prescaler and finding a pair that
      divides the input clock such that the quotient, when rounded to the
      nearest integer, deviates the least from the exact result.  Calculate
      the clock divisor accordingly.
    
      Scale the resulting oversampling rate (only by powers of two) if
      possible so as to maximise it, reducing the divisor accordingly, and
      avoid a divisor overflow for very low baud rates by scaling the
      oversampling rate and/or the prescaler even if that causes some
      accuracy loss.
    
      Also handle the historic spd_cust feature so as to allow one to set
      all the three parameters manually to arbitrary values, by keeping the
      low 16 bits for the divisor and then putting TCR in bits 19:16 and
      CPR/CPR2 in bits 28:20, sanitising the bit pattern supplied such as
      to clamp CPR/CPR2 values between 0.000 and 0.875 inclusive to 1.000.
      This preserves compatibility with any existing setups, that is where
      requesting a custom divisor that only has any bits set among the low
      16 the oversampling rate of 16 and the clock prescaler of 1 will be
      used.
    
      Finally abuse the `frac' argument to store the determined bit patterns
      for the TCR, CPR and CPR2 registers.
    
    - Override the `set_divisor' handler so as to set the TCR, CPR and CPR2
      registers from the `frac' value supplied.  Set the divisor as usually.
    
    With the baud base set to 15625000 and the unsigned 16-bit UART_DIV_MAX
    limitation imposed by `serial8250_get_baud_rate' standard baud rates
    below 300bps become unavailable in the regular way, e.g. the rate of
    200bps requires the baud base to be divided by 78125 and that is beyond
    the unsigned 16-bit range.  The historic spd_cust feature can still be
    used to obtain such rates if so required.
    
    Here are the figures for the standard and some non-standard baud rates
    (including those quoted in Oxford Semiconductor documentation), giving
    the requested rate (r), the actual rate yielded (a) and its deviation
    from the requested rate (d), and the values of the oversampling rate
    (tcr), the clock prescaler (cpr) and the divisor (div) produced by the
    new `get_divisor' handler:
    
    r: 15625000, a: 15625000.00, d:  0.0000%, tcr:  4, cpr:  1.000, div:     1
    r: 12500000, a: 12500000.00, d:  0.0000%, tcr:  5, cpr:  1.000, div:     1
    r: 10416666, a: 10416666.67, d:  0.0000%, tcr:  6, cpr:  1.000, div:     1
    r:  8928571, a:  8928571.43, d:  0.0000%, tcr:  7, cpr:  1.000, div:     1
    r:  7812500, a:  7812500.00, d:  0.0000%, tcr:  8, cpr:  1.000, div:     1
    r:  4000000, a:  4000000.00, d:  0.0000%, tcr:  5, cpr:  3.125, div:     1
    r:  3686400, a:  3676470.59, d: -0.2694%, tcr:  8, cpr:  2.125, div:     1
    r:  3500000, a:  3496503.50, d: -0.0999%, tcr: 13, cpr:  1.375, div:     1
    r:  3000000, a:  2976190.48, d: -0.7937%, tcr: 14, cpr:  1.500, div:     1
    r:  2500000, a:  2500000.00, d:  0.0000%, tcr: 10, cpr:  2.500, div:     1
    r:  2000000, a:  2000000.00, d:  0.0000%, tcr: 10, cpr:  3.125, div:     1
    r:  1843200, a:  1838235.29, d: -0.2694%, tcr: 16, cpr:  2.125, div:     1
    r:  1500000, a:  1492537.31, d: -0.4975%, tcr:  5, cpr:  8.375, div:     1
    r:  1152000, a:  1152073.73, d:  0.0064%, tcr: 14, cpr:  3.875, div:     1
    r:   921600, a:   919117.65, d: -0.2694%, tcr: 16, cpr:  2.125, div:     2
    r:   576000, a:   576036.87, d:  0.0064%, tcr: 14, cpr:  3.875, div:     2
    r:   460800, a:   460829.49, d:  0.0064%, tcr:  7, cpr:  3.875, div:     5
    r:   230400, a:   230414.75, d:  0.0064%, tcr: 14, cpr:  3.875, div:     5
    r:   115200, a:   115207.37, d:  0.0064%, tcr: 14, cpr:  1.250, div:    31
    r:    57600, a:    57603.69, d:  0.0064%, tcr:  8, cpr:  3.875, div:    35
    r:    38400, a:    38402.46, d:  0.0064%, tcr: 14, cpr:  3.875, div:    30
    r:    19200, a:    19201.23, d:  0.0064%, tcr:  8, cpr:  3.875, div:   105
    r:     9600, a:     9600.06, d:  0.0006%, tcr:  9, cpr:  1.125, div:   643
    r:     4800, a:     4799.98, d: -0.0004%, tcr:  7, cpr:  2.875, div:   647
    r:     2400, a:     2400.02, d:  0.0008%, tcr:  9, cpr:  2.250, div:  1286
    r:     1200, a:     1200.00, d:  0.0000%, tcr: 14, cpr:  2.875, div:  1294
    r:      300, a:      300.00, d:  0.0000%, tcr: 11, cpr:  2.625, div:  7215
    r:      200, a:      200.00, d:  0.0000%, tcr: 16, cpr:  1.250, div: 15625
    r:      150, a:      150.00, d:  0.0000%, tcr: 13, cpr:  2.250, div: 14245
    r:      134, a:      134.00, d:  0.0000%, tcr: 11, cpr:  2.625, div: 16153
    r:      110, a:      110.00, d:  0.0000%, tcr: 12, cpr:  1.000, div: 47348
    r:       75, a:       75.00, d:  0.0000%, tcr:  4, cpr:  5.875, div: 35461
    r:       50, a:       50.00, d:  0.0000%, tcr: 16, cpr:  1.250, div: 62500
    r:       25, a:       25.00, d:  0.0000%, tcr: 16, cpr:  2.500, div: 62500
    r:        4, a:        4.00, d:  0.0000%, tcr: 16, cpr: 20.000, div: 48828
    r:        2, a:        2.00, d:  0.0000%, tcr: 16, cpr: 40.000, div: 48828
    r:        1, a:        1.00, d:  0.0000%, tcr: 16, cpr: 63.875, div: 61154
    
    References:
    
    [1] "OXPCIe200 PCI Express Multi-Port Bridge", Oxford Semiconductor,
        Inc., DS-0045, 10 Nov 2008, Section "950 Mode", pp. 64-65
    
    [2] "OXPCIe952 PCI Express Bridge to Dual Serial & Parallel Port",
        Oxford Semiconductor, Inc., DS-0046, Mar 06 08, Section "950 Mode",
        p. 20
    
    [3] "OXPCIe954 PCI Express Bridge to Quad Serial Port", Oxford
        Semiconductor, Inc., DS-0047, Feb 08, Section "950 Mode", p. 20
    
    [4] "OXPCIe958 PCI Express Bridge to Octal Serial Port", Oxford
        Semiconductor, Inc., DS-0048, Feb 08, Section "950 Mode", p. 20
    
    Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
    Maciej W. Rozycki authored and intel-lab-lkp committed Jun 16, 2021
  3. serial: 8250: Correct the clock for OxSemi PCIe devices

    Oxford Semiconductor PCIe (Tornado) serial port devices are driven by a
    fixed 62.5MHz clock input derived from the 100MHz PCI Express clock.
    
    In the enhanced (650) mode, which we select in `autoconfig_has_efr' by
    setting the ECB bit in the EFR register, and in the absence of clock
    reconfiguration, which we currently don't do, the clock rate is divided
    only by the oversampling rate of 16 as it is supplied to the baud rate
    generator, yielding the baud base of 3906250.  This comes from the reset
    values of the TCR and MCR[7] registers which are both zero[1][2][3][4],
    choosing the oversampling rate of 16 and the normal (divide by 1) baud
    rate generator prescaler respectively.  This is the rate that is divided
    by the value held in the divisor latch to determine the baud rate used.
    
    Replace the incorrect baud base of 4000000 with the right value of
    3906250 then.
    
    References:
    
    [1] "OXPCIe200 PCI Express Multi-Port Bridge", Oxford Semiconductor,
        Inc., DS-0045, 10 Nov 2008, Section "Reset Configuration", p. 72
    
    [2] "OXPCIe952 PCI Express Bridge to Dual Serial & Parallel Port",
        Oxford Semiconductor, Inc., DS-0046, Mar 06 08, Section "Reset
        Configuration", p. 27
    
    [3] "OXPCIe954 PCI Express Bridge to Quad Serial Port", Oxford
        Semiconductor, Inc., DS-0047, Feb 08, Section "Reset Configuration",
        p. 28
    
    [4] "OXPCIe958 PCI Express Bridge to Octal Serial Port", Oxford
        Semiconductor, Inc., DS-0048, Feb 08, Section "Reset Configuration",
        p. 28
    
    Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
    Fixes: 7106b4e ("8250: Oxford Semiconductor Devices")
    Maciej W. Rozycki authored and intel-lab-lkp committed Jun 16, 2021
  4. serial: 8250: Dissociate 4MHz Titan ports from Oxford ports

    Oxford Semiconductor PCIe (Tornado) serial port devices have their baud
    base set incorrectly, however their `pciserial_board' entries have been
    reused for Titan serial port devices.  Define own entries for the latter
    devices then, carrying over the settings, so that Oxford entries can be
    fixed.
    
    Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
    Maciej W. Rozycki authored and intel-lab-lkp committed Jun 16, 2021

Commits on Jun 15, 2021

  1. proc: only require mm_struct for writing

    Commit 591a22c ("proc: Track /proc/$pid/attr/ opener mm_struct") we
    started using __mem_open() to track the mm_struct at open-time, so that
    we could then check it for writes.
    
    But that also ended up making the permission checks at open time much
    stricter - and not just for writes, but for reads too.  And that in turn
    caused a regression for at least Fedora 29, where NIC interfaces fail to
    start when using NetworkManager.
    
    Since only the write side wanted the mm_struct test, ignore any failures
    by __mem_open() at open time, leaving reads unaffected.  The write()
    time verification of the mm_struct pointer will then catch the failure
    case because a NULL pointer will not match a valid 'current->mm'.
    
    Link: https://lore.kernel.org/netdev/YMjTlp2FSJYvoyFa@unreal/
    Fixes: 591a22c ("proc: Track /proc/$pid/attr/ opener mm_struct")
    Reported-and-tested-by: Leon Romanovsky <leon@kernel.org>
    Cc: Kees Cook <keescook@chromium.org>
    Cc: Christian Brauner <christian.brauner@ubuntu.com>
    Cc: Andrea Righi <andrea.righi@canonical.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    torvalds committed Jun 15, 2021
  2. afs: Fix an IS_ERR() vs NULL check

    The proc_symlink() function returns NULL on error, it doesn't return
    error pointers.
    
    Fixes: 5b86d4f ("afs: Implement network namespacing")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: David Howells <dhowells@redhat.com>
    cc: linux-afs@lists.infradead.org
    Link: https://lore.kernel.org/r/YLjMRKX40pTrJvgf@mwanda/
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    error27 authored and torvalds committed Jun 15, 2021

Commits on Jun 13, 2021

  1. Linux 5.13-rc6

    torvalds committed Jun 13, 2021
  2. Merge tag 'perf-tools-fixes-for-v5.13-2021-06-13' of git://git.kernel…

    ….org/pub/scm/linux/kernel/git/acme/linux
    
    Pull perf tools fixes from Arnaldo Carvalho de Melo:
    
     - Correct buffer copying when peeking events
    
     - Sync cpufeatures/disabled-features.h header with the kernel sources
    
    * tag 'perf-tools-fixes-for-v5.13-2021-06-13' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
      tools headers cpufeatures: Sync with the kernel sources
      perf session: Correct buffer copying when peeking events
    torvalds committed Jun 13, 2021
  3. Merge tag 'nfs-for-5.13-3' of git://git.linux-nfs.org/projects/trondm…

    …y/linux-nfs
    
    Pull NFS client bugfixes from Trond Myklebust:
     "Highlights include:
    
      Stable fixes:
    
       - Fix use-after-free in nfs4_init_client()
    
      Bugfixes:
    
       - Fix deadlock between nfs4_evict_inode() and nfs4_opendata_get_inode()
    
       - Fix second deadlock in nfs4_evict_inode()
    
       - nfs4_proc_set_acl should not change the value of NFS_CAP_UIDGID_NOMAP
    
       - Fix setting of the NFS_CAP_SECURITY_LABEL capability"
    
    * tag 'nfs-for-5.13-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
      NFSv4: Fix second deadlock in nfs4_evict_inode()
      NFSv4: Fix deadlock between nfs4_evict_inode() and nfs4_opendata_get_inode()
      NFS: FMODE_READ and friends are C macros, not enum types
      NFS: Fix a potential NULL dereference in nfs_get_client()
      NFS: Fix use-after-free in nfs4_init_client()
      NFS: Ensure the NFS_CAP_SECURITY_LABEL capability is set when appropriate
      NFSv4: nfs4_proc_set_acl needs to restore NFS_CAP_UIDGID_NOMAP on error.
    torvalds committed Jun 13, 2021
  4. Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/g…

    …it/jejb/scsi
    
    Pull SCSI fixes from James Bottomley:
     "Four reasonably small fixes to the core for scsi host allocation
      failure paths.
    
      The root problem is that we're not freeing the memory allocated by
      dev_set_name(), which involves a rejig of may of the free on error
      paths to do put_device() instead of kfree which, in turn, has several
      other knock on ramifications and inspection turned up a few other
      lurking bugs"
    
    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
      scsi: core: Only put parent device if host state differs from SHOST_CREATED
      scsi: core: Put .shost_dev in failure path if host state changes to RUNNING
      scsi: core: Fix failure handling of scsi_add_host_with_dma()
      scsi: core: Fix error handling of scsi_host_alloc()
    torvalds committed Jun 13, 2021

Commits on Jun 12, 2021

  1. Merge tag 'riscv-for-linus-5.13-rc6' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/riscv/linux
    
    Pull RISC-V fixes from Palmer Dabbelt:
    
     - A pair of XIP fixes: one to fix alternatives, and one to turn off the
       rest of the features that require code modification
    
     - A fix to a type that was causing some alternatives to break
    
     - A build fix for BUILTIN_DTB
    
    * tag 'riscv-for-linus-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
      riscv: Fix BUILTIN_DTB for sifive and microchip soc
      riscv: alternative: fix typo in macro name
      riscv: code patching only works on !XIP_KERNEL
      riscv: xip: support runtime trap patching
    torvalds committed Jun 12, 2021
  2. mm: relocate 'write_protect_seq' in struct mm_struct

    0day robot reported a 9.2% regression for will-it-scale mmap1 test
    case[1], caused by commit 57efa1f ("mm/gup: prevent gup_fast from
    racing with COW during fork").
    
    Further debug shows the regression is due to that commit changes the
    offset of hot fields 'mmap_lock' inside structure 'mm_struct', thus some
    cache alignment changes.
    
    From the perf data, the contention for 'mmap_lock' is very severe and
    takes around 95% cpu cycles, and it is a rw_semaphore
    
            struct rw_semaphore {
                    atomic_long_t count;	/* 8 bytes */
                    atomic_long_t owner;	/* 8 bytes */
                    struct optimistic_spin_queue osq; /* spinner MCS lock */
                    ...
    
    Before commit 57efa1f adds the 'write_protect_seq', it happens to
    have a very optimal cache alignment layout, as Linus explained:
    
     "and before the addition of the 'write_protect_seq' field, the
      mmap_sem was at offset 120 in 'struct mm_struct'.
    
      Which meant that count and owner were in two different cachelines,
      and then when you have contention and spend time in
      rwsem_down_write_slowpath(), this is probably *exactly* the kind
      of layout you want.
    
      Because first the rwsem_write_trylock() will do a cmpxchg on the
      first cacheline (for the optimistic fast-path), and then in the
      case of contention, rwsem_down_write_slowpath() will just access
      the second cacheline.
    
      Which is probably just optimal for a load that spends a lot of
      time contended - new waiters touch that first cacheline, and then
      they queue themselves up on the second cacheline."
    
    After the commit, the rw_semaphore is at offset 128, which means the
    'count' and 'owner' fields are now in the same cacheline, and causes
    more cache bouncing.
    
    Currently there are 3 "#ifdef CONFIG_XXX" before 'mmap_lock' which will
    affect its offset:
    
      CONFIG_MMU
      CONFIG_MEMBARRIER
      CONFIG_HAVE_ARCH_COMPAT_MMAP_BASES
    
    The layout above is on 64 bits system with 0day's default kernel config
    (similar to RHEL-8.3's config), in which all these 3 options are 'y'.
    And the layout can vary with different kernel configs.
    
    Relayouting a structure is usually a double-edged sword, as sometimes it
    can helps one case, but hurt other cases.  For this case, one solution
    is, as the newly added 'write_protect_seq' is a 4 bytes long seqcount_t
    (when CONFIG_DEBUG_LOCK_ALLOC=n), placing it into an existing 4 bytes
    hole in 'mm_struct' will not change other fields' alignment, while
    restoring the regression.
    
    Link: https://lore.kernel.org/lkml/20210525031636.GB7744@xsang-OptiPlex-9020/ [1]
    Reported-by: kernel test robot <oliver.sang@intel.com>
    Signed-off-by: Feng Tang <feng.tang@intel.com>
    Reviewed-by: John Hubbard <jhubbard@nvidia.com>
    Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
    Cc: Peter Xu <peterx@redhat.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    ftang1 authored and torvalds committed Jun 12, 2021
  3. Merge tag 'usb-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel…

    …/git/gregkh/usb
    
    Pull USB fixes from Greg KH:
     "Here are a number of tiny USB fixes for 5.13-rc6.
    
      There are more than I would normally like, but there's been a bunch of
      people banging on the gadget and dwc3 and typec code recently for I
      think an Android release, which has resulted in a number of small
      fixes. It's nice to see companies send fixes upstream for this type of
      work, a notable change from years ago.
    
      Anyway, fixes in here are:
    
       - usb-serial device id updates
    
       - usb-serial cp210x driver fixes for broken firmware versions
    
       - typec fixes for crazy charging devices and other reported problems
    
       - dwc3 fixes for reported problems found
    
       - gadget fixes for reported problems
    
       - tiny xhci fixes
    
       - other small fixes for reported issues.
    
       - revert of a problem fix found by linux-next testing
    
      All of these have passed 0-day and linux-next testing with no reported
      problems (the revert for the found linux-next build problem included)"
    
    * tag 'usb-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (44 commits)
      Revert "usb: gadget: fsl: Re-enable driver for ARM SoCs"
      usb: typec: mux: Fix copy-paste mistake in typec_mux_match
      usb: typec: ucsi: Clear PPM capability data in ucsi_init() error path
      usb: gadget: fsl: Re-enable driver for ARM SoCs
      usb: typec: wcove: Use LE to CPU conversion when accessing msg->header
      USB: serial: cp210x: fix CP2102N-A01 modem control
      USB: serial: cp210x: fix alternate function for CP2102N QFN20
      usb: misc: brcmstb-usb-pinmap: check return value after calling platform_get_resource()
      usb: dwc3: ep0: fix NULL pointer exception
      usb: gadget: eem: fix wrong eem header operation
      usb: typec: intel_pmc_mux: Put ACPI device using acpi_dev_put()
      usb: typec: intel_pmc_mux: Add missed error check for devm_ioremap_resource()
      usb: typec: intel_pmc_mux: Put fwnode in error case during ->probe()
      usb: typec: tcpm: Do not finish VDM AMS for retrying Responses
      usb: fix various gadget panics on 10gbps cabling
      usb: fix various gadgets null ptr deref on 10gbps cabling.
      usb: pci-quirks: disable D3cold on xhci suspend for s2idle on AMD Renoir
      usb: f_ncm: only first packet of aggregate needs to start timer
      USB: f_ncm: ncm_bitrate (speed) is unsigned
      MAINTAINERS: usb: add entry for isp1760
      ...
    torvalds committed Jun 12, 2021
  4. Merge tag 'tty-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel…

    …/git/gregkh/tty
    
    Pull serial driver fix from Greg KH:
     "A single 8250_exar serial driver fix for a reported problem with a
      change that happened in 5.13-rc1.
    
      It has been in linux-next with no reported problems"
    
    * tag 'tty-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
      serial: 8250_exar: Avoid NULL pointer dereference at ->exit()
    torvalds committed Jun 12, 2021
  5. Merge tag 'staging-5.13-rc6' of git://git.kernel.org/pub/scm/linux/ke…

    …rnel/git/gregkh/staging
    
    Pull staging driver fixes from Greg KH:
     "Two tiny staging driver fixes:
    
       - ralink-gdma driver authorship information fixed up
    
       - rtl8723bs driver fix for reported regression
    
      Both have been in linux-next for a while with no reported problems"
    
    * tag 'staging-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
      staging: ralink-gdma: Remove incorrect author information
      staging: rtl8723bs: Fix uninitialized variables
    torvalds committed Jun 12, 2021
  6. Merge tag 'driver-core-5.13-rc6' of git://git.kernel.org/pub/scm/linu…

    …x/kernel/git/gregkh/driver-core
    
    Pull driver core fix from Greg KH:
     "A single debugfs fix for 5.13-rc6, fixing a bug in
      debugfs_read_file_str() that showed up in 5.13-rc1.
    
      It has been in linux-next for a full week with no
      reported problems"
    
    * tag 'driver-core-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
      debugfs: Fix debugfs_read_file_str()
    torvalds committed Jun 12, 2021
  7. Merge tag 'char-misc-5.13-rc6' of git://git.kernel.org/pub/scm/linux/…

    …kernel/git/gregkh/char-misc
    
    Pull char/misc driver fixes from Greg KH:
     "Here are some small misc driver fixes for 5.13-rc6 that fix some
      reported problems:
    
       - Tiny phy driver fixes for reported issues
    
       - rtsx regression for when the device suspended
    
       - mhi driver fix for a use-after-free
    
      All of these have been in linux-next for a few days with no reported
      issues"
    
    * tag 'char-misc-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
      misc: rtsx: separate aspm mode into MODE_REG and MODE_CFG
      bus: mhi: pci-generic: Fix hibernation
      bus: mhi: pci_generic: Fix possible use-after-free in mhi_pci_remove()
      bus: mhi: pci_generic: T99W175: update channel name from AT to DUN
      phy: Sparx5 Eth SerDes: check return value after calling platform_get_resource()
      phy: ralink: phy-mt7621-pci: drop 'of_match_ptr' to fix -Wunused-const-variable
      phy: ti: Fix an error code in wiz_probe()
      phy: phy-mtk-tphy: Fix some resource leaks in mtk_phy_init()
      phy: cadence: Sierra: Fix error return code in cdns_sierra_phy_probe()
      phy: usb: Fix misuse of IS_ENABLED
    torvalds committed Jun 12, 2021
  8. Merge tag 'pinctrl-v5.13-2' of git://git.kernel.org/pub/scm/linux/ker…

    …nel/git/linusw/linux-pinctrl
    
    Pull pin control fixes from Linus Walleij:
    
     - Fix some documentation warnings for Allwinner
    
     - Fix duplicated GPIO groups on Qualcomm SDX55
    
     - Fix a double enablement bug in the Ralink driver
    
     - Fix the Qualcomm SC8180x Kconfig so the driver can be selected.
    
    * tag 'pinctrl-v5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
      pinctrl: qcom: Make it possible to select SC8180x TLMM
      pinctrl: ralink: rt2880: avoid to error in calls is pin is already enabled
      pinctrl: qcom: Fix duplication in gpio_groups
      pinctrl: aspeed: Fix minor documentation error
    torvalds committed Jun 12, 2021
  9. Merge tag 'block-5.13-2021-06-12' of git://git.kernel.dk/linux-block

    Pull block fixes from Jens Axboe:
     "A few fixes that should go into 5.13:
    
       - Fix a regression deadlock introduced in this release between open
         and remove of a bdev (Christoph)
    
       - Fix an async_xor md regression in this release (Xiao)
    
       - Fix bcache oversized read issue (Coly)"
    
    * tag 'block-5.13-2021-06-12' of git://git.kernel.dk/linux-block:
      block: loop: fix deadlock between open and remove
      async_xor: check src_offs is not NULL before updating it
      bcache: avoid oversized read request in cache missing code path
      bcache: remove bcache device self-defined readahead
    torvalds committed Jun 12, 2021
  10. Merge tag 'io_uring-5.13-2021-06-12' of git://git.kernel.dk/linux-block

    Pull io_uring fixes from Jens Axboe:
     "Just an API change for the registration changes that went into this
      release. Better to get it sorted out now than before it's too late"
    
    * tag 'io_uring-5.13-2021-06-12' of git://git.kernel.dk/linux-block:
      io_uring: add feature flag for rsrc tags
      io_uring: change registration/upd/rsrc tagging ABI
    torvalds committed Jun 12, 2021
  11. Merge tag 'sched-urgent-2021-06-12' of git://git.kernel.org/pub/scm/l…

    …inux/kernel/git/tip/tip
    
    Pull scheduler fixes from Ingo Molnar:
     "Misc fixes:
    
       - Fix performance regression caused by lack of intended batching of
         RCU callbacks by over-eager NOHZ-full code.
    
       - Fix cgroups related corruption of load_avg and load_sum metrics.
    
       - Three fixes to fix blocked load, util_sum/runnable_sum and util_est
         tracking bugs"
    
    * tag 'sched-urgent-2021-06-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      sched/fair: Fix util_est UTIL_AVG_UNCHANGED handling
      sched/pelt: Ensure that *_sum is always synced with *_avg
      tick/nohz: Only check for RCU deferred wakeup on user/guest entry when needed
      sched/fair: Make sure to update tg contrib for blocked load
      sched/fair: Keep load_avg and load_sum synced
    torvalds committed Jun 12, 2021
  12. Merge tag 'perf-urgent-2021-06-12' of git://git.kernel.org/pub/scm/li…

    …nux/kernel/git/tip/tip
    
    Pull perf fixes from Ingo Molnar:
     "Misc fixes:
    
       - Fix the NMI watchdog on ancient Intel CPUs
    
       - Remove a misguided, NMI-unsafe KASAN callback from the NMI-safe
         irq_work path used by perf.
    
       - Fix uncore events on Ice Lake servers.
    
       - Someone booted maxcpus=1 on an SNB-EP, and the uncore driver
         emitted warnings and was probably buggy. Fix it.
    
       - KCSAN found a genuine data race in the core perf code. Somewhat
         ironically the bug was introduced through a recent race fix. :-/
         In our defense, the new race window was much more narrow. Fix it"
    
    * tag 'perf-urgent-2021-06-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      x86/nmi_watchdog: Fix old-style NMI watchdog regression on old Intel CPUs
      irq_work: Make irq_work_queue() NMI-safe again
      perf/x86/intel/uncore: Fix M2M event umask for Ice Lake server
      perf/x86/intel/uncore: Fix a kernel WARNING triggered by maxcpus=1
      perf: Fix data race between pin_count increment/decrement
    torvalds committed Jun 12, 2021
  13. Merge tag 'objtool-urgent-2021-06-12' of git://git.kernel.org/pub/scm…

    …/linux/kernel/git/tip/tip
    
    Pull objtool fixes from Ingo Molnar:
     "Two objtool fixes:
    
       - fix a bug that corrupts the code by mistakenly rewriting
         conditional jumps
    
       - fix another bug generating an incorrect ELF symbol table
         during retpoline rewriting"
    
    * tag 'objtool-urgent-2021-06-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      objtool: Only rewrite unconditional retpoline thunk calls
      objtool: Fix .symtab_shndx handling for elf_create_undef_symbol()
    torvalds committed Jun 12, 2021
  14. riscv: Fix BUILTIN_DTB for sifive and microchip soc

    Fix BUILTIN_DTB config which resulted in a dtb that was actually not
    built into the Linux image: in the same manner as Canaan soc does,
    create an object file from the dtb file that will get linked into the
    Linux image.
    
    Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
    Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
    AlexGhiti authored and palmer-dabbelt committed Jun 12, 2021
  15. Merge tag 'trace-v5.13-rc5-2' of git://git.kernel.org/pub/scm/linux/k…

    …ernel/git/rostedt/linux-trace
    
    Pull tracing fixes from Steven Rostedt:
    
     - Fix the length check in the temp buffer filter
    
     - Fix build failure in bootconfig tools for "fallthrough" macro
    
     - Fix error return of bootconfig apply_xbc() routine
    
    * tag 'trace-v5.13-rc5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
      tracing: Correct the length check which causes memory corruption
      ftrace: Do not blindly read the ip address in ftrace_bug()
      tools/bootconfig: Fix a build error accroding to undefined fallthrough
      tools/bootconfig: Fix error return code in apply_xbc()
    torvalds committed Jun 12, 2021

Commits on Jun 11, 2021

  1. Merge tag 'clang-features-v5.13-rc6' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/kees/linux
    
    Pull clang LTO fix from Kees Cook:
     "Clang 13 fixed some IR behavior for LTO, but this broke work-arounds
      used in the kernel.
    
      Handle changes to needed LTO flags in Clang 13 (Tor Vic)"
    
    * tag 'clang-features-v5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
      x86, lto: Pass -stack-alignment only on LLD < 13.0.0
    torvalds committed Jun 11, 2021
  2. Merge tag 'gpio-fixes-for-v5.13-rc6' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/brgl/linux
    
    Pull gpio fix from Bartosz Golaszewski:
     "Fix a shift-out-of-bounds error in gpio-wcd934x"
    
    * tag 'gpio-fixes-for-v5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
      gpio: wcd934x: Fix shift-out-of-bounds error
    torvalds committed Jun 11, 2021
  3. Merge tag 'drm-fixes-2021-06-11' of git://anongit.freedesktop.org/drm…

    …/drm
    
    Pull drm fixes from Dave Airlie:
     "Another week of fixes, nothing too crazy, but a few all over the
      place.
    
      Two locking fixes in the core/ttm area, a couple of small driver fixes
      (radeon, sun4i, mcde, vc4). Then msm and amdgpu have a set of fixes
      each, mostly for smaller things, though the msm has a DSI fix for a
      black screen.
    
      I haven't seen any intel fixes this week so they may have a few that
      may or may not wait for next week.
    
      drm:
       - auth locking fix
    
      ttm:
       - locking fix
    
      amdgpu:
       - Use kvzmalloc in amdgu_bo_create
       - Use drm_dbg_kms for reporting failure to get a GEM FB
       - Fix some register offsets for Sienna Cichlid
       - Fix fall-through warning
    
      radeon:
       - memcpy_to/from_io fixes
    
      msm:
       - NULL ptr deref fix
       - CP_PROTECT reg programming fix
       - incorrect register shift fix
       - DSI blank screen fix
    
      sun4i:
       - hdmi output probing fix
    
      mcde:
       - DSI pipeline calc fix
    
      vc4:
       - out of bounds fix"
    
    * tag 'drm-fixes-2021-06-11' of git://anongit.freedesktop.org/drm/drm:
      drm/msm/dsi: Stash away calculated vco frequency on recalc
      drm: Lock pointer access in drm_master_release()
      drm/mcde: Fix off by 10^3 in calculation
      drm/msm/a6xx: avoid shadow NULL reference in failure path
      drm/msm/a6xx: fix incorrectly set uavflagprd_inv field for A650
      drm/msm/a6xx: update/fix CP_PROTECT initialization
      radeon: use memcpy_to/fromio for UVD fw upload
      drm/amd/pm: Fix fall-through warning for Clang
      drm/amdgpu: Fix incorrect register offsets for Sienna Cichlid
      drm/amdgpu: Use drm_dbg_kms for reporting failure to get a GEM FB
      drm/amdgpu: switch kzalloc to kvzalloc in amdgpu_bo_create
      drm/msm: Init mm_list before accessing it for use_vram path
      drm: Fix use-after-free read in drm_getunique()
      drm/vc4: fix vc4_atomic_commit_tail() logic
      drm/ttm: fix deref of bo->ttm without holding the lock v2
      drm/sun4i: dw-hdmi: Make HDMI PHY into a platform device
    torvalds committed Jun 11, 2021
  4. Merge tag 'devicetree-fixes-for-5.13-3' of git://git.kernel.org/pub/s…

    …cm/linux/kernel/git/robh/linux
    
    Pull devicetree fix from Rob Herring:
     "A single fix for broken media/renesas,drif.yaml binding schema"
    
    * tag 'devicetree-fixes-for-5.13-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
      media: dt-bindings: media: renesas,drif: Fix fck definition
    torvalds committed Jun 11, 2021
  5. Merge branch 'md-fixes' of https://git.kernel.org/pub/scm/linux/kerne…

    …l/git/song/md into block-5.13
    
    Pull MD related fix from Song.
    
    * 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md:
      async_xor: check src_offs is not NULL before updating it
    axboe committed Jun 11, 2021
  6. Merge tag 'acpi-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kerne…

    …l/git/rafael/linux-pm
    
    Pull ACPI fixes from Rafael Wysocki:
     "These revert a problematic recent commit and fix a regression
      introduced during the 5.12 development cycle.
    
      Specifics:
    
       - Revert recent commit that attempted to fix the FACS table reference
         counting but introduced a problem with accessing the hardware
         signature after hibernation (Zhang Rui).
    
       - Fix regression in the _OSC handling that broke the loading of ACPI
         tables on some systems (Mika Westerberg)"
    
    * tag 'acpi-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
      ACPI: Pass the same capabilities to the _OSC regardless of the query flag
      Revert "ACPI: sleep: Put the FACS table after using it"
    torvalds committed Jun 11, 2021
  7. block: loop: fix deadlock between open and remove

    Commit c76f48e ("block: take bd_mutex around delete_partitions in
    del_gendisk") adds disk->part0->bd_mutex in del_gendisk(), this way
    causes the following AB/BA deadlock between removing loop and opening
    loop:
    
     1) loop_control_ioctl(LOOP_CTL_REMOVE)
         -> mutex_lock(&loop_ctl_mutex)
         -> del_gendisk
             -> mutex_lock(&disk->part0->bd_mutex)
    
     2) blkdev_get_by_dev
         -> mutex_lock(&disk->part0->bd_mutex)
         -> lo_open
             -> mutex_lock(&loop_ctl_mutex)
    
    Add a new Lo_deleting state to remove the need for clearing
    ->private_data and thus holding loop_ctl_mutex in the ioctl
    LOOP_CTL_REMOVE path.
    
    Based on an analysis and earlier patch from
    Ming Lei <ming.lei@redhat.com>.
    
    Reported-by: Colin Ian King <colin.king@canonical.com>
    Fixes: c76f48e ("block: take bd_mutex around delete_partitions in del_gendisk")
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Tested-by: Colin Ian King <colin.king@canonical.com>
    Reviewed-by: Ming Lei <ming.lei@redhat.com>
    Link: https://lore.kernel.org/r/20210605140950.5800-1-hch@lst.de
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Christoph Hellwig authored and axboe committed Jun 11, 2021
  8. Merge tag 'sound-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kern…

    …el/git/tiwai/sound
    
    Pull sound fixes from Takashi Iwai:
     "A bit more commits than expected at this time, but likely it's the
      last shot before the final.
    
      Many of changes are device-specific fix-ups for various ASoC drivers,
      while a few usual HD-audio quirks and a FireWire fix, as well as a
      couple of ALSA / ASoC core fixes.
    
      All look nice and small, and nothing to scare much"
    
    * tag 'sound-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
      ALSA: seq: Fix race of snd_seq_timer_open()
      ALSA: hda/realtek: fix mute/micmute LEDs for HP ZBook Power G8
      ALSA: hda/realtek: headphone and mic don't work on an Acer laptop
      ASoC: qcom: lpass-cpu: Fix pop noise during audio capture begin
      ALSA: firewire-lib: fix the context to call snd_pcm_stop_xrun()
      ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook 840 Aero G8
      ALSA: hda/realtek: fix mute/micmute LEDs and speaker for HP EliteBook x360 1040 G8
      ALSA: hda/realtek: fix mute/micmute LEDs and speaker for HP Elite Dragonfly G2
      ASoC: rt5682: Fix the fast discharge for headset unplugging in soundwire mode
      ASoC: tas2562: Fix TDM_CFG0_SAMPRATE values
      ASoC: meson: gx-card: fix sound-dai dt schema
      ASoC: AMD Renoir: Remove fix for DMI entry on Lenovo 2020 platforms
      ASoC: AMD Renoir - add DMI entry for Lenovo 2020 AMD platforms
      ASoC: SOF: reset enabled_cores state at suspend
      ASoC: fsl-asoc-card: Set .owner attribute when registering card.
      ASoC: topology: Fix spelling mistake "vesion" -> "version"
      ASoC: rt5659: Fix the lost powers for the HDA header
      ASoC: core: Fix Null-point-dereference in fmt_single_name()
    torvalds committed Jun 11, 2021
  9. x86, lto: Pass -stack-alignment only on LLD < 13.0.0

    Since LLVM commit 3787ee4, the '-stack-alignment' flag has been dropped
    [1], leading to the following error message when building a LTO kernel
    with Clang-13 and LLD-13:
    
        ld.lld: error: -plugin-opt=-: ld.lld: Unknown command line argument
        '-stack-alignment=8'.  Try 'ld.lld --help'
        ld.lld: Did you mean '--stackrealign=8'?
    
    It also appears that the '-code-model' flag is not necessary anymore
    starting with LLVM-9 [2].
    
    Drop '-code-model' and make '-stack-alignment' conditional on LLD < 13.0.0.
    
    These flags were necessary because these flags were not encoded in the
    IR properly, so the link would restart optimizations without them. Now
    there are properly encoded in the IR, and these flags exposing
    implementation details are no longer necessary.
    
    [1] https://reviews.llvm.org/D103048
    [2] https://reviews.llvm.org/D52322
    
    Cc: stable@vger.kernel.org
    Link: ClangBuiltLinux#1377
    Signed-off-by: Tor Vic <torvic9@mailbox.org>
    Reviewed-by: Nathan Chancellor <nathan@kernel.org>
    Tested-by: Nathan Chancellor <nathan@kernel.org>
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Link: https://lore.kernel.org/r/f2c018ee-5999-741e-58d4-e482d5246067@mailbox.org
    torvic9 authored and kees committed Jun 11, 2021
  10. Merge tag 'hwmon-for-v5.13-rc6' of git://git.kernel.org/pub/scm/linux…

    …/kernel/git/groeck/linux-staging
    
    Pull hwmon fixes from Guenter Roeck:
     "Fixes for tps23861, scpi-hwmon, and corsair-psu drivers, plus a
      bindings fix for TI ADS7828"
    
    * tag 'hwmon-for-v5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
      hwmon: (tps23861) correct shunt LSB values
      hwmon: (tps23861) set current shunt value
      hwmon: (tps23861) define regmap max register
      hwmon: (scpi-hwmon) shows the negative temperature properly
      hwmon: (corsair-psu) fix suspend behavior
      dt-bindings: hwmon: Fix typo in TI ADS7828 bindings
    torvalds committed Jun 11, 2021
Older