linux-brain/drivers/firmware/arm_scmi
Cristian Marussi cc10a352e2 firmware: arm_scmi: Reset Rx buffer to max size during async commands
[ 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: 58ecdf03db ("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>
2021-07-20 16:10:52 +02:00
..
Makefile firmware: arm_scmi: Add RESET protocol in SCMI v2.0 2019-08-12 12:23:02 +01:00
base.c firmware: arm_scmi: Add missing Rx size re-initialisation 2020-11-05 11:43:12 +01:00
bus.c firmware: arm_scmi: Avoid double free in error flow 2020-01-09 10:20:03 +01:00
clock.c firmware: arm_scmi: Add missing Rx size re-initialisation 2020-11-05 11:43:12 +01:00
common.h firmware: arm_scmi: Add missing Rx size re-initialisation 2020-11-05 11:43:12 +01:00
driver.c firmware: arm_scmi: Reset Rx buffer to max size during async commands 2021-07-20 16:10:52 +02:00
perf.c firmware: arm_scmi: Add missing Rx size re-initialisation 2020-11-05 11:43:12 +01:00
power.c firmware: arm_scmi: Use {get,put}_unaligned_le{32,64} accessors 2019-08-12 12:23:01 +01:00
reset.c firmware: arm_scmi: Fix ARCH_COLD_RESET 2020-11-05 11:43:12 +01:00
scmi_pm_domain.c firmware: arm_scmi: Fix SCMI genpd domain probing 2020-08-19 08:15:55 +02:00
sensors.c firmware: arm_scmi: Add missing Rx size re-initialisation 2020-11-05 11:43:12 +01:00