mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Navya Malempati <navya.malempati@oss.qualcomm.com>
To: Maulik Shah <maulik.shah@oss.qualcomm.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] soc: qcom: cmd-db: add reverse address-to-name lookup
Date: Thu, 6 Aug 2026 12:15:43 +0530	[thread overview]
Message-ID: <1e032c84-cee8-45ef-9cf3-7654de85778a@oss.qualcomm.com> (raw)
In-Reply-To: <20260717-rpmh-timeout-debug-v1-v2-2-81ade4fcdb49@oss.qualcomm.com>



On 7/17/2026 1:19 PM, Maulik Shah wrote:
> RPMh resource addresses are opaque 32-bit values. While the slave ID
> in bits [19:16] identifies the accelerator type (ARC/VRM/BCM), the
> lower bits encode a resource index that is only meaningful when mapped
> back to the human-readable resource name stored in the command DB
> (e.g. 0x30000 -> cx.lvl).
> 
> Add cmd_db_read_name() to perform this reverse lookup by iterating
> the command DB entries and matching on address. Unlike other exported
> cmd-db APIs which go through cmd_db_get_header() (which calls
> cmd_db_ready() internally), this function iterates cmd_db_header
> directly for address matching, so it calls cmd_db_ready() itself.
> 
> For VRM resources,
> which have up to 4 contiguous 4-byte-aligned addresses per resource,
> the match uses VRM_ADDR() on bits [19:4] so that any sub-address
> (enable, voltage, mode, headroom) resolves to the same resource name.
> 
> Also export CMD_DB_ID_SIZE so callers can size their name buffers
> correctly without open-coding the magic constant 8.
> 
> Assisted-by: Claude:claude-sonnet-4-5
> Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>

Reviewed-by: Navya Malempati <navya.malempati@oss.qualcomm.com>

Thanks,
Navya

  reply	other threads:[~2026-08-06  6:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17  7:49 [PATCH v2 0/3] Output debug information from RSC Maulik Shah
2026-07-17  7:49 ` [PATCH v2 1/3] soc: qcom: cmd-db: export RPMh accelerator type string helper Maulik Shah
2026-08-06  5:57   ` Navya Malempati
2026-08-06  9:50   ` Dmitry Baryshkov
2026-07-17  7:49 ` [PATCH v2 2/3] soc: qcom: cmd-db: add reverse address-to-name lookup Maulik Shah
2026-08-06  6:45   ` Navya Malempati [this message]
2026-08-06  9:50   ` Dmitry Baryshkov
2026-07-17  7:49 ` [PATCH v2 3/3] soc: qcom: rpmh-rsc: Output debug information from RSC Maulik Shah
2026-08-06  6:47   ` Navya Malempati

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=1e032c84-cee8-45ef-9cf3-7654de85778a@oss.qualcomm.com \
    --to=navya.malempati@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maulik.shah@oss.qualcomm.com \
    /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

all inboxes | Powered by JetHome®