firmware: arm_scmi: Add missing Rx size re-initialisation
authorSudeep Holla <sudeep.holla@arm.com>
Mon, 12 Oct 2020 13:26:24 +0000 (14:26 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Tue, 13 Oct 2020 09:01:47 +0000 (10:01 +0100)
commit9724722fde8f9bbd2b87340f00b9300c9284001e
tree1cf10a48b0b9cfdb7757076a9775c6a0c3030d55
parent7adb2c8aaaa6a387af7140e57004beba2c04a4c6
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>
drivers/firmware/arm_scmi/base.c
drivers/firmware/arm_scmi/clock.c
drivers/firmware/arm_scmi/common.h
drivers/firmware/arm_scmi/driver.c
drivers/firmware/arm_scmi/perf.c
drivers/firmware/arm_scmi/sensors.c