1. Mar 04, 2020
    • Waiman Long's avatar
      tick/common: Make tick_periodic() check for missing ticks · d441dceb
      Waiman Long authored
      The tick_periodic() function is used at the beginning part of the
      bootup process for time keeping while the other clock sources are
      being initialized.
      
      The current code assumes that all the timer interrupts are handled in
      a timely manner with no missing ticks. That is not actually true. Some
      ticks are missed and there are some discrepancies between the tick time
      (jiffies) and the timestamp reported in the kernel log.  Some systems,
      however, are more prone to missing ticks than the others.  In the extreme
      case, the discrepancy can actually cause a soft lockup message to be
      printed by the watchdog kthread. For example, on a Cavium ThunderX2
      Sabre arm64 system:
      
       [   25.496379] watchdog: BUG: soft lockup - CPU#14 stuck for 22s!
      
      On that system, the missing ticks are especially prevalent during the
      smp_init() phase of the boot process. With an instrumented kernel,
      it was found that it took about 24s as reported by the timestamp for
      the tick to accumulate 4s of time.
      
      Investigation and bisection done by others seemed to point to the
      commit 73f38166
      
       ("arm64: Advertise mitigation of Spectre-v2, or
      lack thereof") as the culprit. It could also be a firmware issue as
      new firmware was promised that would fix the issue.
      
      To properly address this problem, stop assuming that there will be no
      missing tick in tick_periodic(). Modify it to follow the example of
      tick_do_update_jiffies64() by using another reference clock to check for
      missing ticks. Since the watchdog timer uses running_clock(), it is used
      here as the reference. With this applied, the soft lockup problem in the
      affected arm64 system is gone and tick time tracks much more closely to the
      timestamp time.
      
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Link: https://lkml.kernel.org/r/20200207193929.27308-1-longman@redhat.com
      d441dceb
    • Wen Yang's avatar
      hrtimer: Cast explicitely to u32t in __ktime_divns() · 38f7b0b1
      Wen Yang authored
      
      
      do_div() does a 64-by-32 division at least on 32bit platforms, while the
      divisor 'div' is explicitly casted to unsigned long, thus 64-bit on 64-bit
      platforms.
      
      The code already ensures that the divisor is less than 2^32. Hence the
      proper cast type is u32.
      
      Signed-off-by: default avatarWen Yang <wenyang@linux.alibaba.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Link: https://lkml.kernel.org/r/20200130130851.29204-1-wenyang@linux.alibaba.com
      38f7b0b1
    • Wen Yang's avatar
      timekeeping: Prevent 32bit truncation in scale64_check_overflow() · 4cbbc3a0
      Wen Yang authored
      
      
      While unlikely the divisor in scale64_check_overflow() could be >= 32bit in
      scale64_check_overflow(). do_div() truncates the divisor to 32bit at least
      on 32bit platforms.
      
      Use div64_u64() instead to avoid the truncation to 32-bit.
      
      [ tglx: Massaged changelog ]
      
      Signed-off-by: default avatarWen Yang <wenyang@linux.alibaba.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Link: https://lkml.kernel.org/r/20200120100523.45656-1-wenyang@linux.alibaba.com
      4cbbc3a0
    • Eric W. Biederman's avatar
      posix-cpu-timers: Stop disabling timers on mt-exec · b95e31c0
      Eric W. Biederman authored
      The reasons why the extra posix_cpu_timers_exit_group() invocation has been
      added are not entirely clear from the commit message.  Today all that
      posix_cpu_timers_exit_group() does is stop timers that are tracking the
      task from firing.  Every other operation on those timers is still allowed.
      
      The practical implication of this is posix_cpu_timer_del() which could
      not get the siglock after the thread group leader has exited (because
      sighand == NULL) would be able to run successfully because the timer
      was already dequeued.
      
      With that locking issue fixed there is no point in disabling all of the
      timers.  So remove this ``tempoary'' hack.
      
      Fixes: e0a70217
      
       ("posix-cpu-timers: workaround to suppress the problems with mt exec")
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Link: https://lkml.kernel.org/r/87o8tityzs.fsf@x220.int.ebiederm.org
      
      b95e31c0
    • Eric W. Biederman's avatar
      posix-cpu-timers: Store a reference to a pid not a task · 55e8c8eb
      Eric W. Biederman authored
      posix cpu timers do not handle the death of a process well.
      
      This is most clearly seen when a multi-threaded process calls exec from a
      thread that is not the leader of the thread group.  The posix cpu timer code
      continues to pin the old thread group leader and is unable to find the
      siglock from there.
      
      This results in posix_cpu_timer_del being unable to delete a timer,
      posix_cpu_timer_set being unable to set a timer.  Further to compensate for
      the problems in posix_cpu_timer_del on a multi-threaded exec all timers
      that point at the multi-threaded task are stopped.
      
      The code for the timers fundamentally needs to check if the target
      process/thread is alive.  This needs an extra level of indirection. This
      level of indirection is already available in struct pid.
      
      So replace cpu.task with cpu.pid to get the needed extra layer of
      indirection.
      
      In addition to handling things more cleanly this reduces the amount of
      memory a timer can pin when a process exits and then is reaped from
      a task_struct to the vastly smaller struct pid.
      
      Fixes: e0a70217
      
       ("posix-cpu-timers: workaround to suppress the problems with mt exec")
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Link: https://lkml.kernel.org/r/87wo86tz6d.fsf@x220.int.ebiederm.org
      55e8c8eb
  2. Mar 01, 2020
  3. Feb 26, 2020
  4. Feb 18, 2020
  5. Feb 17, 2020
  6. Feb 16, 2020
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · db70e26e
      Linus Torvalds authored
      Pull input updates from Dmitry Torokhov:
      
       - a few drivers have been updated to use flexible-array syntax instead
         of GCC extension
      
       - ili210x touchscreen driver now supports the 2120 protocol flavor
      
       - a couple more of Synaptics devices have been switched over to RMI4
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: cyapa - replace zero-length array with flexible-array member
        Input: tca6416-keypad - replace zero-length array with flexible-array member
        Input: gpio_keys_polled - replace zero-length array with flexible-array member
        Input: synaptics - remove the LEN0049 dmi id from topbuttonpad list
        Input: synaptics - enable SMBus on ThinkPad L470
        Input: synaptics - switch T470s to RMI4 by default
        Input: gpio_keys - replace zero-length array with flexible-array member
        Input: goldfish_events - replace zero-length array with flexible-array member
        Input: psmouse - switch to using i2c_new_scanned_device()
        Input: ili210x - add ili2120 support
        Input: ili210x - fix return value of is_visible function
      db70e26e
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 54654e14
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
       "Not too much going on here, though there are about four fixes related
        to stuff merged during the last merge window.
      
        We also see the return of a syzkaller instance with access to RDMA
        devices, and a few bugs detected by that squished.
      
         - Fix three crashers and a memory memory leak for HFI1
      
         - Several bugs found by syzkaller
      
         - A bug fix for the recent QP counters feature on older mlx5 HW
      
         - Locking inversion in cxgb4
      
         - Unnecessary WARN_ON in siw
      
         - A umad crasher regression during unload, from a bug fix for
           something else
      
         - Bugs introduced in the merge window:
             - Missed list_del in uverbs file rework, core and mlx5 devx
             - Unexpected integer math truncation in the mlx5 VAR patches
             - Compilation bug fix for the VAR patches on 32 bit"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        IB/mlx5: Use div64_u64 for num_var_hw_entries calculation
        RDMA/core: Fix protection fault in get_pkey_idx_qp_list
        RDMA/rxe: Fix soft lockup problem due to using tasklets in softirq
        RDMA/mlx5: Prevent overflow in mmap offset calculations
        IB/umad: Fix kernel crash while unloading ib_umad
        RDMA/mlx5: Fix async events cleanup flows
        RDMA/core: Add missing list deletion on freeing event queue
        RDMA/siw: Remove unwanted WARN_ON in siw_cm_llp_data_ready()
        RDMA/iw_cxgb4: initiate CLOSE when entering TERM
        IB/mlx5: Return failure when rts2rts_qp_counters_set_id is not supported
        RDMA/core: Fix invalid memory access in spec_filter_size
        IB/rdmavt: Reset all QPs when the device is shut down
        IB/hfi1: Close window for pq and request coliding
        IB/hfi1: Acquire lock to release TID entries when user file is closed
        RDMA/hfi1: Fix memory leak in _dev_comp_vect_mappings_create
      54654e14
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · b719ae07
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "A handful of fixes that have come in since the merge window:
      
         - Fix of PCI interrupt map on arm64 fast model (SW emulator)
      
         - Fixlet for sound on ST platforms and a small cleanup of deprecated
           DT properties
      
         - A stack buffer overflow fix for moxtet
      
         - Fuse driver build fix for Tegra194
      
         - A few config updates to turn on new drivers merged this cycle"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
        bus: moxtet: fix potential stack buffer overflow
        soc/tegra: fuse: Fix build with Tegra194 configuration
        ARM: dts: sti: fixup sound frame-inversion for stihxxx-b2120.dtsi
        ARM: dts: sti: Remove deprecated snps PHY properties for stih410-b2260
        arm64: defconfig: Enable DRM_SUN6I_DSI
        arm64: defconfig: Enable CONFIG_SUN8I_THERMAL
        ARM: sunxi: Enable CONFIG_SUN8I_THERMAL
        arm64: defconfig: Set bcm2835-dma as built-in
        ARM: configs: Cleanup old Kconfig options
        ARM: npcm: Bring back GPIOLIB support
        arm64: dts: fast models: Fix FVP PCI interrupt-map property
      b719ae07
    • Linus Torvalds's avatar
      Merge tag 's390-5.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 3e71e121
      Linus Torvalds authored
      Pull s390 updates from Vasily Gorbik:
      
       - Enable paes-s390 cipher selftests in testmgr (acked-by Herbert Xu).
      
       - Fix protected key length update in PKEY_SEC2PROTK ioctl and increase
         card/queue requests counter to 64-bit in crypto code.
      
       - Fix clang warning in get_tod_clock.
      
       - Fix ultravisor info length extensions handling.
      
       - Fix style of SPDX License Identifier in vfio-ccw.
      
       - Avoid unnecessary GFP_ATOMIC and simplify ACK tracking in qdio.
      
      * tag 's390-5.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        crypto/testmgr: enable selftests for paes-s390 ciphers
        s390/time: Fix clk type in get_tod_clock
        s390/uv: Fix handling of length extensions
        s390/qdio: don't allocate *aob array with GFP_ATOMIC
        s390/qdio: simplify ACK tracking
        s390/zcrypt: fix card and queue total counter wrap
        s390/pkey: fix missing length of protected key on return
        vfio-ccw: Use the correct style for SPDX License Identifier
      3e71e121