anolis-cloud-kernel/drivers/mailbox
Stefan Wahren 5391d621d1 mailbox: bcm2835: Fix timeout during suspend mode
ANBZ: #12641

commit dc09f007ca upstream.

During noirq suspend phase the Raspberry Pi power driver suffer of
firmware property timeouts. The reason is that the IRQ of the underlying
BCM2835 mailbox is disabled and rpi_firmware_property_list() will always
run into a timeout [1].

Since the VideoCore side isn't consider as a wakeup source, set the
IRQF_NO_SUSPEND flag for the mailbox IRQ in order to keep it enabled
during suspend-resume cycle.

[1]
PM: late suspend of devices complete after 1.754 msecs
WARNING: CPU: 0 PID: 438 at drivers/firmware/raspberrypi.c:128
 rpi_firmware_property_list+0x204/0x22c
Firmware transaction 0x00028001 timeout
Modules linked in:
CPU: 0 PID: 438 Comm: bash Tainted: G         C         6.9.3-dirty #17
Hardware name: BCM2835
Call trace:
unwind_backtrace from show_stack+0x18/0x1c
show_stack from dump_stack_lvl+0x34/0x44
dump_stack_lvl from __warn+0x88/0xec
__warn from warn_slowpath_fmt+0x7c/0xb0
warn_slowpath_fmt from rpi_firmware_property_list+0x204/0x22c
rpi_firmware_property_list from rpi_firmware_property+0x68/0x8c
rpi_firmware_property from rpi_firmware_set_power+0x54/0xc0
rpi_firmware_set_power from _genpd_power_off+0xe4/0x148
_genpd_power_off from genpd_sync_power_off+0x7c/0x11c
genpd_sync_power_off from genpd_finish_suspend+0xcc/0xe0
genpd_finish_suspend from dpm_run_callback+0x78/0xd0
dpm_run_callback from device_suspend_noirq+0xc0/0x238
device_suspend_noirq from dpm_suspend_noirq+0xb0/0x168
dpm_suspend_noirq from suspend_devices_and_enter+0x1b8/0x5ac
suspend_devices_and_enter from pm_suspend+0x254/0x2e4
pm_suspend from state_store+0xa8/0xd4
state_store from kernfs_fop_write_iter+0x154/0x1a0
kernfs_fop_write_iter from vfs_write+0x12c/0x184
vfs_write from ksys_write+0x78/0xc0
ksys_write from ret_fast_syscall+0x0/0x54
Exception stack(0xcc93dfa8 to 0xcc93dff0)
[...]
PM: noirq suspend of devices complete after 3095.584 msecs

Link: https://github.com/raspberrypi/firmware/issues/1894
Fixes: 0bae6af6d7 ("mailbox: Enable BCM2835 mailbox support")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>

Fixes: CVE-2024-49963
Signed-off-by: Xiao Long <xiaolong@openanolis.org>
Signed-off-by: 362994 <362994>
Reviewed-by: Guixin Liu <kanie@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/4287
2025-03-19 06:34:16 +00:00
..
Kconfig mailbox: arm_mhuv2: Add driver 2024-03-01 06:26:34 +00:00
Makefile mailbox: arm_mhuv2: Add driver 2024-03-01 06:26:34 +00:00
arm_mhu.c
arm_mhu_db.c mailbox: correct kerneldoc 2024-03-01 06:26:34 +00:00
arm_mhuv2.c mailbox: arm_mhuv2: Fix return value check in mhuv2_probe() 2024-03-01 06:26:34 +00:00
armada-37xx-rwtm-mailbox.c
bcm-flexrm-mailbox.c
bcm-pdc-mailbox.c
bcm2835-mailbox.c mailbox: bcm2835: Fix timeout during suspend mode 2025-03-19 06:34:16 +00:00
hi3660-mailbox.c
hi6220-mailbox.c
imx-mailbox.c mailbox: imx: fix wakeup failure from freeze mode 2022-04-08 14:40:41 +02:00
light-mailbox-client.c anolis: riscv: mailbox: add T-HEAD Light support 2023-02-26 01:51:05 +00:00
light-mailbox.c anolis: riscv: mailbox: add T-HEAD Light support 2023-02-26 01:51:05 +00:00
mailbox-altera.c
mailbox-sti.c
mailbox-test.c
mailbox-xgene-slimpro.c
mailbox.c mailbox: forward the hrtimer if not queued and under a lock 2022-06-09 10:21:18 +02:00
mailbox.h
mtk-cmdq-mailbox.c soc: mediatek: cmdq: add address shift in jump 2021-09-18 13:40:16 +02:00
omap-mailbox.c
pcc.c mailbox: pcc: Fix an invalid-load caught by the address sanitizer 2022-09-27 10:04:11 +00:00
phytium_mailbox.c anolis: mailbox: mailbox driver support for Phytium desktop and embedded CPUs 2023-10-08 02:10:52 +00:00
pl320-ipc.c
platform_mhu.c
qcom-apcs-ipc-mailbox.c
qcom-ipcc.c mailbox: correct kerneldoc 2024-03-01 06:26:34 +00:00
rockchip-mailbox.c
sprd-mailbox.c
stm32-ipcc.c
sun6i-msgbox.c
tegra-hsp.c mailbox: tegra-hsp: Flush whole channel 2022-04-08 14:39:55 +02:00
ti-msgmgr.c
zynqmp-ipi-mailbox.c