Re: [PATCH 1/4] soc: qcom: aoss: Move length requirements from caller

From: Bjorn Andersson
Date: Mon Jul 31 2023 - 19:10:27 EST


On Mon, Jul 31, 2023 at 02:29:44PM -0700, Chris Lew wrote:
>
>
> On 7/30/2023 9:10 PM, Bjorn Andersson wrote:
> > diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c
> > /* The message RAM only implements 32-bit accesses */
> > __iowrite32_copy(qmp->msgram + qmp->offset + sizeof(u32),
> > - data, len / sizeof(u32));
> > - writel(len, qmp->msgram + qmp->offset);
> > + buf, sizeof(buf) / sizeof(u32));
> > + writel(sizeof(buf), qmp->msgram + qmp->offset);
>
> Looks like we are telling the firmware the packet size will always be
> QMP_MSG_LEN?
>
> This should be ok but might be a problem when debugging. The AOSS firmware
> only logs size of the message instead of the full string because of memory
> constraints.
>

Until now ipa_power_retention() has been passing 36 here, everyone else
64, so it is ok.

> We would normally match the firmware and host logs based on size, but won't
> be able to differentiate this way with a fixed size.

I don't mind us changing it to ALIGN(len, 4), but as that would change
the current behavior I'd like to do so in a subsequent patch.

Speaking of behavior, is 64 the max message size? We inherited the 64
from the initial downstream implementation, but qmp->size is quite a bit
bigger.

Regards,
Bjorn