1. 13 May, 2021 3 commits
    • Sebastian Andrzej Siewior's avatar
      net: Treat __napi_schedule_irqoff() as __napi_schedule() on PREEMPT_RT · 8380c81d
      Sebastian Andrzej Siewior authored
      __napi_schedule_irqoff() is an optimized version of __napi_schedule()
      which can be used where it is known that interrupts are disabled,
      e.g. in interrupt-handlers, spin_lock_irq() sections or hrtimer
      callbacks.
      
      On PREEMPT_RT enabled kernels this assumptions is not true. Force-
      threaded interrupt handlers and spinlocks are not disabling interrupts
      and the NAPI hrtimer callback is forced into softirq context which runs
      with interrupts enabled as well.
      
      Chasing all usage sites of __napi_schedule_irqoff() is a whack-a-mole
      game so make __napi_schedule_irqoff() invoke __napi_schedule() for
      PREEMPT_RT kernels.
      
      The callers of ____napi_schedule() in the networking core have been
      audited and are correct on PREEMPT_RT kernels as well.
      Reported-by: default avatarJuri Lelli <juri.lelli@redhat.com>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarJuri Lelli <juri.lelli@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8380c81d
    • Johannes Berg's avatar
      alx: use fine-grained locking instead of RTNL · 4a5fe57e
      Johannes Berg authored
      In the alx driver, all locking depended on the RTNL, but
      that causes issues with ipconfig ("ip=..." command line)
      because that waits for the netdev to have a carrier while
      holding the RTNL, but the alx workers etc. require RTNL,
      so the carrier won't be set until the RTNL is dropped and
      can be acquired by alx workers. This causes long delays
      at boot, as reported by Nikolai Zhubr.
      
      Really the only sensible thing to do here is to not use
      the RTNL for everything, but instead have fine-grained
      locking for just the driver. Do that, it's not that hard.
      Reported-by: default avatarNikolai Zhubr <zhubr.2@gmail.com>
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4a5fe57e
    • Yannick Vignon's avatar
      net: taprio offload: enforce qdisc to netdev queue mapping · 13511704
      Yannick Vignon authored
      Even though the taprio qdisc is designed for multiqueue devices, all the
      queues still point to the same top-level taprio qdisc. This works and is
      probably required for software taprio, but at least with offload taprio,
      it has an undesirable side effect: because the whole qdisc is run when a
      packet has to be sent, it allows packets in a best-effort class to be
      processed in the context of a task sending higher priority traffic. If
      there are packets left in the qdisc after that first run, the NET_TX
      softirq is raised and gets executed immediately in the same process
      context. As with any other softirq, it runs up to 10 times and for up to
      2ms, during which the calling process is waiting for the sendmsg call (or
      similar) to return. In my use case, that calling process is a real-time
      task scheduled to send a packet every 2ms, so the long sendmsg calls are
      leading to missed timeslots.
      
      By attaching each netdev queue to its own qdisc, as it is done with
      the "classic" mq qdisc, each traffic class can be processed independently
      without touching the other classes. A high-priority process can then send
      packets without getting stuck in the sendmsg call anymore.
      Signed-off-by: default avatarYannick Vignon <yannick.vignon@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      13511704
  2. 12 May, 2021 2 commits
  3. 11 May, 2021 5 commits
    • Guenter Roeck's avatar
      net/sched: taprio: Drop unnecessary NULL check after container_of · faa5f5da
      Guenter Roeck authored
      The rcu_head pointer passed to taprio_free_sched_cb is never NULL.
      That means that the result of container_of() operations on it is also
      never NULL, even though rcu_head is the first element of the structure
      embedding it. On top of that, it is misleading to perform a NULL check
      on the result of container_of() because the position of the contained
      element could change, which would make the check invalid. Remove the
      unnecessary NULL check.
      
      This change was made automatically with the following Coccinelle script.
      
      @@
      type t;
      identifier v;
      statement s;
      @@
      
      <+...
      (
        t v = container_of(...);
      |
        v = container_of(...);
      )
        ...
        when != v
      - if (\( !v \| v == NULL \) ) s
      ...+>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      faa5f5da
    • Loic Poulain's avatar
      usb: class: cdc-wdm: WWAN framework integration · cac6fb01
      Loic Poulain authored
      The WWAN framework provides a unified way to handle WWAN/modems and its
      control port(s). It has initially been introduced to support MHI/PCI
      modems, offering the same control protocols as the USB variants such as
      MBIM, QMI, AT... The WWAN framework exposes these control protocols as
      character devices, similarly to cdc-wdm, but in a bus agnostic fashion.
      
      This change adds registration of the USB modem cdc-wdm control endpoints
      to the WWAN framework as standard control ports (wwanXpY...).
      
      Exposing cdc-wdm through WWAN framework normally maintains backward
      compatibility, e.g:
          $ qmicli --device-open-qmi -d /dev/wwan0p1QMI --dms-get-ids
      instead of
          $ qmicli --device-open-qmi -d /dev/cdc-wdm0 --dms-get-ids
      
      However, some tools may rely on cdc-wdm driver/device name for device
      detection. It is then safer to keep the 'legacy' cdc-wdm character
      device to prevent any breakage. This is handled in this change by
      API mutual exclusion, only one access method can be used at a time,
      either cdc-wdm chardev or WWAN API.
      
      Note that unknown channel types (other than MBIM, AT or MBIM) are not
      registered to the WWAN framework.
      Signed-off-by: default avatarLoic Poulain <loic.poulain@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cac6fb01
    • Loic Poulain's avatar
      net: wwan: Add unknown port type · bf30396c
      Loic Poulain authored
      Some devices may have ports with unknown type/protocol which need to
      be tagged (though not supported by WWAN core). This will be the case
      for cdc-wdm based drivers.
      Signed-off-by: default avatarLoic Poulain <loic.poulain@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf30396c
    • Zou Wei's avatar
      mISDN: fix possible use-after-free in HFC_cleanup() · 009fc857
      Zou Wei authored
      This module's remove path calls del_timer(). However, that function
      does not wait until the timer handler finishes. This means that the
      timer handler may still be running after the driver's remove function
      has finished, which would result in a use-after-free.
      
      Fix by calling del_timer_sync(), which makes sure the timer handler
      has finished, and unable to re-schedule itself.
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarZou Wei <zou_wei@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      009fc857
    • Zou Wei's avatar
      atm: iphase: fix possible use-after-free in ia_module_exit() · 1c72e6ab
      Zou Wei authored
      This module's remove path calls del_timer(). However, that function
      does not wait until the timer handler finishes. This means that the
      timer handler may still be running after the driver's remove function
      has finished, which would result in a use-after-free.
      
      Fix by calling del_timer_sync(), which makes sure the timer handler
      has finished, and unable to re-schedule itself.
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarZou Wei <zou_wei@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c72e6ab
  4. 10 May, 2021 25 commits
  5. 08 May, 2021 5 commits
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.13-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · b7415964
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - A fix to avoid over-allocating the kernel's mapping on !MMU systems,
         which could lead to up to 2MiB of lost memory
      
       - The SiFive address extension errata only manifest on rv64, they are
         now disabled on rv32 where they are unnecessary
      
       - A pair of late-landing cleanups
      
      * tag 'riscv-for-linus-5.13-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: remove unused handle_exception symbol
        riscv: Consistify protect_kernel_linear_mapping_text_rodata() use
        riscv: enable SiFive errata CIP-453 and CIP-1200 Kconfig only if CONFIG_64BIT=y
        riscv: Only extend kernel reservation if mapped read-only
      b7415964
    • Linus Torvalds's avatar
      drm/i915/display: fix compiler warning about array overrun · fec4d427
      Linus Torvalds authored
      intel_dp_check_mst_status() uses a 14-byte array to read the DPRX Event
      Status Indicator data, but then passes that buffer at offset 10 off as
      an argument to drm_dp_channel_eq_ok().
      
      End result: there are only 4 bytes remaining of the buffer, yet
      drm_dp_channel_eq_ok() wants a 6-byte buffer.  gcc-11 correctly warns
      about this case:
      
        drivers/gpu/drm/i915/display/intel_dp.c: In function ‘intel_dp_check_mst_status’:
        drivers/gpu/drm/i915/display/intel_dp.c:3491:22: warning: ‘drm_dp_channel_eq_ok’ reading 6 bytes from a region of size 4 [-Wstringop-overread]
         3491 |                     !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
              |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        drivers/gpu/drm/i915/display/intel_dp.c:3491:22: note: referencing argument 1 of type ‘const u8 *’ {aka ‘const unsigned char *’}
        In file included from drivers/gpu/drm/i915/display/intel_dp.c:38:
        include/drm/drm_dp_helper.h:1466:6: note: in a call to function ‘drm_dp_channel_eq_ok’
         1466 | bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
              |      ^~~~~~~~~~~~~~~~~~~~
             6:14 elapsed
      
      This commit just extends the original array by 2 zero-initialized bytes,
      avoiding the warning.
      
      There may be some underlying bug in here that caused this confusion, but
      this is at least no worse than the existing situation that could use
      random data off the stack.
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Dave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fec4d427
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 07db0563
      Linus Torvalds authored
      Pull more SCSI updates from James Bottomley:
       "This is a set of minor fixes in various drivers (qla2xxx, ufs,
        scsi_debug, lpfc) one doc fix and a fairly large update to the fnic
        driver to remove the open coded iteration functions in favour of the
        scsi provided ones"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: fnic: Use scsi_host_busy_iter() to traverse commands
        scsi: fnic: Kill 'exclude_id' argument to fnic_cleanup_io()
        scsi: scsi_debug: Fix cmd_per_lun, set to max_queue
        scsi: ufs: core: Narrow down fast path in system suspend path
        scsi: ufs: core: Cancel rpm_dev_flush_recheck_work during system suspend
        scsi: ufs: core: Do not put UFS power into LPM if link is broken
        scsi: qla2xxx: Prevent PRLI in target mode
        scsi: qla2xxx: Add marginal path handling support
        scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found
        scsi: ufs: core: Fix a typo in ufs-sysfs.c
        scsi: lpfc: Fix bad memory access during VPD DUMP mailbox command
        scsi: lpfc: Fix DMA virtual address ptr assignment in bsg
        scsi: lpfc: Fix illegal memory access on Abort IOCBs
        scsi: blk-mq: Fix build warning when making htmldocs
      07db0563
    • Linus Torvalds's avatar
      Merge tag 'kbuild-v5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild · 0f979d81
      Linus Torvalds authored
      Pull more Kbuild updates from Masahiro Yamada:
      
       - Convert sh and sparc to use generic shell scripts to generate the
         syscall headers
      
       - refactor .gitignore files
      
       - Update kernel/config_data.gz only when the content of the .config
         is really changed, which avoids the unneeded re-link of vmlinux
      
       - move "remove stale files" workarounds to scripts/remove-stale-files
      
       - suppress unused-but-set-variable warnings by default for Clang
         as well
      
       - fix locale setting LANG=C to LC_ALL=C
      
       - improve 'make distclean'
      
       - always keep intermediate objects from scripts/link-vmlinux.sh
      
       - move IF_ENABLED out of <linux/kconfig.h> to make it self-contained
      
       - misc cleanups
      
      * tag 'kbuild-v5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (25 commits)
        linux/kconfig.h: replace IF_ENABLED() with PTR_IF() in <linux/kernel.h>
        kbuild: Don't remove link-vmlinux temporary files on exit/signal
        kbuild: remove the unneeded comments for external module builds
        kbuild: make distclean remove tag files in sub-directories
        kbuild: make distclean work against $(objtree) instead of $(srctree)
        kbuild: refactor modname-multi by using suffix-search
        kbuild: refactor fdtoverlay rule
        kbuild: parameterize the .o part of suffix-search
        arch: use cross_compiling to check whether it is a cross build or not
        kbuild: remove ARCH=sh64 support from top Makefile
        .gitignore: prefix local generated files with a slash
        kbuild: replace LANG=C with LC_ALL=C
        Makefile: Move -Wno-unused-but-set-variable out of GCC only block
        kbuild: add a script to remove stale generated files
        kbuild: update config_data.gz only when the content of .config is changed
        .gitignore: ignore only top-level modules.builtin
        .gitignore: move tags and TAGS close to other tag files
        kernel/.gitgnore: remove stale timeconst.h and hz.bc
        usr/include: refactor .gitignore
        genksyms: fix stale comment
        ...
      0f979d81
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · ab159ac5
      Linus Torvalds authored
      Pull powerpc updates and fixes from Michael Ellerman:
       "A bit of a mixture of things, tying up some loose ends.
      
        There's the removal of the nvlink code, which dependend on a commit in
        the vfio tree. Then the enablement of huge vmalloc which was in next
        for a few weeks but got dropped due to conflicts. And there's also a
        few fixes.
      
        Summary:
      
         - Remove the nvlink support now that it's only user has been removed.
      
         - Enable huge vmalloc mappings for Radix MMU (P9).
      
         - Fix KVM conversion to gfn-based MMU notifier callbacks.
      
         - Fix a kexec/kdump crash with hot plugged CPUs.
      
         - Fix boot failure on 32-bit with CONFIG_STACKPROTECTOR.
      
         - Restore alphabetic order of the selects under CONFIG_PPC.
      
        Thanks to: Christophe Leroy, Christoph Hellwig, Nicholas Piggin,
        Sandipan Das, and Sourabh Jain"
      
      * tag 'powerpc-5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks
        powerpc/kconfig: Restore alphabetic order of the selects under CONFIG_PPC
        powerpc/32: Fix boot failure with CONFIG_STACKPROTECTOR
        powerpc/powernv/memtrace: Fix dcache flushing
        powerpc/kexec_file: Use current CPU info while setting up FDT
        powerpc/64s/radix: Enable huge vmalloc mappings
        powerpc/powernv: remove the nvlink support
      ab159ac5