linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cristian Marussi <cristian.marussi@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm/scmi: fix base agent discover response
Date: Tue, 16 Nov 2021 18:27:58 +0000	[thread overview]
Message-ID: <20211116182758.GB56473@e120937-lin> (raw)
In-Reply-To: <20211116173255.19936-1-vincent.guittot@linaro.org>

On Tue, Nov 16, 2021 at 06:32:55PM +0100, Vincent Guittot wrote:
> According to scmi specification, the response of the discover agent request
> is made of:
> - int32 status
> - uint32 agent_id
> - uint8 name[16]
> 
> but the current implementation doesn't take into account the agent_id field
> and only allocates a rx buffer of SCMI_MAX_STR_SIZE length
> 

Hi Vincent,

> Allocate the correct length for rx buffer and copy the name from the
> correct offset in the response.
> 
> While no error were returned until v5.15, v5.16-rc1 fails with virtio_scmi
> transport channel:
> 
> [    1.093253] arm-scmi firmware:scmi0: SCMI Notifications - Core Enabled.
> [    1.114776] arm-scmi firmware:scmi0: SCMI Protocol v2.0 'Linaro:PMWG' Firmware version 0x2090000
> [    1.117544] scmi-virtio virtio0: tx:used len 28 is larger than in buflen 24
> 

Good catch...I was (still) not testing BASE_DISCOVER_AGENT in my virtio setup
given it's optional....

Once implemented the command I could reproduce and test you fix.

[    1.239629] arm-scmi firmware:scmi: SCMI Notifications - Core Enabled.
[    1.266401] arm-scmi firmware:scmi: SCMI Protocol v2.0 'EMU-SCMI-VM:userland' Firmware version 0xdeadbeef
[    1.280360] arm-scmi firmware:scmi: Found 3 protocol(s) 3 agent(s)
[    1.286304] arm-scmi firmware:scmi: Agent 0: AGENT_00
[    1.294115] arm-scmi firmware:scmi: Agent 1: AGENT_01
[    1.301062] arm-scmi firmware:scmi: Agent 2: AGENT_02

LGTM.

Maybe it's worth also a Fixes...

The earlier where this was introduced seems:

Fixes: b6f20ff8bd94 ("firmware: arm_scmi: add common infrastructure and support for base protocol")

and then it was carried on (:D) after heavily refactoring in:

Fixes: 8d3581c2526f ("firmware: arm_scmi: Port base protocol to new interface")

FWIW,

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>

Thanks,
Cristian


  reply	other threads:[~2021-11-16 18:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 17:32 [PATCH] arm/scmi: fix base agent discover response Vincent Guittot
2021-11-16 18:27 ` Cristian Marussi [this message]
2021-11-17  8:13   ` Vincent Guittot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211116182758.GB56473@e120937-lin \
    --to=cristian.marussi@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).