Commit 920c6af9 authored by Karunika Choo's avatar Karunika Choo Committed by Boris Brezillon
Browse files

drm/panthor: Fix NULL pointer dereference on panthor_fw_unplug



This patch removes the MCU halt and wait for halt procedures during
panthor_fw_unplug() as the MCU can be in a variety of states or the FW
may not even be loaded/initialized at all, the latter of which can lead
to a NULL pointer dereference.

It should be safe on unplug to just disable the MCU without waiting for
it to halt as it may not be able to.

Fixes: 51407254 ("drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs")
Suggested-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: default avatarKarunika Choo <karunika.choo@arm.com>
Reviewed-by: default avatarLiviu Dudau <liviu@dudau.co.uk>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Link: https://patch.msgid.link/20251215203312.1084182-1-karunika.choo@arm.com


Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
parent af586cc6
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -1261,10 +1261,6 @@ void panthor_fw_unplug(struct panthor_device *ptdev)
		if (ptdev->fw->irq.irq)
			panthor_job_irq_suspend(&ptdev->fw->irq);

		panthor_fw_halt_mcu(ptdev);
		if (!panthor_fw_wait_mcu_halted(ptdev))
			drm_warn(&ptdev->base, "Failed to halt MCU on unplug");

		panthor_fw_stop(ptdev);
	}