linux-stable/drivers
Cristian Marussi 437a310b22 firmware: arm_scmi: Check mailbox/SMT channel for consistency
On reception of a completion interrupt the shared memory area is accessed
to retrieve the message header at first and then, if the message sequence
number identifies a transaction which is still pending, the related
payload is fetched too.

When an SCMI command times out the channel ownership remains with the
platform until eventually a late reply is received and, as a consequence,
any further transmission attempt remains pending, waiting for the channel
to be relinquished by the platform.

Once that late reply is received the channel ownership is given back
to the agent and any pending request is then allowed to proceed and
overwrite the SMT area of the just delivered late reply; then the wait
for the reply to the new request starts.

It has been observed that the spurious IRQ related to the late reply can
be wrongly associated with the freshly enqueued request: when that happens
the SCMI stack in-flight lookup procedure is fooled by the fact that the
message header now present in the SMT area is related to the new pending
transaction, even though the real reply has still to arrive.

This race-condition on the A2P channel can be detected by looking at the
channel status bits: a genuine reply from the platform will have set the
channel free bit before triggering the completion IRQ.

Add a consistency check to validate such condition in the A2P ISR.

Reported-by: Xinglong Yang <xinglong.yang@cixtech.com>
Closes: https://lore.kernel.org/all/PUZPR06MB54981E6FA00D82BFDBB864FBF08DA@PUZPR06MB5498.apcprd06.prod.outlook.com/
Fixes: 5c8a47a5a9 ("firmware: arm_scmi: Make scmi core independent of the transport type")
Cc: stable@vger.kernel.org # 5.15+
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Xinglong Yang <xinglong.yang@cixtech.com>
Link: https://lore.kernel.org/r/20231220172112.763539-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:01:16 +00:00
..
accel
accessibility
acpi cxl for v6.8 2024-01-18 16:22:43 -08:00
amba
android Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
ata
atm
auxdisplay
base RTC for 6.8 2024-01-18 17:25:39 -08:00
bcma
block for-6.8/block-2024-01-18 2024-01-18 18:22:40 -08:00
bluetooth USB / Thunderbolt changes for 6.8-rc1 2024-01-18 11:43:55 -08:00
bus Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
cache
cdrom
cdx
char TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
clk clk: qcom: gcc-x1e80100: Replace of_device.h with explicit includes 2024-01-19 08:17:28 -06:00
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma dmaengine fixes for v6.8-rc1 2024-01-20 15:03:25 -08:00
dma-buf
dpll
edac Driver core changes for 6.8-rc1 2024-01-18 09:48:40 -08:00
eisa
extcon
firewire
firmware firmware: arm_scmi: Check mailbox/SMT channel for consistency 2024-01-22 10:01:16 +00:00
fpga Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
fsi
gnss TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
gpio gpio fixes for v6.8-rc1 2024-01-18 17:03:51 -08:00
gpu drm fixes for 6.8-rc1 2024-01-19 11:50:00 -08:00
greybus TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
hid
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
i3c
idle
iio TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
infiniband
input Input updates for 6.8 merge window: 2024-01-18 17:21:35 -08:00
interconnect Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
iommu iommufd for 6.8 2024-01-18 15:28:15 -08:00
ipack TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
irqchip
isdn
leds - New Drivers 2024-01-17 15:25:27 -08:00
macintosh
mailbox mediatek: add CMDQ support for mt8188 2024-01-17 15:39:32 -08:00
mcb
md for-6.8/block-2024-01-18 2024-01-18 18:22:40 -08:00
media media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) 2024-01-20 13:30:00 -08:00
memory IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
memstick
message
mfd TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
misc This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
mmc TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
most
mtd This pull request contains updates for UBI and UBIFS: 2024-01-17 10:27:13 -08:00
mux
net net: can: Use device_get_match_data() 2024-01-19 08:08:53 -06:00
nfc
ntb
nubus
nvdimm virtio: features, fixes 2024-01-18 16:44:03 -08:00
nvme for-6.8/block-2024-01-18 2024-01-18 18:22:40 -08:00
nvmem Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
of IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
opp
parisc
parport
pci cxl for v6.8 2024-01-18 16:22:43 -08:00
pcmcia
peci
perf
phy phy-for-6.8 2024-01-18 17:11:43 -08:00
pinctrl This is the main pin control pull request for the v6.8 kernel series. 2024-01-17 15:55:33 -08:00
platform USB / Thunderbolt changes for 6.8-rc1 2024-01-18 11:43:55 -08:00
pmdomain Driver core changes for 6.8-rc1 2024-01-18 09:48:40 -08:00
pnp More ACPI updates for 6.8-rc1 2024-01-17 14:37:40 -08:00
power power: supply: bq24190_charger: Fix "initializer element is not constant" error 2024-01-19 01:03:17 +01:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc rtc: nuvoton: Compatible with NCT3015Y-R and NCT3018Y-R 2024-01-18 01:05:33 +01:00
s390 s390 updates for 6.8 merge window part 2 2024-01-18 14:11:25 -08:00
sbus
scsi SCSI misc on 20240120 2024-01-20 09:42:32 -08:00
sh
siox
slimbus
soc Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
soundwire soundwire updates for 6.7 2024-01-18 17:08:31 -08:00
spi spi: Fix for v6.8 2024-01-19 12:50:09 -08:00
spmi
ssb
staging This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
target SCSI misc on 20240120 2024-01-20 09:42:32 -08:00
tc
tee
thermal thermal: loongson2: Replace of_device.h with explicit includes 2024-01-19 08:08:53 -06:00
thunderbolt USB / Thunderbolt changes for 6.8-rc1 2024-01-18 11:43:55 -08:00
tty RISC-V Patches for the 6.8 Merge Window, Part 4 2024-01-20 11:06:04 -08:00
ufs SCSI misc on 20240120 2024-01-20 09:42:32 -08:00
uio
usb USB / Thunderbolt changes for 6.8-rc1 2024-01-18 11:43:55 -08:00
vdpa virtio: features, fixes 2024-01-18 16:44:03 -08:00
vfio VFIO updates for v6.8-rc1 2024-01-18 15:57:25 -08:00
vhost virtio: features, fixes 2024-01-18 16:44:03 -08:00
video This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
virt Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
virtio virtio: features, fixes 2024-01-18 16:44:03 -08:00
w1
watchdog
xen xen: branch for v6.8-rc1 2024-01-17 13:41:38 -08:00
zorro
Kconfig
Makefile