1. 12 Jul, 2024 3 commits
    • Niklas Söderlund's avatar
      clocksource/drivers/sh_cmt: Address race condition for clock events · db19d3aa
      Niklas Söderlund authored
      There is a race condition in the CMT interrupt handler. In the interrupt
      handler the driver sets a driver private flag, FLAG_IRQCONTEXT. This
      flag is used to indicate any call to set_next_event() should not be
      directly propagated to the device, but instead cached. This is done as
      the interrupt handler itself reprograms the device when needed before it
      completes and this avoids this operation to take place twice.
      
      It is unclear why this design was chosen, my suspicion is to allow the
      struct clock_event_device.event_handler callback, which is called while
      the FLAG_IRQCONTEXT is set, can update the next event without having to
      write to the device twice.
      
      Unfortunately there is a race between when the FLAG_IRQCONTEXT flag is
      set and later cleared where the interrupt handler have already started to
      write the next event to the device. If set_next_event() is called in
      this window the value is only cached in the driver but not written. This
      leads to the board to misbehave, or worse lockup and produce a splat.
      
         rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
         rcu:     0-...!: (0 ticks this GP) idle=f5e0/0/0x0 softirq=519/519 fqs=0 (false positive?)
         rcu:     (detected by 1, t=6502 jiffies, g=-595, q=77 ncpus=2)
         Sending NMI from CPU 1 to CPUs 0:
         NMI backtrace for cpu 0
         CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.10.0-rc5-arm64-renesas-00019-g74a6f86eaf1c-dirty #20
         Hardware name: Renesas Salvator-X 2nd version board based on r8a77965 (DT)
         pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
         pc : tick_check_broadcast_expired+0xc/0x40
         lr : cpu_idle_poll.isra.0+0x8c/0x168
         sp : ffff800081c63d70
         x29: ffff800081c63d70 x28: 00000000580000c8 x27: 00000000bfee5610
         x26: 0000000000000027 x25: 0000000000000000 x24: 0000000000000000
         x23: ffff00007fbb9100 x22: ffff8000818f1008 x21: ffff8000800ef07c
         x20: ffff800081c79ec0 x19: ffff800081c70c28 x18: 0000000000000000
         x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffffc2c717d8
         x14: 0000000000000000 x13: ffff000009c18080 x12: ffff8000825f7fc0
         x11: 0000000000000000 x10: ffff8000818f3cd4 x9 : 0000000000000028
         x8 : ffff800081c79ec0 x7 : ffff800081c73000 x6 : 0000000000000000
         x5 : 0000000000000000 x4 : ffff7ffffe286000 x3 : 0000000000000000
         x2 : ffff7ffffe286000 x1 : ffff800082972900 x0 : ffff8000818f1008
         Call trace:
          tick_check_broadcast_expired+0xc/0x40
          do_idle+0x9c/0x280
          cpu_startup_entry+0x34/0x40
          kernel_init+0x0/0x11c
          do_one_initcall+0x0/0x260
          __primary_switched+0x80/0x88
         rcu: rcu_preempt kthread timer wakeup didn't happen for 6501 jiffies! g-595 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402
         rcu:     Possible timer handling issue on cpu=0 timer-softirq=262
         rcu: rcu_preempt kthread starved for 6502 jiffies! g-595 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 ->cpu=0
         rcu:     Unless rcu_preempt kthread gets sufficient CPU time, OOM is now expected behavior.
         rcu: RCU grace-period kthread stack dump:
         task:rcu_preempt     state:I stack:0     pid:15    tgid:15    ppid:2      flags:0x00000008
         Call trace:
          __switch_to+0xbc/0x100
          __schedule+0x358/0xbe0
          schedule+0x48/0x148
          schedule_timeout+0xc4/0x138
          rcu_gp_fqs_loop+0x12c/0x764
          rcu_gp_kthread+0x208/0x298
          kthread+0x10c/0x110
          ret_from_fork+0x10/0x20
      
      The design have been part of the driver since it was first merged in
      early 2009. It becomes increasingly harder to trigger the issue the
      older kernel version one tries. It only takes a few boots on v6.10-rc5,
      while hundreds of boots are needed to trigger it on v5.10.
      
      Close the race condition by using the CMT channel lock for the two
      competing sections. The channel lock was added to the driver after its
      initial design.
      Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Link: https://lore.kernel.org/r/20240702190230.3825292-1-niklas.soderlund+renesas@ragnatech.seSigned-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      db19d3aa
    • Li kunyu's avatar
      clocksource/driver/arm_global_timer: Remove unnecessary ‘0’ values from err · f3539a6a
      Li kunyu authored
      The 'err' variable is initialized whatever the code path, it is
      pointless to initialize it when it is declared.
      Signed-off-by: default avatarLi kunyu <kunyu@nfschina.com>
      Link: https://lore.kernel.org/r/20240705052159.22235-1-kunyu@nfschina.comSigned-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      f3539a6a
    • Li kunyu's avatar
      clocksource/drivers/arm_arch_timer: Remove unnecessary ‘0’ values from irq · 7cbbcbd4
      Li kunyu authored
      The irq variable is initialized whatever the code path, it is poinless
      to initialize when declaring it.
      Signed-off-by: default avatarLi kunyu <kunyu@nfschina.com>
      Link: https://lore.kernel.org/r/20240705040729.21961-1-kunyu@nfschina.comSigned-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      7cbbcbd4
  2. 07 Jul, 2024 3 commits
    • Linus Torvalds's avatar
      Linux 6.10-rc7 · 256abd8e
      Linus Torvalds authored
      256abd8e
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 5a4bd506
      Linus Torvalds authored
      Pull clk fixes from Stephen Boyd:
       "A set of clk fixes for the Qualcomm, Mediatek, and Allwinner drivers:
      
         - Fix the Qualcomm Stromer Plus PLL set_rate() clk_op to explicitly
           set the alpha enable bit and not set bits that don't exist
      
         - Mark Qualcomm IPQ9574 crypto clks as voted to avoid stuck clk
           warnings
      
         - Fix the parent of some PLLs on Qualcomm sm6530 so their rate is
           correct
      
         - Fix the min/max rate clamping logic in the Allwinner driver that
           got broken in v6.9
      
         - Limit runtime PM enabling in the Mediatek driver to only
           mt8183-mfgcfg so that system wide resume doesn't break on other
           Mediatek SoCs"
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: mediatek: mt8183: Only enable runtime PM on mt8183-mfgcfg
        clk: sunxi-ng: common: Don't call hw_to_ccu_common on hw without common
        clk: qcom: gcc-ipq9574: Add BRANCH_HALT_VOTED flag
        clk: qcom: apss-ipq-pll: remove 'config_ctl_hi_val' from Stromer pll configs
        clk: qcom: clk-alpha-pll: set ALPHA_EN bit for Stromer Plus PLLs
        clk: qcom: gcc-sm6350: Fix gpll6* & gpll7 parents
      5a4bd506
    • Linus Torvalds's avatar
      Merge tag 'powerpc-6.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · c6653f49
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Fix unnecessary copy to 0 when kernel is booted at address 0
      
       - Fix usercopy crash when dumping dtl via debugfs
      
       - Avoid possible crash when PCI hotplug races with error handling
      
       - Fix kexec crash caused by scv being disabled before other CPUs
         call-in
      
       - Fix powerpc selftests build with USERCFLAGS set
      
      Thanks to Anjali K, Ganesh Goudar, Gautam Menghani, Jinglin Wen,
      Nicholas Piggin, Sourabh Jain, Srikar Dronamraju, and Vishal Chourasia.
      
      * tag 'powerpc-6.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        selftests/powerpc: Fix build with USERCFLAGS set
        powerpc/pseries: Fix scv instruction crash with kexec
        powerpc/eeh: avoid possible crash when edev->pdev changes
        powerpc/pseries: Whitelist dtl slub object for copying to userspace
        powerpc/64s: Fix unnecessary copy to 0 when kernel is booted at address 0
      c6653f49
  3. 06 Jul, 2024 3 commits
    • Linus Torvalds's avatar
      Merge tag '6.10-rc6-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6 · 256fdd4b
      Linus Torvalds authored
      Pull smb client fix from Steve French:
       "Fix for smb3 readahead performance regression"
      
      * tag '6.10-rc6-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: Fix read-performance regression by dropping readahead expansion
      256fdd4b
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-6.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 22f902df
      Linus Torvalds authored
      Pull i2c fix from Wolfram Sang:
       "An i2c driver fix"
      
      * tag 'i2c-for-6.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: pnx: Fix potential deadlock warning from del_timer_sync() call in isr
      22f902df
    • Michael Ellerman's avatar
      selftests/powerpc: Fix build with USERCFLAGS set · 8b7f59de
      Michael Ellerman authored
      Currently building the powerpc selftests with USERCFLAGS set to anything
      causes the build to break:
      
        $ make -C tools/testing/selftests/powerpc V=1 USERCFLAGS=-Wno-error
        ...
        gcc -Wno-error    cache_shape.c ...
        cache_shape.c:18:10: fatal error: utils.h: No such file or directory
           18 | #include "utils.h"
              |          ^~~~~~~~~
        compilation terminated.
      
      This happens because the USERCFLAGS are added to CFLAGS in lib.mk, which
      causes the check of CFLAGS in powerpc/flags.mk to skip setting CFLAGS at
      all, resulting in none of the usual CFLAGS being passed. That can
      be seen in the output above, the only flag passed to the compiler is
      -Wno-error.
      
      Fix it by dropping the conditional setting of CFLAGS in flags.mk.
      Instead always set CFLAGS, but also append USERCFLAGS if they are set.
      
      Note that appending to CFLAGS (with +=) wouldn't work, because flags.mk
      is included by multiple Makefiles (to support partial builds), causing
      CFLAGS to be appended to multiple times. Additionally that would place
      the USERCFLAGS prior to the standard CFLAGS, meaning the USERCFLAGS
      couldn't override the standard flags. Being able to override the
      standard flags is desirable, for example for adding -Wno-error.
      
      With the fix in place, the CFLAGS are set correctly, including the
      USERCFLAGS:
      
        $ make -C tools/testing/selftests/powerpc V=1 USERCFLAGS=-Wno-error
        ...
        gcc -std=gnu99 -O2 -Wall -Werror -DGIT_VERSION='"v6.10-rc2-7-gdea17e7e56c3"'
        -I/home/michael/linux/tools/testing/selftests/powerpc/include -Wno-error
        cache_shape.c ...
      
      Fixes: 5553a793 ("selftests/powerpc: Add flags.mk to support pmu buildable")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://msgid.link/20240706120833.909853-1-mpe@ellerman.id.au
      8b7f59de
  4. 05 Jul, 2024 11 commits
  5. 04 Jul, 2024 20 commits