diff options
author | Sudeep Holla <sudeep.holla@arm.com> | 2020-10-12 14:26:24 +0100 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2020-10-13 10:01:47 +0100 |
commit | 9724722fde8f9bbd2b87340f00b9300c9284001e (patch) | |
tree | 1cf10a48b0b9cfdb7757076a9775c6a0c3030d55 /drivers/firmware/arm_scmi/base.c | |
parent | 7adb2c8aaaa6a387af7140e57004beba2c04a4c6 (diff) | |
download | linux-9724722fde8f9bbd2b87340f00b9300c9284001e.tar.gz linux-9724722fde8f9bbd2b87340f00b9300c9284001e.tar.bz2 linux-9724722fde8f9bbd2b87340f00b9300c9284001e.zip |
firmware: arm_scmi: Add missing Rx size re-initialisation
Few commands provide the list of description partially and require
to be called consecutively until all the descriptors are fetched
completely. In such cases, we don't release the buffers and reuse
them for consecutive transmits.
However, currently we don't reset the Rx size which will be set as
per the response for the last transmit. This may result in incorrect
response size being interpretted as the firmware may repond with size
greater than the one set but we read only upto the size set by previous
response.
Let us reset the receive buffer size to max possible in such cases as
we don't know the exact size of the response.
Link: https://lore.kernel.org/r/20201012141746.32575-1-sudeep.holla@arm.com
Fixes: b6f20ff8bd94 ("firmware: arm_scmi: add common infrastructure and support for base protocol")
Reported-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware/arm_scmi/base.c')
-rw-r--r-- | drivers/firmware/arm_scmi/base.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/firmware/arm_scmi/base.c b/drivers/firmware/arm_scmi/base.c index 9853bd3c4d45..017e5d8bd869 100644 --- a/drivers/firmware/arm_scmi/base.c +++ b/drivers/firmware/arm_scmi/base.c @@ -197,6 +197,8 @@ static int scmi_base_implementation_list_get(const struct scmi_handle *handle, protocols_imp[tot_num_ret + loop] = *(list + loop); tot_num_ret += loop_num_ret; + + scmi_reset_rx_to_maxsz(handle, t); } while (loop_num_ret); scmi_xfer_put(handle, t); |