1. 24 Apr, 2023 10 commits
  2. 21 Apr, 2023 1 commit
    • Thomas Gleixner's avatar
      posix-cpu-timers: Implement the missing timer_wait_running callback · f7abf14f
      Thomas Gleixner authored
      For some unknown reason the introduction of the timer_wait_running callback
      missed to fixup posix CPU timers, which went unnoticed for almost four years.
      Marco reported recently that the WARN_ON() in timer_wait_running()
      triggers with a posix CPU timer test case.
      
      Posix CPU timers have two execution models for expiring timers depending on
      CONFIG_POSIX_CPU_TIMERS_TASK_WORK:
      
      1) If not enabled, the expiry happens in hard interrupt context so
         spin waiting on the remote CPU is reasonably time bound.
      
         Implement an empty stub function for that case.
      
      2) If enabled, the expiry happens in task work before returning to user
         space or guest mode. The expired timers are marked as firing and moved
         from the timer queue to a local list head with sighand lock held. Once
         the timers are moved, sighand lock is dropped and the expiry happens in
         fully preemptible context. That means the expiring task can be scheduled
         out, migrated, interrupted etc. So spin waiting on it is more than
         suboptimal.
      
         The timer wheel has a timer_wait_running() mechanism for RT, which uses
         a per CPU timer-base expiry lock which is held by the expiry code and the
         task waiting for the timer function to complete blocks on that lock.
      
         This does not work in the same way for posix CPU timers as there is no
         timer base and expiry for process wide timers can run on any task
         belonging to that process, but the concept of waiting on an expiry lock
         can be used too in a slightly different way:
      
          - Add a mutex to struct posix_cputimers_work. This struct is per task
            and used to schedule the expiry task work from the timer interrupt.
      
          - Add a task_struct pointer to struct cpu_timer which is used to store
            a the task which runs the expiry. That's filled in when the task
            moves the expired timers to the local expiry list. That's not
            affecting the size of the k_itimer union as there are bigger union
            members already
      
          - Let the task take the expiry mutex around the expiry function
      
          - Let the waiter acquire a task reference with rcu_read_lock() held and
            block on the expiry mutex
      
         This avoids spin-waiting on a task which might not even be on a CPU and
         works nicely for RT too.
      
      Fixes: ec8f954a ("posix-timers: Use a callback for cancel synchronization on PREEMPT_RT")
      Reported-by: default avatarMarco Elver <elver@google.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarMarco Elver <elver@google.com>
      Tested-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Reviewed-by: default avatarFrederic Weisbecker <frederic@kernel.org>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/87zg764ojw.ffs@tglx
      f7abf14f
  3. 18 Apr, 2023 9 commits
  4. 16 Apr, 2023 2 commits
  5. 21 Mar, 2023 1 commit
  6. 19 Mar, 2023 16 commits
  7. 18 Mar, 2023 1 commit
    • Linus Torvalds's avatar
      Merge tag 'fbdev-for-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev · a3671bd8
      Linus Torvalds authored
      Pull fbdev fixes from Helge Deller:
       "The majority of lines changed is due to a code style cleanup in the
        pnmtologo helper program.
      
        Arnd removed the omap1 osk driver and the SIS fb driver is now
        orphaned.
      
        Other than that it's the usual bunch of small fixes and cleanups, e.g.
        prevent possible divide-by-zero in various fb drivers if the pixclock
        is zero and various conversions to devm_platform*() and of_property*()
        functions:
      
         - Drop omap1 osk driver
      
         - Various potential divide by zero pixclock fixes
      
         - Add pixelclock and fb_check_var() to stifb
      
         - Code style cleanups and indenting fixes"
      
      * tag 'fbdev-for-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
        fbdev: Use of_property_present() for testing DT property presence
        fbdev: au1200fb: Fix potential divide by zero
        fbdev: lxfb: Fix potential divide by zero
        fbdev: intelfb: Fix potential divide by zero
        fbdev: nvidia: Fix potential divide by zero
        fbdev: stifb: Provide valid pixelclock and add fb_check_var() checks
        fbdev: omapfb: remove omap1 osk driver
        fbdev: xilinxfb: Use devm_platform_get_and_ioremap_resource()
        fbdev: wm8505fb: Use devm_platform_ioremap_resource()
        fbdev: pxa3xx-gcu: Use devm_platform_get_and_ioremap_resource()
        fbdev: Use of_property_read_bool() for boolean properties
        fbdev: clps711x-fb: Use devm_platform_get_and_ioremap_resource()
        fbdev: tgafb: Fix potential divide by zero
        MAINTAINERS: orphan SIS FRAMEBUFFER DRIVER
        fbdev: omapfb: cleanup inconsistent indentation
        drivers: video: logo: add SPDX comment, remove GPL notice in pnmtologo.c
        drivers: video: logo: fix code style issues in pnmtologo.c
      a3671bd8