umber-kernel/drivers/interconnect
Nicolas Frattaroli 2f0d9a5d55 interconnect: mediatek: Aggregate bandwidth with saturating add
[ Upstream commit 6ffd02b82243d9907b5f5d2c7a2fc6a62669eece ]

By using a regular non-overflow-checking add, the MediaTek icc-emi
driver will happy wrap at U32_MAX + 1 to 0. As it's common for the
interconnect core to fill in INT_MAX values, this is not a hypothetical
situation, but something that actually happens in regular use. This
would be pretty disasterous if anything used this driver.

Replace the addition with an overflow-checked addition from overflow.h,
and saturate to U32_MAX if an overflow is detected.

Fixes: b45293799f ("interconnect: mediatek: Add MediaTek MT8183/8195 EMI Interconnect driver")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Link: https://lore.kernel.org/r/20251124-mt8196-dvfsrc-v2-13-d9c1334db9f3@collabora.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-02-26 14:59:32 -08:00
..
imx interconnect: Switch back to struct platform_driver::remove() 2024-10-22 12:34:18 +03:00
mediatek interconnect: mediatek: Aggregate bandwidth with saturating add 2026-02-26 14:59:32 -08:00
qcom interconnect: qcom: sdx75: Drop QPIC interconnect and BCM nodes 2026-01-02 12:57:30 +01:00
samsung interconnect: exynos: handle node name allocation failure 2025-06-23 17:59:09 +03:00
Kconfig
Makefile
bulk.c
core.c interconnect: core: Use device_match_of_node() 2025-09-12 13:53:12 +03:00
debugfs-client.c interconnect: debugfs: initialize src_node and dst_node to empty strings 2026-01-30 10:32:16 +01:00
icc-clk.c interconnect: icc-clk: destroy nodes in case of memory allocation failures 2025-06-26 19:18:01 +03:00
internal.h
trace.h