]> git.ipfire.org Git - thirdparty/linux.git/log
thirdparty/linux.git
3 weeks agoriscv: Split out compare_unaligned_access()
Nam Cao [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: Split out compare_unaligned_access()

Scalar misaligned access probe and vector misaligned access probe share
very similar code. Split out this similar part from scalar probe into
compare_unaligned_access(), which will be reused for vector probe in a
follow-up commit.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Link: https://patch.msgid.link/3695f77279d473eead8ed6210d97c941321cd4f1.1770830596.git.namcao@linutronix.de
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: Reuse measure_cycles() in check_vector_unaligned_access()
Nam Cao [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: Reuse measure_cycles() in check_vector_unaligned_access()

check_vector_unaligned_access() duplicates the logic in measure_cycles().

Reuse measure_cycles() and deduplicate.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Link: https://patch.msgid.link/be4c66fd4120952195fdcd0e62d245c55f0711e2.1770830596.git.namcao@linutronix.de
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: Split out measure_cycles() for reuse
Nam Cao [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: Split out measure_cycles() for reuse

Byte cycle measurement and word cycle measurement of scalar misaligned
access are very similar. Split these parts out into a common
measure_cycles() function to avoid duplication.

This function will also be reused for vector misaligned access probe in a
follow-up commit.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Link: https://patch.msgid.link/50d0598e45acc56c95176e52fbbe56e1f4becc84.1770830596.git.namcao@linutronix.de
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: Clean up & optimize unaligned scalar access probe
Nam Cao [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: Clean up & optimize unaligned scalar access probe

check_unaligned_access_speed_all_cpus() is more complicated than it should
be:

  - It uses on_each_cpu() to probe unaligned memory access on all CPUs but
    excludes CPU0 with a check in the callback function. So an IPI to CPU0
    is wasted.

  - Probing on CPU0 is done with smp_call_on_cpu(), which is not as fast as
    on_each_cpu().

The reason for this design is because the probe is timed with jiffies.
Therefore on_each_cpu() excludes CPU0 because that CPU needs to tend to
jiffies.

Instead, replace jiffies usage with ktime_get_mono_fast_ns(). With jiffies
out of the way, on_each_cpu() can be used for all CPUs and
smp_call_on_cpu() can be dropped.

To make ktime_get_mono_fast_ns() usable, move this probe to late_initcall.
Anything after clocksource's fs_initcall works, but avoid depending on
clocksource staying at fs_initcall.

The choice of probe time is now 8000000 ns, which is the same as before (2
jiffies) for riscv defconfig. This is excessive for the CPUs I have, and
probably should be reduced; but that's a different discussion.

Suggested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Nam Cao <namcao@linutronix.de>
Link: https://patch.msgid.link/9b9a20affe2e4f5c380926ceb885a47e20a59395.1770830596.git.namcao@linutronix.de
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: lib: add strrchr() implementation
Feng Jiang [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: lib: add strrchr() implementation

Add an assembly implementation of strrchr() for RISC-V.

This implementation minimizes instruction count and avoids unnecessary
memory access to the stack. The performance benefits are most visible
on small workloads (1-16 bytes) where the architectural savings in
function overhead outweigh the execution time of the scan loop.

Benchmark results (QEMU TCG, rv64):
  Length | Original (MB/s) | Optimized (MB/s) | Improvement
  -------|-----------------|------------------|------------
  1 B    | 20              | 21               | +5.0%
  7 B    | 111             | 120              | +8.1%
  16 B   | 189             | 199              | +5.3%
  512 B  | 361             | 382              | +5.8%
  4096 B | 388             | 391              | +0.8%

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Tested-by: Joel Stanley <joel@jms.id.au>
Link: https://patch.msgid.link/20260130025018.172925-9-jiangfeng@kylinos.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: lib: add strchr() implementation
Feng Jiang [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: lib: add strchr() implementation

Add an assembly implementation of strchr() for RISC-V.

By eliminating stack frame management (prologue/epilogue) and optimizing
the function entries, the assembly version provides significant relative
gains for short strings where the fixed overhead of the C function is
most prominent. As string length increases, performance converges with
the generic C implementation.

Benchmark results (QEMU TCG, rv64):
  Length | Original (MB/s) | Optimized (MB/s) | Improvement
  -------|-----------------|------------------|------------
  1 B    | 21              | 22               | +4.8%
  7 B    | 113             | 121              | +7.1%
  16 B   | 195             | 202              | +3.6%
  512 B  | 376             | 389              | +3.5%
  4096 B | 394             | 393              | -0.3%

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Tested-by: Joel Stanley <joel@jms.id.au>
Link: https://patch.msgid.link/20260130025018.172925-8-jiangfeng@kylinos.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: lib: add strnlen() implementation
Feng Jiang [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: lib: add strnlen() implementation

Add an optimized strnlen() implementation for RISC-V. This version
includes a generic optimization and a Zbb-powered optimization using
the 'orc.b' instruction, derived from the strlen() implementation.

Benchmark results (QEMU TCG, rv64):
  Length | Original (MB/s) | Optimized (MB/s) | Improvement
  -------|-----------------|------------------|------------
  16 B   | 179             | 309              | +72.6%
  512 B  | 347             | 1562             | +350.1%
  4096 B | 356             | 1878             | +427.5%

Suggested-by: Qingfang Deng <dqfext@gmail.com>
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Link: https://patch.msgid.link/20260130025018.172925-7-jiangfeng@kylinos.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agolib/string_kunit: extend benchmarks to strnlen() and chr searches
Feng Jiang [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
lib/string_kunit: extend benchmarks to strnlen() and chr searches

Extend the string benchmarking suite to include strnlen(), strchr(),
and strrchr().

For character search functions strchr() and strrchr(), the benchmark
targets the NUL character. This ensures the entire string is scanned,
providing a consistent measure of full-length processing efficiency
comparable to strlen().

Suggested-by: Andy Shevchenko <andy@kernel.org>
Suggested-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Acked-by: Andy Shevchenko <andy@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20260130025018.172925-6-jiangfeng@kylinos.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agolib/string_kunit: add performance benchmark for strlen()
Feng Jiang [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
lib/string_kunit: add performance benchmark for strlen()

Introduce a benchmarking framework to the string_kunit test suite to
measure the execution efficiency of string functions.

The implementation is inspired by crc_benchmark(), measuring throughput
(MB/s) and latency (ns/call) across a range of string lengths. It
includes a warm-up phase, disables preemption during measurement, and
uses a fixed seed for reproducible results.

This framework allows for comparing different implementations (e.g.,
generic C vs. architecture-optimized assembly) within the KUnit
environment.

Initially, provide a benchmark for strlen().

Suggested-by: Andy Shevchenko <andy@kernel.org>
Suggested-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20260130025018.172925-5-jiangfeng@kylinos.cn
[pjw@kernel.org: fixed a checkpatch issue]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agolib/string_kunit: add correctness test for strrchr()
Feng Jiang [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
lib/string_kunit: add correctness test for strrchr()

Add a KUnit test for strrchr() to verify correctness across
different string lengths and memory alignments. Use vmalloc()
to place the NUL character at the page boundary to ensure
over-reads are detected.

Suggested-by: Kees Cook <kees@kernel.org>
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20260130025018.172925-4-jiangfeng@kylinos.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agolib/string_kunit: add correctness test for strnlen()
Feng Jiang [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
lib/string_kunit: add correctness test for strnlen()

Add a KUnit test for strnlen() to verify correctness across
different string lengths and memory alignments. Use vmalloc()
to place the NUL character at the page boundary to ensure
over-reads are detected.

Suggested-by: Andy Shevchenko <andy@kernel.org>
Suggested-by: Kees Cook <kees@kernel.org>
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20260130025018.172925-3-jiangfeng@kylinos.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agolib/string_kunit: add correctness test for strlen()
Feng Jiang [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
lib/string_kunit: add correctness test for strlen()

Add a KUnit test for strlen() to verify correctness across
different string lengths and memory alignments. Use vmalloc()
to place the NUL character at the page boundary to ensure
over-reads are detected.

Suggested-by: Kees Cook <kees@kernel.org>
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20260130025018.172925-2-jiangfeng@kylinos.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: vdso_cfi: Add .gitignore for build artifacts
Chen Pei [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: vdso_cfi: Add .gitignore for build artifacts

The vdso_cfi build process copies source files (*.c, *.S) from the main
vdso directory to the build directory. Without a .gitignore file, these
copied files appear as untracked files in git status, cluttering the
working directory.

Add a .gitignore file to exclude:
- Copied source files (*.c, *.S)
- Temporary build files (vdso.lds, *.tmp, vdso-syms.S)
- While preserving vdso-cfi.S which is the original entry point

This follows the same pattern used in the main vdso directory
and keeps the working directory clean.

Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
Link: https://patch.msgid.link/20260320021850.1877-3-cp0613@linux.alibaba.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: vdso_cfi: Add clean rule for copied sources
Chen Pei [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: vdso_cfi: Add clean rule for copied sources

When building VDSO with CFI support, source files are copied from the main
VDSO directory to the CFI build directory as part of the build process.
However, these copied source files were not removed during 'make clean',
leaving temporary files in the build directory.

Add the clean-files variable to ensure that these copied .c and .S files
are properly cleaned up. The notdir() function is used to strip the path
prefix, as clean-files expects relative file names without directory
components.

This ensures the build directory is left in a clean state after make clean.

Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
Link: https://patch.msgid.link/20260320021850.1877-2-cp0613@linux.alibaba.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: enable HAVE_IOREMAP_PROT
Yufeng Wang [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: enable HAVE_IOREMAP_PROT

RISC-V has implemented pte_pgprot() and selects GENERIC_IOREMAP,
which provides a generic ioremap_prot() implementation. Enable
HAVE_IOREMAP_PROT to activate generic_access_phys() support, which
is useful for debugging (e.g., accessing /dev/mem via gdb).

Also update the architecture support documentation accordingly.

Signed-off-by: Yufeng Wang <wangyufeng@kylinos.cn>
Link: https://patch.msgid.link/20260306112734.108186-1-r4o5m6e8o@163.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: mm: WARN_ON() for bad addresses in vmemmap_populate()
Vivian Wang [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: mm: WARN_ON() for bad addresses in vmemmap_populate()

Similarly to the same check in arch/arm64/mm/mmu.c, in
vmemmap_populate(), add a warning for start and end being outside of the
range of vmemmap.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
Link: https://patch.msgid.link/20260309-riscv-sparsemem-vmemmap-limits-v1-1-f40efe18e3cd@iscas.ac.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: acpi: update FADT revision check to 6.6
Yufeng Wang [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: acpi: update FADT revision check to 6.6

ACPI 6.6 is required for RISC-V as it introduces RISC-V specific
tables such as RHCT (RISC-V Hart Capabilities Table) and
RIMT (RISC-V I/O Mapping Table).

Update the FADT revision check from 6.5 to 6.6 and remove
the TODO comment since ACPI 6.6 has been officially released.

Signed-off-by: Yufeng Wang <wangyufeng@kylinos.cn>
Reviewed-by: Sunil V L <sunilvl@oss.qualcomm.com>
Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Yao Zi <me@ziyao.cc>
Link: https://patch.msgid.link/20260305091433.83983-1-r4o5m6e8o@163.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: add hardware error trap handler support
Rui Qi [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: add hardware error trap handler support

Add support for handling hardware error traps (exception code 19)
in the RISC-V architecture. The changes include:

- Add do_trap_hardware_error function declaration in asm-prototypes.h
- Add hardware error trap vector entry in entry.S exception vector table
- Implement do_trap_hardware_error handler in traps.c that generates
  SIGBUS with BUS_MCEERR_AR for hardware errors

This enables proper handling of hardware error exceptions that may occur
in RISC-V systems, providing appropriate error reporting and signal
generation for user space processes.

Signed-off-by: Rui Qi <qirui.001@bytedance.com>
Link: https://patch.msgid.link/20260202094200.53735-1-qirui.001@bytedance.com
[pjw@kernel.org: clean up commit message slightly]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: increase COMMAND_LINE_SIZE value to 2048
Austin Kim [Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)] 
riscv: increase COMMAND_LINE_SIZE value to 2048

SoC people may send many parameters to configure the drivers via kernel
command line. If COMMAND_LINE_SIZE is not enough, they may go through
unexpected error.

To avoid the potential pain, we had better increase COMMAND_LINE_SIZE.

Signed-off-by: Austin Kim <austin.kim@lge.com>
Link: https://patch.msgid.link/aW3gFmOlA/Z4kmfJ@adminpc-PowerEdge-R7525
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: Fix typo in purgatory end label
Zishun Yi [Sun, 5 Apr 2026 00:42:42 +0000 (18:42 -0600)] 
riscv: Fix typo in purgatory end label

Fix the spelling of 'purgatory' in the .Lkexec_purgatroy_end label.

Signed-off-by: Zishun Yi <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20260325083139.15638-1-vulab@iscas.ac.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: remove redundant #ifdef check in cpu-hotplug
Hui Wang [Sun, 5 Apr 2026 00:42:41 +0000 (18:42 -0600)] 
riscv: remove redundant #ifdef check in cpu-hotplug

The cpu-hotplug.c only is built when CONFIG_HOTPLUG_CPU is defined,
it is not needed to check HOTPLUG_CPU in this file.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://patch.msgid.link/20260304033403.238012-2-hui.wang@canonical.com
[pjw@kernel.org: removed extra whitespace at EOF]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: remove redundant check for CONFIG_SMP
Hui Wang [Sun, 5 Apr 2026 00:42:41 +0000 (18:42 -0600)] 
riscv: remove redundant check for CONFIG_SMP

In the arch/riscv/Kconfig, the HOTPLUG_CPU depends on SMP, hence if
the HOTPLUG_CPU is defined, the SMP has to be defined, it is not
necessary to check SMP here.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://patch.msgid.link/20260304033403.238012-1-hui.wang@canonical.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoselftests: riscv: Add license to cfi selftest
Charlie Jenkins [Sun, 5 Apr 2026 00:42:41 +0000 (18:42 -0600)] 
selftests: riscv: Add license to cfi selftest

The cfi selftest was missing a license so add it.

Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Reviewed-by: Deepak Gupta <debug@rivosinc.com>
Link: https://patch.msgid.link/20260309-fix_selftests-v2-4-9d5a553a531e@gmail.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: Simplify assignment for UTS_MACHINE
Uwe Kleine-König [Sun, 5 Apr 2026 00:42:40 +0000 (18:42 -0600)] 
riscv: Simplify assignment for UTS_MACHINE

The BITS variable conveniently allows to simplify the assignment for
UTS_MACHINE.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20260313164012.1153936-2-u.kleine-koenig@baylibre.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: export kaslr offset and satp in VMCOREINFO ELF notes
Austin Kim [Sun, 5 Apr 2026 00:42:40 +0000 (18:42 -0600)] 
riscv: export kaslr offset and satp in VMCOREINFO ELF notes

The following options are required by the kdump crash utility for RISC-V
based vmcore file:

- kaslr: If the vmcore is generated from a KASLR-enabled Linux kernel,
         the KASLR offset is required for the crash utility to load
         the vmcore. Without the proper kaslr option, the crash utility
         fails to load the vmcore file.
- satp: The exact root page table address helps determine the correct base
        PGD address.

With this patch, RISC-V VMCOREINFO ELF notes now include both kaslr
and satp information.

Signed-off-by: Austin Kim <austin.kim@lge.com>
Link: https://patch.msgid.link/aYwKUE3ZzN7/ZY/A@adminpc-PowerEdge-R7525
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: move kaslr_offset() to page.h as a static inline function
Austin Kim [Sun, 5 Apr 2026 00:42:40 +0000 (18:42 -0600)] 
riscv: move kaslr_offset() to page.h as a static inline function

The kaslr_offset() function is a simple accessor that returns
kernel_map.virt_offset. This commit change also ensures that kaslr_offset()
is consistently available across various kernel configurations without
requiring explicit linkage to mm/init.c.

Signed-off-by: Austin Kim <austin.kim@lge.com>
Link: https://patch.msgid.link/aYwJ76yHaMbbQVJA@adminpc-PowerEdge-R7525
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: smp: Clarify comment "cache" -> "instruction cache"
Vivian Wang [Sun, 5 Apr 2026 00:42:40 +0000 (18:42 -0600)] 
riscv: smp: Clarify comment "cache" -> "instruction cache"

local_flush_icache_all() only flushes and synchronizes the *instruction*
cache, not the data cache. Since RISC-V does have a cbo.flush
instruction for data cache flush, clarify the comment to avoid
confusion.

Fixes: 58661a30f1bc ("riscv: Flush the instruction cache during SMP bringup")
Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
Link: https://patch.msgid.link/20260204-riscv-smp-comment-update-2026-01-v1-2-8b77aa181530@iscas.ac.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: smp: Remove outdated comment about disabling preemption
Vivian Wang [Sun, 5 Apr 2026 00:42:39 +0000 (18:42 -0600)] 
riscv: smp: Remove outdated comment about disabling preemption

Commit f1a0a376ca0c ("sched/core: Initialize the idle task with
preemption disabled") removed a call to preempt_disable(), but not the
associated comment. Remove the outdated comment.

Fixes: f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled")
Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
Link: https://patch.msgid.link/20260204-riscv-smp-comment-update-2026-01-v1-1-8b77aa181530@iscas.ac.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: fix various typos in comments and code
Sean Chang [Sun, 5 Apr 2026 00:42:39 +0000 (18:42 -0600)] 
riscv: fix various typos in comments and code

Fix various typos in RISC-V architecture code and comments.
The following changes are included:

- arch/riscv/errata/thead/errata.c: "futher" → "further"
- arch/riscv/include/asm/atomic.h: "therefor" → "therefore", "arithmatic" → "arithmetic"
- arch/riscv/include/asm/elf.h: "availiable" → "available", "coorespends" → "corresponds"
- arch/riscv/include/asm/processor.h: "requries" → "is required"
- arch/riscv/include/asm/thread_info.h: "returing" → "returning"
- arch/riscv/kernel/acpi.c: "compliancy" → "compliance"
- arch/riscv/kernel/ftrace.c: "therefor" → "therefore"
- arch/riscv/kernel/head.S: "intruction" → "instruction"
- arch/riscv/kernel/mcount-dyn.S: "localtion → "location"
- arch/riscv/kernel/module-sections.c: "maxinum" → "maximum"
- arch/riscv/kernel/probes/kprobes.c: "reenabled" → "re-enabled"
- arch/riscv/kernel/probes/uprobes.c: "probbed" → "probed"
- arch/riscv/kernel/soc.c: "extremly" → "extremely"
- arch/riscv/kernel/suspend.c: "incosistent" → "inconsistent"
- arch/riscv/kvm/tlb.c: "cahce" → "cache"
- arch/riscv/kvm/vcpu_pmu.c: "indicies" → "indices"
- arch/riscv/lib/csum.c: "implmentations" → "implementations"
- arch/riscv/lib/memmove.S: "ammount" → "amount"
- arch/riscv/mm/cacheflush.c: "visable" → "visible"
- arch/riscv/mm/physaddr.c: "aginst" → "against"

Signed-off-by: Sean Chang <seanwascoding@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20260212163325.60389-1-seanwascoding@gmail.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoprctl: cfi: change the branch landing pad prctl()s to be more descriptive
Paul Walmsley [Sun, 5 Apr 2026 00:40:58 +0000 (18:40 -0600)] 
prctl: cfi: change the branch landing pad prctl()s to be more descriptive

Per Linus' comments requesting the replacement of "INDIR_BR_LP" in the
indirect branch tracking prctl()s with something more readable, and
suggesting the use of the speculation control prctl()s as an exemplar,
reimplement the prctl()s and related constants that control per-task
forward-edge control flow integrity.

This primarily involves two changes.  First, the prctls are
restructured to resemble the style of the speculative execution
workaround control prctls PR_{GET,SET}_SPECULATION_CTRL, to make them
easier to extend in the future.  Second, the "indir_br_lp" abbrevation
is expanded to "branch_landing_pads" to be less telegraphic.  The
kselftest and documentation is adjusted accordingly.

Link: https://lore.kernel.org/linux-riscv/CAHk-=whhSLGZAx3N5jJpb4GLFDqH_QvS07D+6BnkPWmCEzTAgw@mail.gmail.com/
Cc: Deepak Gupta <debug@rivosinc.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: ptrace: cfi: expand "SS" references to "shadow stack" in uapi headers
Paul Walmsley [Sun, 5 Apr 2026 00:40:58 +0000 (18:40 -0600)] 
riscv: ptrace: cfi: expand "SS" references to "shadow stack" in uapi headers

Similar to the recent change to expand "LP" to "branch landing pad",
let's expand "SS" in the ptrace uapi macros to "shadow stack" as well.
This aligns with the existing prctl() arguments, which use the
expanded "shadow stack" names, rather than just the abbreviation.

Link: https://lore.kernel.org/linux-riscv/CAHk-=whhSLGZAx3N5jJpb4GLFDqH_QvS07D+6BnkPWmCEzTAgw@mail.gmail.com/
Cc: Deepak Gupta <debug@rivosinc.com>
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoprctl: rename branch landing pad implementation functions to be more explicit
Paul Walmsley [Sun, 5 Apr 2026 00:40:58 +0000 (18:40 -0600)] 
prctl: rename branch landing pad implementation functions to be more explicit

Per Linus' comments about the unreadability of abbreviations such as
"indir_br_lp", rename the three prctl() implementation functions to be more
explicit.  This involves renaming "indir_br_lp_status" in the function
names to "branch_landing_pad_state".

While here, add _prctl_ into the function names, following the
speculation control prctl implementation functions.

Link: https://lore.kernel.org/linux-riscv/CAHk-=whhSLGZAx3N5jJpb4GLFDqH_QvS07D+6BnkPWmCEzTAgw@mail.gmail.com/
Cc: Deepak Gupta <debug@rivosinc.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: ptrace: expand "LP" references to "branch landing pads" in uapi headers
Paul Walmsley [Sun, 5 Apr 2026 00:40:58 +0000 (18:40 -0600)] 
riscv: ptrace: expand "LP" references to "branch landing pads" in uapi headers

Per Linus' comments about the unreadability of abbreviations such as
"LP", rename the RISC-V ptrace landing pad CFI macro names to be more
explicit.  This primarily involves expanding "LP" in the names to some
variant of "branch landing pad."

Link: https://lore.kernel.org/linux-riscv/CAHk-=whhSLGZAx3N5jJpb4GLFDqH_QvS07D+6BnkPWmCEzTAgw@mail.gmail.com/
Cc: Deepak Gupta <debug@rivosinc.com>
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: cfi: clear CFI lock status in start_thread()
Zong Li [Sun, 5 Apr 2026 00:40:58 +0000 (18:40 -0600)] 
riscv: cfi: clear CFI lock status in start_thread()

When libc locks the CFI status through the following prctl:
 - PR_LOCK_SHADOW_STACK_STATUS
 - PR_LOCK_INDIR_BR_LP_STATUS

A newly execd address space will inherit the lock status
if it does not clear the lock bits. Since the lock bits
remain set, libc will later fail to enable the landing
pad and shadow stack.

Signed-off-by: Zong Li <zong.li@sifive.com>
Link: https://patch.msgid.link/20260323065640.4045713-1-zong.li@sifive.com
[pjw@kernel.org: ensure we unlock before changing state; cleaned up subject line]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: ptrace: cfi: fix "PRACE" typo in uapi header
Paul Walmsley [Sun, 5 Apr 2026 00:40:57 +0000 (18:40 -0600)] 
riscv: ptrace: cfi: fix "PRACE" typo in uapi header

A CFI-related macro defined in arch/riscv/uapi/asm/ptrace.h misspells
"PTRACE" as "PRACE"; fix this.

Fixes: 2af7c9cf021c ("riscv/ptrace: expose riscv CFI status and state via ptrace and in core files")
Cc: Deepak Gupta <debug@rivosinc.com>
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoACPI: RIMT: Add dependency between iommu and devices
Sunil V L [Tue, 3 Mar 2026 06:16:05 +0000 (11:46 +0530)] 
ACPI: RIMT: Add dependency between iommu and devices

EPROBE_DEFER ensures IOMMU devices are probed before the devices that
depend on them. During shutdown, however, the IOMMU may be removed
first, leading to issues. To avoid this, a device link is added
which enforces the correct removal order.

Fixes: 8f7729552582 ("ACPI: RISC-V: Add support for RIMT")
Signed-off-by: Sunil V L <sunilvl@oss.qualcomm.com>
Link: https://patch.msgid.link/20260303061605.722949-1-sunilvl@oss.qualcomm.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoselftests: riscv: Add braces around EXPECT_EQ()
Charlie Jenkins [Tue, 10 Mar 2026 01:52:11 +0000 (18:52 -0700)] 
selftests: riscv: Add braces around EXPECT_EQ()

EXPECT_EQ() expands to multiple lines, breaking up one-line if
statements. This issue was not present in the patch on the mailing list
but was instead introduced by the maintainer when attempting to fix up
checkpatch warnings. Add braces around EXPECT_EQ() to avoid the error
even though checkpatch suggests them to be removed:

validate_v_ptrace.c:626:17: error: ‘else’ without a previous ‘if’

Fixes: 3789d5eecd5a ("selftests: riscv: verify syscalls discard vector context")
Fixes: 30eb191c895b ("selftests: riscv: verify ptrace rejects invalid vector csr inputs")
Fixes: 849f05ae1ea6 ("selftests: riscv: verify ptrace accepts valid vector csr values")
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Reviewed-and-tested-by: Sergey Matyukevich <geomatsi@gmail.com>
Link: https://patch.msgid.link/20260309-fix_selftests-v2-2-9d5a553a531e@gmail.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: use _BITUL macro rather than BIT() in ptrace uapi and kselftests
Paul Walmsley [Thu, 2 Apr 2026 23:18:03 +0000 (17:18 -0600)] 
riscv: use _BITUL macro rather than BIT() in ptrace uapi and kselftests

Fix the build of non-kernel code that includes the RISC-V ptrace uapi
header, and the RISC-V validate_v_ptrace.c kselftest, by using the
_BITUL() macro rather than BIT().  BIT() is not available outside
the kernel.

Based on patches and comments from Charlie Jenkins, Michael Neuling,
and Andreas Schwab.

Fixes: 30eb191c895b ("selftests: riscv: verify ptrace rejects invalid vector csr inputs")
Fixes: 2af7c9cf021c ("riscv/ptrace: expose riscv CFI status and state via ptrace and in core files")
Cc: Andreas Schwab <schwab@suse.de>
Cc: Michael Neuling <mikey@neuling.org>
Cc: Charlie Jenkins <thecharlesjenkins@gmail.com>
Link: https://patch.msgid.link/20260330024248.449292-1-mikey@neuling.org
Link: https://lore.kernel.org/linux-riscv/20260309-fix_selftests-v2-1-9d5a553a531e@gmail.com/
Link: https://lore.kernel.org/linux-riscv/20260309-fix_selftests-v2-3-9d5a553a531e@gmail.com/
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: Reset pmm when PR_TAGGED_ADDR_ENABLE is not set
Zishun Yi [Sun, 22 Mar 2026 16:00:22 +0000 (00:00 +0800)] 
riscv: Reset pmm when PR_TAGGED_ADDR_ENABLE is not set

In set_tagged_addr_ctrl(), when PR_TAGGED_ADDR_ENABLE is not set, pmlen
is correctly set to 0, but it forgets to reset pmm. This results in the
CPU pmm state not corresponding to the software pmlen state.

Fix this by resetting pmm along with pmlen.

Fixes: 2e1743085887 ("riscv: Add support for the tagged address ABI")
Signed-off-by: Zishun Yi <vulab@iscas.ac.cn>
Reviewed-by: Samuel Holland <samuel.holland@sifive.com>
Link: https://patch.msgid.link/20260322160022.21908-1-vulab@iscas.ac.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: make runtime const not usable by modules
Jisheng Zhang [Sat, 21 Feb 2026 02:37:31 +0000 (10:37 +0800)] 
riscv: make runtime const not usable by modules

Similar as commit 284922f4c563 ("x86: uaccess: don't use runtime-const
rewriting in modules") does, make riscv's runtime const not usable by
modules too, to "make sure this doesn't get forgotten the next time
somebody wants to do runtime constant optimizations". The reason is
well explained in the above commit: "The runtime-const infrastructure
was never designed to handle the modular case, because the constant
fixup is only done at boot time for core kernel code."

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://patch.msgid.link/20260221023731.3476-1-jszhang@kernel.org
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: patch: Avoid early phys_to_page()
Vivian Wang [Mon, 23 Mar 2026 23:43:47 +0000 (17:43 -0600)] 
riscv: patch: Avoid early phys_to_page()

Similarly to commit 8d09e2d569f6 ("arm64: patching: avoid early
page_to_phys()"), avoid using phys_to_page() for the kernel address case
in patch_map().

Since this is called from apply_boot_alternatives() in setup_arch(), and
commit 4267739cabb8 ("arch, mm: consolidate initialization of SPARSE
memory model") has moved sparse_init() to after setup_arch(),
phys_to_page() is not available there yet, and it panics on boot with
SPARSEMEM on RV32, which does not use SPARSEMEM_VMEMMAP.

Reported-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Closes: https://lore.kernel.org/r/20260223144108-dcace0b9-02e8-4b67-a7ce-f263bed36f26@linutronix.de/
Fixes: 4267739cabb8 ("arch, mm: consolidate initialization of SPARSE memory model")
Suggested-by: Mike Rapoport <rppt@kernel.org>
Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Tested-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://patch.msgid.link/20260310-riscv-sparsemem-alternatives-fix-v1-1-659d5dd257e2@iscas.ac.cn
[pjw@kernel.org: fix the subject line to align with the patch description]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoriscv: kgdb: fix several debug register assignment bugs
Paul Walmsley [Mon, 23 Mar 2026 23:43:47 +0000 (17:43 -0600)] 
riscv: kgdb: fix several debug register assignment bugs

Fix several bugs in the RISC-V kgdb implementation:

- The element of dbg_reg_def[] that is supposed to pertain to the S1
  register embeds instead the struct pt_regs offset of the A1
  register.  Fix this to use the S1 register offset in struct pt_regs.

- The sleeping_thread_to_gdb_regs() function copies the value of the
  S10 register into the gdb_regs[] array element meant for the S9
  register, and copies the value of the S11 register into the array
  element meant for the S10 register.  It also neglects to copy the
  value of the S11 register.  Fix all of these issues.

Fixes: fe89bd2be8667 ("riscv: Add KGDB support")
Cc: Vincent Chen <vincent.chen@sifive.com>
Link: https://patch.msgid.link/fde376f8-bcfd-bfe4-e467-07d8f7608d05@kernel.org
Signed-off-by: Paul Walmsley <pjw@kernel.org>
3 weeks agoDrivers: hv: Move add_interrupt_randomness() to hypervisor callback sysvec
Michael Kelley [Thu, 2 Apr 2026 20:24:00 +0000 (13:24 -0700)] 
Drivers: hv: Move add_interrupt_randomness() to hypervisor callback sysvec

The Hyper-V ISRs, for normal guests and when running in the hypervisor root
patition, are calling add_interrupt_randomness() as a primary source of
entropy. The call is currently in the ISRs as a common place to handle both
x86/x64 and arm64.

On x86/x64, hypervisor interrupts come through a custom sysvec entry, and
do not go through a generic interrupt handler.

On arm64, hypervisor interrupts come through an emulated GICv3. GICv3 uses
the generic handler handle_percpu_devid_irq(), which does not do
add_interrupt_randomness() -- unlike its counterpart
handle_percpu_irq().

But handle_percpu_devid_irq() is now updated to do the
add_interrupt_randomness(). So add_interrupt_randomness() is now needed
only in Hyper-V's x86/x64 custom sysvec path.

Move add_interrupt_randomness() from the Hyper-V ISRs into the Hyper-V
x86/x64 custom sysvec path, matching the existing STIMER0 sysvec path.

With this change, add_interrupt_randomness() is no longer called from any
device drivers, which is appropriate.

Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Acked-by: Wei Liu <wei.liu@kernel.org>
Link: https://patch.msgid.link/20260402202400.1707-3-mhklkml@zohomail.com
3 weeks agoMerge tag 'v7.0-rc6' into irq/core
Thomas Gleixner [Sat, 4 Apr 2026 18:59:34 +0000 (20:59 +0200)] 
Merge tag 'v7.0-rc6' into irq/core

to be able to merge the hyper-v patch related to randomness.

3 weeks agoMerge tag 'devfreq-next-for-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Rafael J. Wysocki [Sat, 4 Apr 2026 18:58:54 +0000 (20:58 +0200)] 
Merge tag 'devfreq-next-for-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux

Pull devfreq updates for v7.1 from Chanwoo Choi:

"- Remove unneeded casting for HZ_PER_KHZ on devfreq.c

 - Use _visible attribute to replace create/remove_sysfs_files() to fix
   sysfs attribute race conditions on devfreq.c

- Add support for Tegra114 activity monitor device on tegra30-devfreq.c"

* tag 'devfreq-next-for-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux:
  PM / devfreq: tegra30-devfreq: add support for Tegra114
  PM / devfreq: use _visible attribute to replace create/remove_sysfs_files()
  PM / devfreq: Remove unneeded casting for HZ_PER_KHZ

3 weeks agoMerge tag 'amd-pstate-v7.1-2026-04-02' of ssh://gitolite.kernel.org/pub/scm/linux...
Rafael J. Wysocki [Sat, 4 Apr 2026 18:55:56 +0000 (20:55 +0200)] 
Merge tag 'amd-pstate-v7.1-2026-04-02' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux

Pull amd-pstate new content for 7.1 (2026-04-02) from Mario Limonciello:

"Add support for new features:
  * CPPC performance priority
  * Dynamic EPP
  * Raw EPP
  * New unit tests for new features
 Fixes for:
  * PREEMPT_RT
  * sysfs files being present when HW missing
  * Broken/outdated documentation"

* tag 'amd-pstate-v7.1-2026-04-02' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux: (22 commits)
  MAINTAINERS: amd-pstate: Step down as maintainer, add Prateek as reviewer
  cpufreq: Pass the policy to cpufreq_driver->adjust_perf()
  cpufreq/amd-pstate: Pass the policy to amd_pstate_update()
  cpufreq/amd-pstate-ut: Add a unit test for raw EPP
  cpufreq/amd-pstate: Add support for raw EPP writes
  cpufreq/amd-pstate: Add support for platform profile class
  cpufreq/amd-pstate: add kernel command line to override dynamic epp
  cpufreq/amd-pstate: Add dynamic energy performance preference
  Documentation: amd-pstate: fix dead links in the reference section
  cpufreq/amd-pstate: Cache the max frequency in cpudata
  Documentation/amd-pstate: Add documentation for amd_pstate_floor_{freq,count}
  Documentation/amd-pstate: List amd_pstate_prefcore_ranking sysfs file
  Documentation/amd-pstate: List amd_pstate_hw_prefcore sysfs file
  amd-pstate-ut: Add a testcase to validate the visibility of driver attributes
  amd-pstate-ut: Add module parameter to select testcases
  amd-pstate: Introduce a tracepoint trace_amd_pstate_cppc_req2()
  amd-pstate: Add sysfs support for floor_freq and floor_count
  amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF
  x86/cpufeatures: Add AMD CPPC Performance Priority feature.
  amd-pstate: Make certain freq_attrs conditionally visible
  ...

3 weeks agocpuidle: Simplify cpuidle_register_device() with guard()
Huisong Li [Fri, 3 Apr 2026 08:45:42 +0000 (16:45 +0800)] 
cpuidle: Simplify cpuidle_register_device() with guard()

Use guard() macro for mutex to simplify the control flow in
cpuidle_register_device().

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Link: https://patch.msgid.link/20260403084542.708104-1-lihuisong@huawei.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
3 weeks agoACPI: processor: idle: Fix NULL pointer dereference in hotplug path
Huisong Li [Fri, 3 Apr 2026 09:02:53 +0000 (17:02 +0800)] 
ACPI: processor: idle: Fix NULL pointer dereference in hotplug path

A cpuidle_device might fail to register during boot, but the system can
continue to run. In such cases, acpi_processor_hotplug() can trigger
a NULL pointer dereference when accessing the per-cpu acpi_cpuidle_device.

So add NULL pointer check for the per-cpu acpi_cpuidle_device in
acpi_processor_hotplug.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Link: https://patch.msgid.link/20260403090253.998322-1-lihuisong@huawei.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
3 weeks agobus: fsl-mc: use generic driver_override infrastructure
Danilo Krummrich [Tue, 24 Mar 2026 00:59:06 +0000 (01:59 +0100)] 
bus: fsl-mc: use generic driver_override infrastructure

When a driver is probed through __driver_attach(), the bus' match()
callback is called without the device lock held, thus accessing the
driver_override field without a lock, which can cause a UAF.

Fix this by using the driver-core driver_override infrastructure taking
care of proper locking internally.

Note that calling match() from __driver_attach() without the device lock
held is intentional. [1]

Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Acked-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Acked-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Link: https://lore.kernel.org/driver-core/DGRGTIRHA62X.3RY09D9SOK77P@kernel.org/
Reported-by: Gui-Dong Han <hanguidong02@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220789
Fixes: 1f86a00c1159 ("bus/fsl-mc: add support for 'driver_override' in the mc-bus")
Link: https://patch.msgid.link/20260324005919.2408620-3-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
3 weeks agoACPI: processor: idle: Reset power_setup_done flag on initialization failure
Huisong Li [Fri, 3 Apr 2026 08:53:43 +0000 (16:53 +0800)] 
ACPI: processor: idle: Reset power_setup_done flag on initialization failure

The 'power_setup_done' flag is a key indicator used across the ACPI
processor driver to determine if cpuidle are properly configured and
available for a given CPU.

Currently, this flag is set during the early stages of initialization.
However, if the subsequent registration of the cpuidle driver in
acpi_processor_register_idle_driver() or the per-CPU device registration
in acpi_processor_power_init() fails, this flag remains set. This may
lead to some issues where other functions in ACPI idle driver use these
flags.

Fix this by explicitly resetting this flag to 0 in these error paths.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Link: https://patch.msgid.link/20260403085343.866440-1-lihuisong@huawei.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
3 weeks agoACPI: TAD: Add alarm support to the RTC class device interface
Rafael J. Wysocki [Tue, 31 Mar 2026 19:38:52 +0000 (21:38 +0200)] 
ACPI: TAD: Add alarm support to the RTC class device interface

Add alarm support, based on Section 9.17 of ACPI 6.6 [1], to the RTC
class device interface of the driver.

The ACPI time and alarm device (TAD) can support two separate alarm
timers, one for waking up the system when it is on AC power, and one
for waking it up when it is on DC power.  In principle, each of them
can be set to a different value representing the number of seconds
till the given alarm timer expires.

However, the RTC class device can only set one alarm, so it will set
both the alarm timers of the ACPI TAD (if the DC one is supported) to
the same value.  That is somewhat cumbersome because there is no way in
the ACPI TAD firmware interface to set both timers in one go, so they
need to be set sequentially, but that's how it goes.

On the alarm read side, the driver assumes that both timers have been
set to the same value, so it is sufficient to access one of them (the
AC one specifically).

Link: https://uefi.org/specs/ACPI/6.6/09_ACPI_Defined_Devices_and_Device_Specific_Objects.html#time-and-alarm-device
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://patch.msgid.link/2076980.usQuhbGJ8B@rafael.j.wysocki
3 weeks agoACPI: TAD: Split acpi_tad_rtc_read_time()
Rafael J. Wysocki [Tue, 31 Mar 2026 19:26:23 +0000 (21:26 +0200)] 
ACPI: TAD: Split acpi_tad_rtc_read_time()

Move the code converting a struct acpi_tad_rt into a struct rtc_time
from acpi_tad_rtc_read_time() into a new function, acpi_tad_rt_to_tm(),
to facilitate adding alarm support to the driver's RTC class device
interface going forward.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
[ rjw: Subject and changelog edits ]
Link: https://patch.msgid.link/9619488.CDJkKcVGEf@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
3 weeks agoACPI: TAD: Relocate two functions
Rafael J. Wysocki [Tue, 31 Mar 2026 19:25:40 +0000 (21:25 +0200)] 
ACPI: TAD: Relocate two functions

Move two functions introduced previously, __acpi_tad_wake_set() and
__acpi_tad_wake_read(), to the part of the code preceding the sysfs
interface implementation, since subsequently they will be used by
the RTC device interface too.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://patch.msgid.link/3960639.kQq0lBPeGt@rafael.j.wysocki
3 weeks agoACPI: TAD: Split three functions to untangle runtime PM handling
Rafael J. Wysocki [Tue, 31 Mar 2026 19:24:44 +0000 (21:24 +0200)] 
ACPI: TAD: Split three functions to untangle runtime PM handling

Move the core functionality of acpi_tad_get_real_time(),
acpi_tad_wake_set(), and acpi_tad_wake_read() into separate functions
called __acpi_tad_get_real_time(), __acpi_tad_wake_set(), and
__acpi_tad_wake_read(), respectively, which can be called from
code blocks following a single runtime resume of the device.

This will facilitate adding alarm support to the RTC class device
interface of the driver going forward.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://patch.msgid.link/23076728.EfDdHjke4D@rafael.j.wysocki
3 weeks agoACPI: processor: Rearrange and clean up acpi_processor_errata_piix4()
Rafael J. Wysocki [Tue, 31 Mar 2026 19:09:42 +0000 (21:09 +0200)] 
ACPI: processor: Rearrange and clean up acpi_processor_errata_piix4()

In acpi_processor_errata_piix4() it is not necessary to use three
struct pci_dev pointers.  One is sufficient, so use it everywhere and
drop the other two.

Additionally, define the auxiliary local variables value1 and value2
in the code block in which they are used.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/2846888.mvXUDI8C0e@rafael.j.wysocki
3 weeks agoPCI: cadence: Use cdns_pcie_read_sz() for byte or word read access
Aksh Garg [Thu, 2 Apr 2026 08:55:45 +0000 (14:25 +0530)] 
PCI: cadence: Use cdns_pcie_read_sz() for byte or word read access

The commit 18ac51ae9df9 ("PCI: cadence: Implement capability search
using PCI core APIs") assumed all the platforms using Cadence PCIe
controller support byte and word register accesses. This is not true
for all platforms (e.g., TI J721E SoC, which only supports dword
register accesses).

This causes capability searches via cdns_pcie_find_capability() to fail
on such platforms.

Fix this by using cdns_pcie_read_sz() for config read functions, which
properly handles size-aligned accesses. Remove the now-unused byte and
word read wrapper functions (cdns_pcie_readw and cdns_pcie_readb).

Fixes: 18ac51ae9df9 ("PCI: cadence: Implement capability search using PCI core APIs")
Signed-off-by: Aksh Garg <a-garg7@ti.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260402085545.284457-1-a-garg7@ti.com
3 weeks agoACPI: TAD: Use DC wakeup only if AC wakeup is supported
Rafael J. Wysocki [Mon, 23 Mar 2026 15:26:37 +0000 (16:26 +0100)] 
ACPI: TAD: Use DC wakeup only if AC wakeup is supported

According to Section 9.17.2 of ACPI 6.6 [1], setting ACPI_TAD_DC_WAKE in
the capabilities without setting ACPI_TAD_AC_WAKE is invalid, so don't
support wakeup if that's the case.

Moreover, it is sufficient to check ACPI_TAD_AC_WAKE alone to determine
if wakeup is supported at all, so use this observation to simplify one
check.

Link: https://uefi.org/specs/ACPI/6.6/09_ACPI_Defined_Devices_and_Device_Specific_Objects.html#gcp-get-capability
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/2833494.mvXUDI8C0e@rafael.j.wysocki
3 weeks agoACPI: TAD: Use dev_groups in struct device_driver
Rafael J. Wysocki [Tue, 10 Mar 2026 20:29:29 +0000 (21:29 +0100)] 
ACPI: TAD: Use dev_groups in struct device_driver

Instead of creating and removing the device sysfs attributes directly
during probe and remove of the driver, respectively, use dev_groups in
struct device_driver to point to the attribute definitions and let the
core take care of creating and removing them.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/2836803.mvXUDI8C0e@rafael.j.wysocki
3 weeks agoACPI: TAD: Update the driver description comment
Rafael J. Wysocki [Wed, 4 Mar 2026 18:16:48 +0000 (19:16 +0100)] 
ACPI: TAD: Update the driver description comment

Update the preamble comment describing the driver to match the code
after previous changes along with the copyright information.

No functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/23034847.EfDdHjke4D@rafael.j.wysocki
3 weeks agoACPI: TAD: Add RTC class device interface
Rafael J. Wysocki [Wed, 4 Mar 2026 18:16:01 +0000 (19:16 +0100)] 
ACPI: TAD: Add RTC class device interface

Add an RTC class device interface allowing to read and set the real time
value to the ACPI TAD driver.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://patch.msgid.link/2352027.iZASKD2KPV@rafael.j.wysocki
3 weeks agoACPI: TAD: Clear unused RT data in acpi_tad_set_real_time()
Rafael J. Wysocki [Wed, 4 Mar 2026 18:15:21 +0000 (19:15 +0100)] 
ACPI: TAD: Clear unused RT data in acpi_tad_set_real_time()

Move the clearing of the fields in struct acpi_tad_rt that are not used
on the real time setting side to acpi_tad_set_real_time().

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/8660506.T7Z3S40VBb@rafael.j.wysocki
3 weeks agoACPI: TAD: Rearrange RT data validation checking
Rafael J. Wysocki [Wed, 4 Mar 2026 18:14:44 +0000 (19:14 +0100)] 
ACPI: TAD: Rearrange RT data validation checking

Move RT data validation checks from acpi_tad_set_real_time() to
a separate function called acpi_tad_rt_is_invalid() and use it
also in acpi_tad_get_real_time() to validate data coming from
the platform firmware.

Also make acpi_tad_set_real_time() return -EINVAL when the RT data
passed to it is invalid (instead of -ERANGE which is somewhat
confusing) and introduce ACPI_TAD_TZ_UNSPEC to represent the
"unspecified timezone" value.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3409319.aeNJFYEL58@rafael.j.wysocki
3 weeks agoACPI: TAD: Use __free() for cleanup in time_store()
Rafael J. Wysocki [Wed, 4 Mar 2026 18:14:01 +0000 (19:14 +0100)] 
ACPI: TAD: Use __free() for cleanup in time_store()

Use __free() for the automatic freeing of memory pointed to by local
variable str in time_store() which allows the code to become somewhat
easier to follow.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/13971300.uLZWGnKmhe@rafael.j.wysocki
3 weeks agoACPI: TAD: Support RTC without wakeup
Rafael J. Wysocki [Wed, 4 Mar 2026 18:13:15 +0000 (19:13 +0100)] 
ACPI: TAD: Support RTC without wakeup

The ACPI TAD can provide a functional RTC without wakeup capabilities,
so stop failing probe if AC wakeup is not supported.

Also, if _PRW is missing, do not fail probe, but clear the wakeup bits
in capabilities.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/1959268.tdWV9SEqCh@rafael.j.wysocki
3 weeks agoACPI: TAD: Create one attribute group
Rafael J. Wysocki [Wed, 4 Mar 2026 18:12:22 +0000 (19:12 +0100)] 
ACPI: TAD: Create one attribute group

Instead of creating three attribute groups, one for each supported
subset of capabilities, create just one and use an .is_visible()
callback in it to decide which attributes to use.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/2412153.ElGaqSPkdT@rafael.j.wysocki
3 weeks agortc: cmos: Do not require IRQ if ACPI alarm is used
Rafael J. Wysocki [Sat, 14 Mar 2026 12:12:44 +0000 (13:12 +0100)] 
rtc: cmos: Do not require IRQ if ACPI alarm is used

If the ACPI RTC fixed event is used, a dedicated IRQ is not required
for the CMOS RTC alarm to work, so allow the driver to use the alarm
without a valid IRQ in that case.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Link: https://patch.msgid.link/6168746.MhkbZ0Pkbq@rafael.j.wysocki
3 weeks agortc: cmos: Enable ACPI alarm if advertised in ACPI FADT
Rafael J. Wysocki [Sat, 14 Mar 2026 12:11:20 +0000 (13:11 +0100)] 
rtc: cmos: Enable ACPI alarm if advertised in ACPI FADT

If the ACPI_FADT_FIXED_RTC flag is unset, the platform is declaring that
it supports the ACPI RTC fixed event which should be used instead of a
dedicated CMOS RTC IRQ.  However, the driver only enables it when
is_hpet_enabled() returns true, which is questionable because there is
no clear connection between enabled HPET and signaling wakeup via the
ACPI RTC fixed event (for instance, the latter can be expected to work
on systems that don't include a functional HPET).

Moreover, since use_hpet_alarm() returns false if use_acpi_alarm is set,
the ACPI RTC fixed event is effectively used instead of the HPET alarm
if the latter is functional, but there is no particular reason why it
could not be used otherwise.

Accordingly, on x86 systems with ACPI, set use_acpi_alarm if
ACPI_FADT_FIXED_RTC is unset without looking at whether or not HPET is
enabled.

Also, do the ACPI FADT check in use_acpi_alarm_quirks() before the DMI
BIOS year checks which are more expensive and it's better to skip them
if ACPI_FADT_FIXED_RTC is set.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Link: https://patch.msgid.link/9618535.CDJkKcVGEf@rafael.j.wysocki
3 weeks agoPCI: mediatek-gen3: Prevent leaking IRQ domains when IRQ not found
Chen-Yu Tsai [Tue, 24 Mar 2026 09:35:41 +0000 (17:35 +0800)] 
PCI: mediatek-gen3: Prevent leaking IRQ domains when IRQ not found

In mtk_pcie_setup_irq(), the IRQ domains are allocated before the
controller's IRQ is fetched. If the latter fails, the function
directly returns an error, without cleaning up the allocated domains.

Hence, reverse the order so that the IRQ domains are allocated after the
controller's IRQ is found.

This was flagged by Sashiko during a review of "[PATCH v6 0/7] PCI:
mediatek-gen3: add power control support".

Fixes: 814cceebba9b ("PCI: mediatek-gen3: Add INTx support")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://sashiko.dev/#/patchset/20260324052002.4072430-1-wenst%40chromium.org
Link: https://patch.msgid.link/20260324093542.18523-1-wenst@chromium.org
3 weeks agoMerge tag 'microchip-soc-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git...
Krzysztof Kozlowski [Sat, 4 Apr 2026 15:34:56 +0000 (17:34 +0200)] 
Merge tag 'microchip-soc-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91/linux into soc/arm

Microchip ARM64 SoC updates for v7.1

This update includes:
- use a top-level configuration flag for all Microchip platforms

* tag 'microchip-soc-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  arm64: Kconfig: provide a top-level switch for Microchip platforms

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
3 weeks agoMerge tag 'microchip-dt64-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel...
Krzysztof Kozlowski [Sat, 4 Apr 2026 15:32:55 +0000 (17:32 +0200)] 
Merge tag 'microchip-dt64-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91/linux into soc/dt

Microchip ARM64 device tree updates for v7.1

This update includes:
- device tree files for the Microchip LAN9691 SoC and its evaluation
  board (Microchip EV23X71A)

* tag 'microchip-dt64-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  arm64: dts: microchip: add EV23X71A board
  dt-bindings: arm: AT91: document EV23X71A board
  arm64: dts: microchip: add LAN969x support
  arm64: dts: microchip: add LAN969x clock header file

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
3 weeks agoMerge tag 'at91-soc-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91...
Krzysztof Kozlowski [Sat, 4 Apr 2026 15:30:56 +0000 (17:30 +0200)] 
Merge tag 'at91-soc-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91/linux into soc/drivers

Microchip AT91 SoC updates for v7.1

This update includes:
- device tree bindings conversion to DT schema for CHIPID, RAM
  controller and PIT, PIT64b, ST timers

* tag 'at91-soc-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  dt-bindings: arm: atmel,at91rm9200-sdramc: convert to DT schema
  dt-bindings: arm: atmel,at91rm9200-st: convert to DT schema
  dt-bindings: arm: microchip,sam9x60-pit64b : convert to DT schema
  dt-bindings: arm: atmel,at91sam9260-pit: convert to DT schema
  dt-bindings: arm: microchip,sama7g5-chipid : convert to DT schema

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
3 weeks agoMerge tag 'at91-dt-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91...
Krzysztof Kozlowski [Sat, 4 Apr 2026 15:27:46 +0000 (17:27 +0200)] 
Merge tag 'at91-dt-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91/linux into soc/dt

Microchip AT91 device tree updates for v7.1

This update includes:
- enable LVDS, LCD and PMU for SAMA7D64 SoC
- drop unused #address-cells, #size-cells for SAM9X60 UDC node

* tag 'at91-dt-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  ARM: dts: microchip: sama7d65: add Cortex-A7 PMU node
  arm: dts: microchip: remove unused #address-cells/#size-cells from sam9x60 udc node
  ARM: dts: microchip: sama7d65: add LVDS controller
  ARM: dts: microchip: sama7d65: add LCD controller

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
3 weeks agoMerge tag 'at91-defconfig-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel...
Krzysztof Kozlowski [Sat, 4 Apr 2026 15:24:37 +0000 (17:24 +0200)] 
Merge tag 'at91-defconfig-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91/linux into soc/defconfig

Microchip AT91 defconfig updates for v7.1

This update includes:
- LCD controller, LVDS controller, backlight, simple pannel, touchscreen
  configuration flags required by SAMA7D65 SoC

* tag 'at91-defconfig-7.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  ARM: configs: at91: sama7: enable LVDS serializer support
  ARM: configs: at91: sama7: enable config for atmel maxtouch
  ARM: configs: at91: sama7: enable DRM hlcdc support

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
3 weeks agoMerge tag 'input-for-v7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor...
Linus Torvalds [Sat, 4 Apr 2026 15:24:32 +0000 (08:24 -0700)] 
Merge tag 'input-for-v7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input fixes from Dmitry Torokhov:

 - new IDs for BETOP BTP-KP50B/C and Razer Wolverine V3 Pro added to
   xpad controller driver

 - another quirk for new TUXEDO InfinityBook added to i8042

 - a small fixup for Synaptics RMI4 driver to properly unlock mutex when
   encountering an error in F54

 - an update to bcm5974 touch controller driver to reliably switch into
   wellspring mode

* tag 'input-for-v7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: xpad - add support for BETOP BTP-KP50B/C controller's wireless mode
  Input: xpad - add support for Razer Wolverine V3 Pro
  Input: synaptics-rmi4 - fix a locking bug in an error path
  Input: i8042 - add TUXEDO InfinityBook Max 16 Gen10 AMD to i8042 quirk table
  Input: bcm5974 - recover from failed mode switch

3 weeks agoMerge tag 'at91-fixes-7.0' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git...
Krzysztof Kozlowski [Sat, 4 Apr 2026 15:22:39 +0000 (17:22 +0200)] 
Merge tag 'at91-fixes-7.0' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/fixes

Microchip AT91 fixes for v7.0

This update includes:
- fix gpio-lines for SAM9X7 PIOB GPIO controller

* tag 'at91-fixes-7.0' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  ARM: dts: microchip: sam9x7: fix gpio-lines count for pioB

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
3 weeks agoMerge tag 'imx-dt64-7.1' of https://git.kernel.org/pub/scm/linux/kernel/git/frank...
Krzysztof Kozlowski [Sat, 4 Apr 2026 14:30:40 +0000 (16:30 +0200)] 
Merge tag 'imx-dt64-7.1' of https://git.kernel.org/pub/scm/linux/kernel/git/frank.li/linux into soc/dt

Krzysztof notes:
1. This might impact users of i.MX8MM SPDIF as compatible is being
   replaced.

Frank Li writes:

i.MX arm64 device tree changes for 7.1:

- New Board Support
  S32N79-RDB, Variscite DART-MX95, DART-MX91 with Sonata carrier boards,
  Verdin iMX95 with multiple carrier boards (Yavia, Mallow, Ivy, Dahlia)
  TQMa93xx/MBa93xxLA-MINI, SolidRun i.MX8MP HummingBoard IIoT,
  SolidRun i.MX8MM SOM and EVB, SolidRun SolidSense-N8 board
  Ka-Ro Electronics tx8m-1610 COM, GOcontroll Moduline IV and Moduline Mini,
  NXP FRDM-IMX91S board, i.MX93 Wireless EVK board with Wireless SiP,
  NXP i.MX8MP audio board v2.

- USB & Type-C Support
  Type-C and USB nodes for imx943, correct power-fole for
  imx8qxp-mek/imx8qm-mek.

- Audio Enhancements
  PDM microphone, bt-sco, and WM8962 sound card support for i.MX952. AONMIX
  MQS for i.MX95. Use audio-graph-card2 for imx8dxl-evk. WM8904 audio codec
  for imx8mm-var-som.

- Thermal & Cooling
  PF09/53 thermal zone, fan node, active cooling on A55, SCMI
  sensor/lmm/cpu for imx943/imx94.

- Display Support
  Multiple LVDS and parallel display overlays for TQ boards (imx91/imx93).
  Parallel display for i.MX93. ontat,kd50g21-40nt-a1 panel for
  imx93-9x9-qsb. pixpaper display overlay for i.MX93 FRDM.

- Networking
  Multiple queue configuration on eqos for TQMa8MPxL.
  MaxLinear PHY support, MCP251xFD CAN controller for imx8mm-var-som.
  SDIO WiFi support (imx91-evk, imx8mp-evk, imx943-evk)

- Bluetooth Support
  imx943-evk, imx93-14x14-evk, imx95-19x19-evk, imx8mp-evk, imx8mn-evk,
  imx8mm-evk.

- Miscellaneous
  xspi and MT35XU01G SPI NOR flash for i.MX952.
  V2X/ELE mailbox nodes, SCMI misc ctrl-ids for imx94.
  eDMA channel reservation for V2X, Cortex M7 support for imx95.
  Ethos-U65 NPU and SRAM nodes for imx93.
  Wire up DMA IRQ for PCIe for imx8qm-ss-hsio.

- Bug Fixes & Improvements
  Complete pinmux for rcwsr12 to fix I2C bus recovery affect other module
  pinmux for layscape platform.
  Multiple bug fixes for GPIO polarity, IRQ types, pinmux configurations.
  GICv3 PPI interrupt CPU mask cleanup across multiple SoCs.
  Fixed Ethernet PHY IRQ types on TQ boards.
  Fixed UART RTS/CTS muxing issues.
  Fixed SD card issues on Kontron boards.
  Fixed touch reset configuration.
  Removed fallback ethernet-phy-ieee802.3-c22 where appropriate.
  Move funnel outside from soc.
  TMU sensor ID cleanup.
  Change usdhc tuning step for eMMC and SD.
  Hexadecimal format, readability improvements, duplicate removal.

* tag 'imx-dt64-7.1' of https://git.kernel.org/pub/scm/linux/kernel/git/frank.li/linux: (139 commits)
  arm64: dts: imx8qxp-mek: switch Type-C connector power-role to dual
  arm64: dts: imx8qm-mek: switch Type-C connector power-role to dual
  arm64: dts: lx2162a-clearfog: set sfp connector leds function and source
  arm64: dts: lx2162a-sr-som: add crypto & rtc aliases, model
  arm64: dts: lx2160a-cex7: add rtc alias
  arm64: dts: lx2160a: complete pinmux for rcwsr12 configuration word
  arm64: dts: lx2160a: change zeros to hexadecimal in pinmux nodes
  arm64: dts: lx2160a: add sda gpio references for i2c bus recovery
  arm64: dts: lx2160a: rename pinmux nodes for readability
  arm64: dts: lx2160a: remove duplicate pinmux nodes
  arm64: dts: lx2160a: change i2c0 (iic1) pinmux mask to one bit
  arm64: dts: lx2160a-cex7/lx2162a-sr-som: fix usd-cd & gpio pinmux
  arm64: dts: freescale: imx8mp-moduline-display-106: add typec-power-opmode property
  arm64: dts: imx8mp-tqma8mpql: Add DT overlays to explicit list
  arm64: dts: imx8mp-evk: Specify ADV7535 register addresses
  arm64: dts: imx8dxl-evk: Use audio-graph-card2 for wm8960-2 and wm8960-3
  arm64: dts: imx943-evk: Add pf09/53 thermal zone
  arm64: dts: imx943-evk: Add fan node and enable active cooling on A55
  arm64: dts: imx943-evk: Add nxp,ctrl-ids for scmi_misc
  arm64: dts: imx943: Add thermal support
  ...

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
3 weeks agoMerge tag 'tegra-for-7.1-arm64-dt' of https://git.kernel.org/pub/scm/linux/kernel...
Krzysztof Kozlowski [Sat, 4 Apr 2026 14:13:27 +0000 (16:13 +0200)] 
Merge tag 'tegra-for-7.1-arm64-dt' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/dt

arm64: tegra: Device tree changes for v7.1-rc1

Various fixes and new additions across a number of devices. GPIO and PCI
are enabled on Tegra264 and the Jetson AGX Thor Developer Kit, allowing
it to boot via network and mass storage.

* tag 'tegra-for-7.1-arm64-dt' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  arm64: tegra: Add Tegra264 GPIO controllers
  arm64: tegra: smaug: Enable SPI-NOR flash
  arm64: tegra: Add Jetson AGX Thor Developer Kit support
  arm64: tegra: Add PCI controllers on Tegra264
  arm64: tegra: Fix RTC aliases
  arm64: tegra: Drop redundant clock and reset names for TSEC
  arm64: tegra: Fix snps,blen properties
  dt-bindings: pci: Document the NVIDIA Tegra264 PCIe controller

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
3 weeks agoblock: remove unused BVEC_ITER_ALL_INIT
Caleb Sander Mateos [Fri, 3 Apr 2026 18:48:51 +0000 (12:48 -0600)] 
block: remove unused BVEC_ITER_ALL_INIT

This macro no longer has any users, so remove it.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Link: https://patch.msgid.link/20260403184852.2140919-1-csander@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 weeks agoMerge tag 'tegra-for-7.1-dt-bindings' of https://git.kernel.org/pub/scm/linux/kernel...
Krzysztof Kozlowski [Sat, 4 Apr 2026 14:09:43 +0000 (16:09 +0200)] 
Merge tag 'tegra-for-7.1-dt-bindings' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers

dt-bindings: Changes for v7.1-rc1

This contains a few conversions to DT schema along with various
additions and fixes to reduce the amount of validation warnings.

Included are also a new binding for the PCIe controller found on
Tegra264 as well as compatible strings for the Jetson AGX Thor
Developer Kit.

* tag 'tegra-for-7.1-dt-bindings' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  dt-bindings: arm: tegra: Document Jetson AGX Thor DevKit
  dt-bindings: display: tegra: Document Tegra20 HDMI port
  dt-bindings: arm: tegra: Add Tegra238 CBB compatible strings
  dt-bindings: memory: tegra210: Mark EMC as cooling device
  dt-bindings: memory: Add Tegra210 memory controller bindings
  dt-bindings: phy: tegra: Document Tegra210 USB PHY
  dt-bindings: arm: tegra: Add missing compatible strings
  dt-bindings: interrupt-controller: tegra: Fix reg entries
  dt-bindings: clock: tegra124-dfll: Convert to json-schema
  dt-bindings: phy: tegra-xusb: Document Type C support
  dt-bindings: pci: Document the NVIDIA Tegra264 PCIe controller

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
3 weeks agoMerge tag 'tegra-for-7.1-arm-dt' of https://git.kernel.org/pub/scm/linux/kernel/git...
Krzysztof Kozlowski [Sat, 4 Apr 2026 14:03:22 +0000 (16:03 +0200)] 
Merge tag 'tegra-for-7.1-arm-dt' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/dt

ARM: tegra: Device tree changes for v7.1-rc1

Various improvements for Tegra114 boards, as well as some legacy cleanup
for PAZ00 and Transformers devices.

* tag 'tegra-for-7.1-arm-dt' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  ARM: tegra: paz00: Configure WiFi rfkill switch through device tree
  ARM: tegra: transformers: Add connector node
  ARM: tegra: Add External Memory Controller node on Tegra114
  ARM: tegra: Add ACTMON node to Tegra114 device tree
  ARM: tegra: lg-x3: Add node for capacitive buttons
  ARM: tegra: lg-x3: Add USB and power related nodes
  ARM: tegra: lg-x3: Add panel and bridge nodes
  ARM: tn7: Adjust panel node
  ARM: tegra: Add SOCTHERM support on Tegra114

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
3 weeks agothermal/core: Remove pointless variable when registering a cooling device
Daniel Lezcano [Thu, 2 Apr 2026 08:44:25 +0000 (10:44 +0200)] 
thermal/core: Remove pointless variable when registering a cooling device

The 'id' variable is set to store the ida_alloc() value which is
already stored into cdev->id. It is pointless to use it because
cdev->id can be used instead.

Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20260402084426.1360086-1-daniel.lezcano@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
3 weeks agoMerge back earlier thermal core updates for 7.1
Rafael J. Wysocki [Sat, 4 Apr 2026 12:59:43 +0000 (14:59 +0200)] 
Merge back earlier thermal core updates for 7.1

3 weeks agoMerge back earlier cpufreq material for 7.1
Rafael J. Wysocki [Sat, 4 Apr 2026 12:58:58 +0000 (14:58 +0200)] 
Merge back earlier cpufreq material for 7.1

3 weeks agox86/fpu: Correct misspelled xfeaures_to_write local var
Borislav Petkov (AMD) [Sat, 4 Apr 2026 11:12:09 +0000 (13:12 +0200)] 
x86/fpu: Correct misspelled xfeaures_to_write local var

It happens. Fix it.

No functional changes.

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260404120048.14765-1-bp@kernel.org
3 weeks agomisc: pci_endpoint_test: Add Tegra194 and Tegra234 device table entries
Manikanta Maddireddy [Tue, 24 Mar 2026 08:08:57 +0000 (13:38 +0530)] 
misc: pci_endpoint_test: Add Tegra194 and Tegra234 device table entries

Add PCI device IDs for Tegra194 (0x1ad4) and Tegra234(0x229b) Endpoint
controllers, so that pci_endpoint_test can bind and run on these
controllers.

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260324080857.916263-5-mmaddireddy@nvidia.com
3 weeks agoPCI: tegra194: Expose BAR2 (MSI-X) and BAR4 (DMA) as 64-bit BAR_RESERVED
Manikanta Maddireddy [Tue, 24 Mar 2026 08:08:56 +0000 (13:38 +0530)] 
PCI: tegra194: Expose BAR2 (MSI-X) and BAR4 (DMA) as 64-bit BAR_RESERVED

Tegra Endpoint exposes three 64-bit BARs at indices 0, 2, and 4:
- BAR0+BAR1: EPF test/data (programmable 64-bit BAR)
- BAR2+BAR3: MSI-X table (hardware-backed)
- BAR4+BAR5: DMA registers (hardware-backed)

Update tegra_pcie_epc_features so that BAR2 is BAR_RESERVED with
PCI_EPC_BAR_RSVD_MSIX_TBL_RAM (64 KB) & PCI_EPC_BAR_RSVD_MSIX_PBA_RAM
(64 KB) and BAR4 is BAR_RESERVED with PCI_EPC_BAR_RSVD_DMA_CTRL_MMIO (4KB).
This keeps CONSECUTIVE_BAR_TEST working while allowing the host to use
64-bit BAR2 (MSI-X) and BAR4 (DMA).

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260324080857.916263-4-mmaddireddy@nvidia.com
3 weeks agoPCI: tegra194: Make BAR0 programmable and remove 1MB size limit
Manikanta Maddireddy [Tue, 24 Mar 2026 08:08:55 +0000 (13:38 +0530)] 
PCI: tegra194: Make BAR0 programmable and remove 1MB size limit

The Tegra194/234 Endpoint does not support the Resizable BAR capability,
but BAR0 can be programmed to different sizes via the DBI2 BAR registers
in dw_pcie_ep_set_bar_programmable(). The BAR0 size is set once during
initialization.

Remove the fixed 1MB limit from pci_epc_features so Endpoint function
drivers can configure the BAR0 size they need.

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260324080857.916263-3-mmaddireddy@nvidia.com
3 weeks agoPCI: endpoint: Add reserved region type for MSI-X Table and PBA
Manikanta Maddireddy [Tue, 24 Mar 2026 08:08:54 +0000 (13:38 +0530)] 
PCI: endpoint: Add reserved region type for MSI-X Table and PBA

Add PCI_EPC_BAR_RSVD_MSIX_TBL_RAM and PCI_EPC_BAR_RSVD_MSIX_PBA_RAM to
enum pci_epc_bar_rsvd_region_type so that Endpoint controllers can
describe hardware-owned MSI-X Table and PBA (Pending Bit Array) regions
behind a BAR_RESERVED BAR.

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260324080857.916263-2-mmaddireddy@nvidia.com
3 weeks agodt-bindings: PCI: imx6q-pcie: Add i.MX94 and i.MX943 SoCs
Richard Zhu [Tue, 24 Mar 2026 02:30:33 +0000 (10:30 +0800)] 
dt-bindings: PCI: imx6q-pcie: Add i.MX94 and i.MX943 SoCs

Add bindings support for PCIe endpoint controllers in i.MX94 and i.MX943
SoCs with fallback to the i.MX95 SoC.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
[mani: commit log]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20260324023036.784466-3-hongxing.zhu@nxp.com
3 weeks agodt-bindings: PCI: imx6q-pcie: Fix maxItems of clocks and clock-names
Richard Zhu [Tue, 24 Mar 2026 02:30:32 +0000 (10:30 +0800)] 
dt-bindings: PCI: imx6q-pcie: Fix maxItems of clocks and clock-names

Commit 1352f58d7c8d ("dt-bindings: PCI: pci-imx6: Add external reference
clock input") that added reference clock to the binding was incomplete.

The constraints for "clocks" and "clock-names" still enforce an incorrect
number of items. Update maxItems for both properties to 6 to match the
actual hardware configuration.

Fixes: 1352f58d7c8d ("dt-bindings: PCI: pci-imx6: Add external reference clock input")
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
[mani: commit log]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260324023036.784466-2-hongxing.zhu@nxp.com
3 weeks agoPCI: aspeed: Fix IRQ domain leak on platform_get_irq() failure
Felix Gu [Mon, 23 Mar 2026 17:57:59 +0000 (01:57 +0800)] 
PCI: aspeed: Fix IRQ domain leak on platform_get_irq() failure

The aspeed_pcie_probe() function calls aspeed_pcie_init_irq_domain()
which allocates pcie->intx_domain and initializes MSI. However, if
platform_get_irq() fails afterwards, the cleanup action was not yet
registered via devm_add_action_or_reset(), causing the IRQ domain
resources to leak.

Fix this by registering the devm cleanup action immediately after
aspeed_pcie_init_irq_domain() succeeds, before calling
platform_get_irq(). This ensures proper cleanup on any subsequent
failure.

Fixes: 9aa0cb68fcc1 ("PCI: aspeed: Add ASPEED PCIe RC driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Tested-by: Jacky Chou <jacky_chou@aspeedtech.com>
Link: https://patch.msgid.link/20260324-aspeed-v1-1-354181624c00@gmail.com
3 weeks agortc: cmos: Use platform_get_irq_optional() in cmos_platform_probe()
Rafael J. Wysocki [Wed, 4 Mar 2026 12:55:43 +0000 (13:55 +0100)] 
rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe()

The rtc-cmos driver can live without an IRQ and returning an error
code from platform_get_irq() is not a problem for it in general, so
make it call platform_get_irq_optional() in cmos_platform_probe()
instead of platform_get_irq() to avoid a confusing error message
printed by the latter if an IRQ cannot be found for index 0, which
is possible on x86 platforms.

Additionally, on x86, if the IRQ is not defined and the system has
a legacy PIC, hardcode it to RTC_IRQ, which should be safe then (and
which is what the dropped PNP code did).

Fixes: d15f1c2e413e ("ACPI: PNP: Drop CMOS RTC PNP device support")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://lore.kernel.org/linux-acpi/20260303060752.GA2749263@ax162/
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/12857714.O9o76ZdvQC@rafael.j.wysocki
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
3 weeks agoMerge tag 'i2c-host-fixes-7.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git...
Wolfram Sang [Sat, 4 Apr 2026 10:02:20 +0000 (12:02 +0200)] 
Merge tag 'i2c-host-fixes-7.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux into i2c/for-current

i2c-fixes for v7.0-rc7

imx: set dma_slave_config to 0 and avoid uninitialized fields

3 weeks agotools/nolibc: use __builtin_offsetof()
Thomas Weißschuh [Wed, 1 Apr 2026 15:07:27 +0000 (17:07 +0200)] 
tools/nolibc: use __builtin_offsetof()

The current custom implementation of offsetof() fails UBSAN:
runtime error: member access within null pointer of type 'struct ...'
This means that all its users, including container_of(), free() and
realloc(), fail.

Use __builtin_offsetof() instead which does not have this issue and
has been available since GCC 4 and clang 3.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260401-nolibc-asprintf-v1-1-46292313439f@weissschuh.net
3 weeks agostaging: rtl8723bs: remove redundant & parentheses
Sam Daly [Fri, 3 Apr 2026 17:28:39 +0000 (19:28 +0200)] 
staging: rtl8723bs: remove redundant & parentheses

Remove redundant parentheses around the '&' operator to comply with
kernel style guidelines, as reported by checkpatch:
CHECK: Unnecessary parentheses around adapter->securitypriv

Signed-off-by: Sam Daly <sam@samdaly.ie>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260403172839.367663-1-sam@samdaly.ie
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agoDocumentation: fix two typos in latest update to the security report howto
Willy Tarreau [Sat, 4 Apr 2026 08:20:33 +0000 (10:20 +0200)] 
Documentation: fix two typos in latest update to the security report howto

In previous patch "Documentation: clarify the mandatory and desirable
info for security reports" I left two typos that I didn't detect in local
checks. One is "get_maintainers.pl" (no 's' in the script name), and the
other one is a missing closing quote after "Reported-by", which didn't
have effect here but I don't know if it can break rendering elsewhere
(e.g. on the public HTML page). Better fix it before it gets merged.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260404082033.5160-1-w@1wt.eu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agotools/nolibc: use makedev() in fstatat()
Thomas Weißschuh [Sat, 4 Apr 2026 08:08:23 +0000 (10:08 +0200)] 
tools/nolibc: use makedev() in fstatat()

fstatat() contains two open-coded copies of makedev() to handle minor
numbers >= 256. Now that the regular makedev() handles both large minor
and major numbers correctly use the common function.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260404-nolibc-makedev-v2-6-456a429bf60c@weissschuh.net
3 weeks agotools/nolibc: handle all major and minor numbers in makedev() and friends
Thomas Weißschuh [Sat, 4 Apr 2026 08:08:22 +0000 (10:08 +0200)] 
tools/nolibc: handle all major and minor numbers in makedev() and friends

Remove the limitation of only handling small major and minor numbers.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260404-nolibc-makedev-v2-5-456a429bf60c@weissschuh.net
3 weeks agotools/nolibc: make dev_t 64 bits wide
Thomas Weißschuh [Sat, 4 Apr 2026 08:08:21 +0000 (10:08 +0200)] 
tools/nolibc: make dev_t 64 bits wide

statx() returns both 32-bit minor and major numbers. For both of them to
fit into the 'dev_t' in 'struct stat', that needs to be 64 bits wide.

The other uses of 'dev_t' in nolibc are makedev() and friends and
mknod(). makedev() and friends are going to be adapted in an upcoming
commit and mknod() will silently truncate 'dev_t' to 'unsigned int' in
the kernel, similar to other libcs.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260404-nolibc-makedev-v2-4-456a429bf60c@weissschuh.net
3 weeks agotools/nolibc: move the logic of makedev() and friends into functions
Thomas Weißschuh [Sat, 4 Apr 2026 08:08:20 +0000 (10:08 +0200)] 
tools/nolibc: move the logic of makedev() and friends into functions

Functions make it easier to keep the input and output types straight and
avoid duplicate evaluations of their arguments.

Also these functions will become a bit more complex to handle full
64-bit 'dev_t' which is easier to read in a function.

Still stay compatible with code which expects these to be macros.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260404-nolibc-makedev-v2-3-456a429bf60c@weissschuh.net