public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/1] Common csr_read_num() and csr_write_num() for RISC-V
@ 2026-02-04 15:53 Anup Patel
  2026-02-04 15:53 ` [PATCH v5 1/1] RISC-V: Add common csr_read_num() and csr_write_num() functions Anup Patel
  0 siblings, 1 reply; 6+ messages in thread
From: Anup Patel @ 2026-02-04 15:53 UTC (permalink / raw)
  To: Sunil V L, Rafael J . Wysocki
  Cc: Palmer Dabbelt, Paul Walmsley, Alexandre Ghiti, Len Brown,
	Atish Patra, Andrew Jones, Anup Patel, Will Deacon, Mark Rutland,
	linux-acpi, linux-riscv, linux-kernel, Anup Patel

Some of the RISC-V drivers (such as RISC-V PMU and ACPI CPPC) need to
access CSR based on CSR number discovered from somewhere. Add common
RISC-V csr_read_num() and csr_write_num() functions under arch/riscv
for such drivers.

These patches can be found in the riscv_csr_read_num_v5 branch at:
https://github.com/avpatel/linux.git

Changes since v4:
 - Rebased on Linux-6.19-rc6

Changes since v3:
 - Rebased on Linux-6.18-rc7
 - Updated commit decription of PATCH1 to reflect the fact that
   we are removing sanity checks on CSR number which are already
   taken care by csr_read_num() and csr_write_num().

Changes since v2:
 - Rebased on Linux-6.18-rc1
 - Added reviewed-by tags

Changes since v1:
 - Make "out_err" mandatory for csr_read_num() and csr_write_num()
   in PATCH2 as suggested by Sunil and Drew. This also helps further
   simplify csr_read_num() and csr_write_num().

Anup Patel (1):
  RISC-V: Add common csr_read_num() and csr_write_num() functions

 arch/riscv/include/asm/csr.h |   3 +
 arch/riscv/kernel/Makefile   |   1 +
 arch/riscv/kernel/csr.c      | 165 +++++++++++++++++++++++++++++++++++
 drivers/acpi/riscv/cppc.c    |  17 ++--
 drivers/perf/riscv_pmu.c     |  54 ++----------
 5 files changed, 184 insertions(+), 56 deletions(-)
 create mode 100644 arch/riscv/kernel/csr.c

-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-04-03 16:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-04 15:53 [PATCH v5 0/1] Common csr_read_num() and csr_write_num() for RISC-V Anup Patel
2026-02-04 15:53 ` [PATCH v5 1/1] RISC-V: Add common csr_read_num() and csr_write_num() functions Anup Patel
2026-04-03  8:25   ` Paul Walmsley
2026-04-03  8:43     ` Anup Patel
2026-04-03 15:56       ` Paul Walmsley
2026-04-03 16:47         ` Anup Patel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox