Re: [RFC PATCH 1/3] firmware: arm_scmi: Ensure that the message-id supports fastchannel

From: Johan Hovold
Date: Thu Apr 03 2025 - 04:15:16 EST


On Tue, Apr 01, 2025 at 01:25:43PM +0100, Cristian Marussi wrote:
> From: Sibi Sankar <quic_sibis@xxxxxxxxxxx>
>
> Currently the perf and powercap protocol relies on the protocol domain
> attributes, which just ensures that one fastchannel per domain, before
> instantiating fastchannels for all possible message-ids. Fix this by
> ensuring that each message-id supports fastchannel before initialization.
>
> Logs:
> scmi: Failed to get FC for protocol 13 [MSG_ID:6 / RES_ID:0] - ret:-95. Using regular messaging.
> scmi: Failed to get FC for protocol 13 [MSG_ID:6 / RES_ID:1] - ret:-95. Using regular messaging.
> scmi: Failed to get FC for protocol 13 [MSG_ID:6 / RES_ID:2] - ret:-95. Using regular messaging.
>
> CC: stable@xxxxxxxxxxxxxxx
> Reported-by: Johan Hovold <johan+linaro@xxxxxxxxxx>
> Closes: https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@xxxxxxxxxxxxxxxxxxxx/
> Fixes: 6f9ea4dabd2d ("firmware: arm_scmi: Generalize the fast channel support")
> Signed-off-by: Sibi Sankar <quic_sibis@xxxxxxxxxxx>
> [Cristian: Modified the condition checked to establish support or not]
> Signed-off-by: Cristian Marussi <cristian.marussi@xxxxxxx>
> ---
> Since PROTOCOL_MESSAGE_ATTRIBUTES, used to check if message_id is supported,
> is a mandatory command, it cannot fail so we must bail-out NOT only if FC was
> not supported for that command but also if the query fails as a whole; so the
> condition checked for bailing out is modified to:
>
> if (ret || !MSG_SUPPORTS_FASTCHANNEL(attributes)) {
>
> Removed also Tested-by and Reviewed-by tags since I modified the logic.

This still works as intended:

Reviewed-by: Johan Hovold <johan+linaro@xxxxxxxxxx>
Tested-by: Johan Hovold <johan+linaro@xxxxxxxxxx>