drm/panthor: Make sure we handle 'unknown group state' case properly
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 2 May 2024 15:52:48 +0000 (17:52 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Thu, 2 May 2024 16:42:13 +0000 (18:42 +0200)
commit8bdbd8b5580b46c8cae365567f5bf6cc956e6512
treefae890a4044487ac5e6401139587265ffc1859cd
parent08f441360f760151e742768b379fede54b0cbf6c
drm/panthor: Make sure we handle 'unknown group state' case properly

When we check for state values returned by the FW, we only cover part of
the 0:7 range. Make sure we catch FW inconsistencies by adding a default
to the switch statement, and flagging the group state as unknown in that
case.

When an unknown state is detected, we trigger a reset, and consider the
group as unusable after that point, to prevent the potential corruption
from creeping in other places if we continue executing stuff on this
context.

v2:
- Add Steve's R-b
- Fix commit message

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/dri-devel/3b7fd2f2-679e-440c-81cd-42fc2573b515@moroto.mountain/T/#u
Suggested-by: Steven Price <steven.price@arm.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240502155248.1430582-1-boris.brezillon@collabora.com
drivers/gpu/drm/panthor/panthor_sched.c