]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
firmware: arm_scmi: Reset Rx buffer to max size during async commands
authorCristian Marussi <cristian.marussi@arm.com>
Tue, 1 Jun 2021 10:24:17 +0000 (11:24 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 20 Sep 2021 16:49:05 +0000 (18:49 +0200)
commit4a769bf0d73fcedead845f089854798417f2cd96
tree8a5de582f79d9b7963c4cb37c7f9f41999401cef
parent1fe718291d01584f46493c6f1cf10b19e3ae5cbb
firmware: arm_scmi: Reset Rx buffer to max size during async commands

BugLink: https://bugs.launchpad.net/bugs/1939440
[ Upstream commit 0cb7af474e0dbb2f500c67aa62b6db9fafa74de2 ]

During an async commands execution the Rx buffer length is at first set
to max_msg_sz when the synchronous part of the command is first sent.
However once the synchronous part completes the transport layer waits
for the delayed response which will be processed using the same xfer
descriptor initially allocated. Since synchronous response received at
the end of the xfer will shrink the Rx buffer length to the effective
payload response length, it needs to be reset again.

Raise the Rx buffer length again to max_msg_sz before fetching the
delayed response to ensure full response is read correctly from the
shared memory.

Link: https://lore.kernel.org/r/20210601102421.26581-2-cristian.marussi@arm.com
Fixes: 58ecdf03dbb9 ("firmware: arm_scmi: Add support for asynchronous commands and delayed response")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
[sudeep.holla: moved reset to scmi_handle_response as it could race with
               do_xfer_with_response]
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/firmware/arm_scmi/driver.c