linux_dsm_epyc7002/drivers/soc
Stephan Gerhold 8434925cd2 soc: qcom: smsm: Fix missed interrupts if state changes while masked
[ Upstream commit e3d4571955050736bbf3eda0a9538a09d9fcfce8 ]

The SMSM driver detects interrupt edges by tracking the last state
it has seen (and has triggered the interrupt handler for). This works
fine, but only if the interrupt does not change state while masked.

For example, if an interrupt is unmasked while the state is HIGH,
the stored last_value for that interrupt might still be LOW. Then,
when the remote processor triggers smsm_intr() we assume that nothing
has changed, even though the state might have changed from HIGH to LOW.

Attempt to fix this by checking the current remote state before
unmasking an IRQ. Use atomic operations to avoid the interrupt handler
from interfering with the unmask function.

This fixes modem crashes in some edge cases with the BAM-DMUX driver.
Specifically, the BAM-DMUX interrupt handler is not called for the
HIGH -> LOW smsm state transition if the BAM-DMUX driver is loaded
(and therefore unmasks the interrupt) after the modem was already started:

qcom-q6v5-mss 4080000.remoteproc: fatal error received: a2_task.c:3188:
  Assert FALSE failed: A2 DL PER deadlock timer expired waiting for Apps ACK

Fixes: c97c4090ff ("soc: qcom: smsm: Add driver for Qualcomm SMSM")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20210712135703.324748-2-stephan@gerhold.net
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-05 19:11:28 +02:00
..
actions
amlogic
aspeed
atmel
bcm
dove
fsl
gemini
imx
ixp4xx soc: ixp4xx/qmgr: fix invalid __iomem access 2024-07-05 18:52:32 +02:00
kendryte
lantiq
mediatek soc / drm: mediatek: Move DDP component defines into mtk-mmsys.h 2024-07-05 18:55:45 +02:00
qcom soc: qcom: smsm: Fix missed interrupts if state changes while masked 2024-07-05 19:11:28 +02:00
realtek init: add dsm gpl source 2024-07-05 18:00:04 +02:00
renesas
rockchip soc: rockchip: ROCKCHIP_GRF should not default to y, unconditionally 2024-07-05 19:10:44 +02:00
samsung
sifive
sunxi
tegra
ti
ux500
versatile
xilinx
zte
Kconfig init: add dsm gpl source 2024-07-05 18:00:04 +02:00
Makefile init: add dsm gpl source 2024-07-05 18:00:04 +02:00