linux-stable/drivers/firmware/arm_scmi
Cristian Marussi 583cc50f30 firmware: arm_scmi: Make tx_prepare time out eventually
[ Upstream commit 59172b212e ]

SCMI transports based on shared memory, at start of transmissions, have
to wait for the shared Tx channel area to be eventually freed by the
SCMI platform before accessing the channel. In fact the channel is owned
by the SCMI platform until marked as free by the platform itself and,
as such, cannot be used by the agent until relinquished.

As a consequence a badly misbehaving SCMI platform firmware could lock
the channel indefinitely and make the kernel side SCMI stack loop
forever waiting for such channel to be freed, possibly hanging the
whole boot sequence.

Add a timeout to the existent Tx waiting spin-loop so that, when the
system ends up in this situation, the SCMI stack can at least bail-out,
nosily warn the user, and abort the transmission.

Reported-by: YaxiongTian <iambestgod@outlook.com>
Suggested-by: YaxiongTian <iambestgod@outlook.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Etienne Carriere <etienne.carriere@linaro.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20221028140833.280091-3-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-26 09:27:19 +01:00
..
Kconfig firmware: arm_scmi: Add SCMI System Power Control driver 2022-07-04 14:28:42 +01:00
Makefile firmware: arm_scmi: Add SCMI v3.1 powercap protocol basic support 2022-07-04 14:28:42 +01:00
base.c firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary 2022-06-10 17:55:29 +01:00
bus.c firmware: arm_scmi: Cleanup the core driver removal callback 2022-11-26 09:27:19 +01:00
clock.c firmware: arm_scmi: Improve checks in the info_get operations 2022-08-22 18:01:45 +01:00
common.h firmware: arm_scmi: Make tx_prepare time out eventually 2022-11-26 09:27:19 +01:00
driver.c firmware: arm_scmi: Make tx_prepare time out eventually 2022-11-26 09:27:19 +01:00
mailbox.c firmware: arm_scmi: Make tx_prepare time out eventually 2022-11-26 09:27:19 +01:00
msg.c firmware: arm_scmi: Add message passing abstractions for transports 2021-08-05 10:23:23 +01:00
notify.c firmware: arm_scmi: Fix kernel doc warnings about return values 2021-07-13 11:39:54 +01:00
notify.h firmware: arm_scmi: Remove duplicate declaration of struct scmi_protocol_handle 2021-04-27 11:57:26 +01:00
optee.c firmware: arm_scmi: Make tx_prepare time out eventually 2022-11-26 09:27:19 +01:00
perf.c Power management updates for 5.20-rc1 2022-08-02 11:17:00 -07:00
power.c firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary 2022-06-10 17:55:29 +01:00
powercap.c firmware: arm_scmi: Use fast channel tracing 2022-07-04 14:28:43 +01:00
protocols.h firmware: arm_scmi: Generalize the fast channel support 2022-07-04 14:28:42 +01:00
reset.c firmware: arm_scmi: Fix the asynchronous reset requests 2022-08-23 12:21:37 +01:00
scmi_pm_domain.c MMC core: 2022-09-28 11:36:31 -07:00
scmi_power_control.c firmware: arm_scmi: Add SCMI System Power Control driver 2022-07-04 14:28:42 +01:00
sensors.c firmware: arm_scmi: Harden accesses to the sensor domains 2022-08-22 18:02:59 +01:00
shmem.c firmware: arm_scmi: Make tx_prepare time out eventually 2022-11-26 09:27:19 +01:00
smc.c firmware: arm_scmi: Make tx_prepare time out eventually 2022-11-26 09:27:19 +01:00
system.c firmware: arm_scmi: Add SCMI v3.1 System Power extensions 2022-07-04 14:28:42 +01:00
virtio.c firmware: arm_scmi: Fix deferred_tx_wq release on error paths 2022-11-10 18:17:30 +01:00
voltage.c firmware: arm_scmi: Fix incorrect error propagation in scmi_voltage_descriptors_get 2022-06-12 19:59:55 +01:00