kernel_optimize_test/drivers/mailbox
Björn Ardö bb2220e067 mailbox: forward the hrtimer if not queued and under a lock
[ Upstream commit bca1a1004615efe141fd78f360ecc48c60bc4ad5 ]

This reverts commit c7dacf5b0f,
"mailbox: avoid timer start from callback"

The previous commit was reverted since it lead to a race that
caused the hrtimer to not be started at all. The check for
hrtimer_active() in msg_submit() will return true if the
callback function txdone_hrtimer() is currently running. This
function could return HRTIMER_NORESTART and then the timer
will not be restarted, and also msg_submit() will not start
the timer. This will lead to a message actually being submitted
but no timer will start to check for its compleation.

The original fix that added checking hrtimer_active() was added to
avoid a warning with hrtimer_forward. Looking in the kernel
another solution to avoid this warning is to check hrtimer_is_queued()
before calling hrtimer_forward_now() instead. This however requires a
lock so the timer is not started by msg_submit() inbetween this check
and the hrtimer_forward() call.

Fixes: c7dacf5b0f ("mailbox: avoid timer start from callback")
Signed-off-by: Björn Ardö <bjorn.ardo@axis.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:21:18 +02:00
..
arm_mhu_db.c
arm_mhu.c
armada-37xx-rwtm-mailbox.c
bcm-flexrm-mailbox.c
bcm-pdc-mailbox.c
bcm2835-mailbox.c
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
Kconfig
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
Makefile
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
pl320-ipc.c
platform_mhu.c
qcom-apcs-ipc-mailbox.c mailbox: qcom: Use PLATFORM_DEVID_AUTO to register platform device 2021-07-14 16:56:01 +02:00
qcom-ipcc.c mailbox: qcom-ipcc: Fix IPCC mbox channel exhaustion 2021-07-14 16:56:53 +02: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