OpenCloudOS-Kernel/drivers/mailbox
Stefan Wahren 10a58555e0 mailbox: bcm2835: Fix timeout during suspend mode
[ Upstream commit dc09f007caed3b2f6a3b6bd7e13777557ae22bfd ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-10-10 11:57:14 +02:00
..
Kconfig - mailbox api: allow direct registration to a channel 2023-05-07 10:17:33 -07:00
Makefile mailbox: mediatek: add support for adsp mailbox controller 2022-03-12 19:24:57 -06:00
apple-mailbox.c mailbox: apple: Implement poll_data() operation 2022-09-15 13:14:01 -05:00
arm_mhu.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
arm_mhu_db.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
arm_mhuv2.c mailbox: arm_mhuv2: Fix a bug for mhuv2_sender_interrupt 2024-02-05 20:14:31 +00:00
armada-37xx-rwtm-mailbox.c treewide: change my e-mail address, fix my name 2021-04-09 14:54:23 -07:00
bcm-flexrm-mailbox.c mailbox: bcm-ferxrm-mailbox: Use devm_platform_get_and_ioremap_resource() 2023-09-05 10:10:42 -05:00
bcm-pdc-mailbox.c mailbox: bcm-pdc: Fix some kernel-doc comments 2023-09-05 10:10:42 -05:00
bcm2835-mailbox.c mailbox: bcm2835: Fix timeout during suspend mode 2024-10-10 11:57:14 +02:00
hi3660-mailbox.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
hi6220-mailbox.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
imx-mailbox.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
mailbox-altera.c mailbox: altera: Make use of the helper function devm_platform_ioremap_resource() 2021-10-16 14:39:48 -05:00
mailbox-mpfs.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
mailbox-sti.c mailbox: sti: Make use of the helper function devm_platform_ioremap_resource() 2021-10-16 14:39:49 -05:00
mailbox-test.c mailbox: mailbox-test: Fix an error check in mbox_test_probe() 2023-09-05 10:10:42 -05:00
mailbox-xgene-slimpro.c mailbox: xgene-slimpro: Make use of the helper function devm_platform_ioremap_resource() 2021-10-16 14:39:49 -05:00
mailbox.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
mailbox.h mailbox: fix various typos in comments 2021-04-13 20:07:35 -05:00
mtk-adsp-mailbox.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
mtk-cmdq-mailbox.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
omap-mailbox.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
pcc.c mailbox: pcc: Use mbox_bind_client 2023-04-18 11:48:56 -05:00
pl320-ipc.c mailbox: fix various typos in comments 2021-04-13 20:07:35 -05:00
platform_mhu.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
qcom-apcs-ipc-mailbox.c mailbox: qcom-apcs-ipc: do not grow the of_device_id 2023-05-04 00:59:56 -05:00
qcom-ipcc.c mailbox: qcom-ipcc: fix incorrect num_chans counting 2023-09-05 10:11:01 -05:00
rockchip-mailbox.c mailbox: rockchip: fix a typo in module autoloading 2024-10-10 11:57:13 +02:00
sprd-mailbox.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
stm32-ipcc.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
sun6i-msgbox.c mailbox: sun6i: Make use of the helper function devm_platform_ioremap_resource() 2021-10-16 14:39:49 -05:00
tegra-hsp.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00
ti-msgmgr.c mailbox: ti-msgmgr: Use devm_platform_ioremap_resource_byname() 2023-09-05 10:10:42 -05:00
zynqmp-ipi-mailbox.c mailbox: Explicitly include correct DT includes 2023-09-05 10:10:58 -05:00