public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Walmsley <pjw@kernel.org>
To: Anup Patel <anup.patel@oss.qualcomm.com>
Cc: Sunil V L <sunilvl@oss.qualcomm.com>,
	 "Rafael J . Wysocki" <rafael@kernel.org>,
	 Mark Rutland <mark.rutland@arm.com>,
	Anup Patel <apatel@ventanamicro.com>,
	 Alexandre Ghiti <alex@ghiti.fr>,
	Atish Patra <atish.patra@linux.dev>,
	 Anup Patel <anup@brainfault.org>,
	Atish Patra <atishp@rivosinc.com>,
	 linux-kernel@vger.kernel.org,
	Andrew Jones <andrew.jones@oss.qualcomm.com>,
	 linux-acpi@vger.kernel.org, Palmer Dabbelt <palmer@dabbelt.com>,
	 Paul Walmsley <paul.walmsley@sifive.com>,
	 Nutty Liu <nutty.liu@hotmail.com>,
	linux-riscv@lists.infradead.org,
	 Andrew Jones <ajones@ventanamicro.com>,
	Will Deacon <will@kernel.org>,  Len Brown <lenb@kernel.org>
Subject: Re: [PATCH v5 1/1] RISC-V: Add common csr_read_num() and csr_write_num() functions
Date: Fri, 3 Apr 2026 02:25:12 -0600 (MDT)	[thread overview]
Message-ID: <603b0a16-4965-2689-d3ea-3f9db0cc49aa@kernel.org> (raw)
In-Reply-To: <20260204155309.763597-2-anup.patel@oss.qualcomm.com>

Hi Anup,

On Wed, 4 Feb 2026, Anup Patel wrote:

> From: Anup Patel <apatel@ventanamicro.com>
> 
> In RISC-V, there is no CSR read/write instruction which takes CSR
> number via register so add common csr_read_num() and csr_write_num()
> functions which allow accessing certain CSRs by passing CSR number
> as parameter. These common functions will be first used by the
> ACPI CPPC driver and RISC-V PMU driver.
> 
> Also, the RISC-V ACPI FFH specification allows arbitrary CSR number
> as CPPC register and the RISC-V SBI specification allows arbitrary
> CSR number as PMU hardware counter. This means ACPI CPPC driver and
> RISC-V PMU driver no longer need to do sanity checks on CSR number
> which are now done by the common csr_read_num() and csr_write_num()
> functions.

I recall that when we discussed this patch on a call a few months ago, it 
was brought up that it seemed useful to restrict which CSRs could be read 
or written at runtime, on a per-vendor basis.  That way, the FFH interface 
couldn't be used to read or write custom CSRs that had nothing to do with 
CPPC or PMU functions. 

Are you still planning to implement that change?


- Paul

  reply	other threads:[~2026-04-03  8:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-04-03  8:43     ` Anup Patel
2026-04-03 15:56       ` Paul Walmsley
2026-04-03 16:47         ` Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=603b0a16-4965-2689-d3ea-3f9db0cc49aa@kernel.org \
    --to=pjw@kernel.org \
    --cc=ajones@ventanamicro.com \
    --cc=alex@ghiti.fr \
    --cc=andrew.jones@oss.qualcomm.com \
    --cc=anup.patel@oss.qualcomm.com \
    --cc=anup@brainfault.org \
    --cc=apatel@ventanamicro.com \
    --cc=atish.patra@linux.dev \
    --cc=atishp@rivosinc.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=nutty.liu@hotmail.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rafael@kernel.org \
    --cc=sunilvl@oss.qualcomm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox