Re: [PATCH v3 1/4] soc: qcom: rpmh: Add support to read back resource settings
From: Maulik Shah (mkshah)
Date: Thu Apr 16 2026 - 00:26:18 EST
On 4/7/2026 6:26 PM, Konrad Dybcio wrote:
> On 4/7/26 6:43 AM, Kamal Wadhwa wrote:
>> From: Maulik Shah <maulik.shah@xxxxxxxxxxxxxxxx>
>>
>> All rpmh_*() APIs so far have supported placing votes for various resource
>> settings but the H/W also have option to read resource settings.
>>
>> Add new rpmh_read() API to allow clients to read back resource setting
>> from H/W. This will be useful for clients like regulators, which currently
>> don't have a way to know the settings applied during bootloader stage.
>>
>> Signed-off-by: Maulik Shah <maulik.shah@xxxxxxxxxxxxxxxx>
>> Signed-off-by: Kamal Wadhwa <kamal.wadhwa@xxxxxxxxxxxxxxxx>
>> ---
>
> [...]
>
>> @@ -453,6 +454,11 @@ static irqreturn_t tcs_tx_done(int irq, void *p)
>>
>> trace_rpmh_tx_done(drv, i, req);
>>
>> + if (req->is_read) {
>> + reg = drv->regs[RSC_DRV_CMD_RESP_DATA];
>> + req->cmds[0].data = read_tcs_reg(drv, reg, i);
>
> Does this break if we send a request that contains a read request
> at index != 0, or chain multiple read commands? (is that possible?)
>
> Or perhaps this is fine, because the only way to "legally" send a
> read command is rpmh_read() which sends a message with just a single
> read command?
Yes, the only way currently to send a read command is via rpmh_read()
with single read command (placed at index 0) and hence the read is from
same index.
>From H/W point it is possible to fill in the TCS command at index != 0
and trigger or chain of multiple read command (With something like
rpmh_read_batch() API if a use case ever comes up to read multiple resources).
Thanks,
Maulik
>
> Otherwise this patch looks good to me
>
> Konrad
>