Re: [PATCH] firmware: arm_scmi: fix voltage description in failure cases
From: Cristian Marussi
Date: Fri Jul 26 2024 - 07:29:56 EST
On Thu, Jul 25, 2024 at 08:53:17AM +0200, Etienne Carriere wrote:
> Reset the reception buffer max size when a voltage domain description
Hi Etienne,
Good catch, thanks for this.
Maybe a Fixes: too ?
Other than that, LGTM.
Reviewed-by: Cristian Marussi <cristian.marussi@xxxxxxx>
Thanks,
Cristian
> request fails, for example when the voltage domain returns an access
> permission error (SCMI_ERR_ACCESS) unless what only a single 32bit
> word is read back for the remaining voltage description requests
> responses leading to invalid information. The side effect of this
> issue is that the voltage regulators registered from those remaining
> SCMI voltage domain were assigned a wrong regulator name.
>
> Signed-off-by: Etienne Carriere <etienne.carriere@xxxxxxxxxxx>
> ---
> drivers/firmware/arm_scmi/voltage.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/arm_scmi/voltage.c b/drivers/firmware/arm_scmi/voltage.c
> index 2175ffd6cef5..f1a7c04ae820 100644
> --- a/drivers/firmware/arm_scmi/voltage.c
> +++ b/drivers/firmware/arm_scmi/voltage.c
> @@ -229,8 +229,10 @@ static int scmi_voltage_descriptors_get(const struct scmi_protocol_handle *ph,
> /* Retrieve domain attributes at first ... */
> put_unaligned_le32(dom, td->tx.buf);
> /* Skip domain on comms error */
> - if (ph->xops->do_xfer(ph, td))
> + if (ph->xops->do_xfer(ph, td)) {
> + ph->xops->reset_rx_to_maxsz(ph, td);
> continue;
> + }
>
> v = vinfo->domains + dom;
> v->id = dom;
> --
> 2.25.1
>