Re: [PATCH 1/2] soc: qcom: rpmh-rsc: Update CMD_MSGID_LEN to 4 bytes for read request

From: Maulik Shah

Date: Fri Sep 11 2026 - 04:30:41 EST



On 10-09-2026 19:21, Bjorn Andersson wrote:
> On Thu, Sep 10, 2026 at 02:23:01PM +0530, Maulik Shah wrote:
[...]
>
> /* Convert all commands to RR when the request has wait_for_compl set */
> cmd_msgid |= msg->wait_for_compl ? CMD_MSGID_RESP_REQ : 0;
> - if (!msg->is_read)
> - cmd_msgid |= CMD_MSGID_WRITE;
> + if (!msg->is_read) {
> + cmd_msgid = CMD_MSGID_LEN | CMD_MSGID_WRITE;
> I know this follows the current code, but CMD_MSGID_LEN doesn't seem
> like a "fixed" part of this message anymore. It seems rather that
> there's a few bits here which denotes the CMD_MSGID_LEN and the value
> thereof is either 8 or 4.
>
> If this is the case, I'd find it cleaner to define CMD_MSGID_LEN_MASK
> and then just FIELD_PREP() to put a 4 or a 8 in the "length field" of
> the command.

Yes, updating v2 to use  FIELD_PREP().

>
>> + } else {
>> + if (drv->ver.major >= 4 && drv->ver.minor >= 5)
>> + cmd_msgid = CMD_MSGID_LEN_READ_v4_5;
> If I understand your commit message, this line says "on DRV 4.5 and
> higher length is 4 otherwise it's 8" - but there's no way anyone can
> read this line and come to that conclusion.
>
> In contrast, this would actually say that:
> cmd_msgid |= FIELD_PREP(CMD_MSGID_LEN, 4);

I will update to use FIELD_PREP.

>
>
> Also, is this really supposed to apply to DRV versions such as 5.5, but
> not 6.1?

I will update version check in v2.

Thanks,
Maulik