[PATCH v5 6/8] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs

Karunika Choo posted 8 patches 2 months, 2 weeks ago
[PATCH v5 6/8] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
Posted by Karunika Choo 2 months, 2 weeks ago
Add support for the GLB_REQ.STATE field introduced in CSF v4.1+, which
replaces the HALT bit to provide finer control over the MCU state. This
change implements basic handling for transitioning the MCU between
ACTIVE and HALT states on Mali-G1 GPUs.

The update introduces new helpers to issue the state change requests,
poll for MCU halt completion, and restore the MCU to an active state
after halting.

Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Karunika Choo <karunika.choo@arm.com>
---
v4:
 * Picked up R-b from Steve.
v3:
 * Fixed missed CSF_IFACE_VERSION check with pathor_fw_has_glb_state().
v2:
 * Reduced MCU_HALT_TIMEOUT_US to 1 second.
 * Wrap the CSG_IFACE_VERSION checks for v4.1.0 with
   panthor_fw_has_glb_state().
 * Removed use of undefined panthor_fw_csf_version() MACRO.
---
 drivers/gpu/drm/panthor/panthor_fw.c | 89 +++++++++++++++++++++++-----
 drivers/gpu/drm/panthor/panthor_fw.h |  7 +++
 2 files changed, 80 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
index 027c4529f3f2..6b89821ff1dd 100644
--- a/drivers/gpu/drm/panthor/panthor_fw.c
+++ b/drivers/gpu/drm/panthor/panthor_fw.c
@@ -34,6 +34,7 @@
 #define PROGRESS_TIMEOUT_SCALE_SHIFT		10
 #define IDLE_HYSTERESIS_US			800
 #define PWROFF_HYSTERESIS_US			10000
+#define MCU_HALT_TIMEOUT_US			(1ULL * USEC_PER_SEC)

 /**
  * struct panthor_fw_binary_hdr - Firmware binary header.
@@ -318,6 +319,13 @@ panthor_fw_get_cs_iface(struct panthor_device *ptdev, u32 csg_slot, u32 cs_slot)
 	return &ptdev->fw->iface.streams[csg_slot][cs_slot];
 }

+static bool panthor_fw_has_glb_state(struct panthor_device *ptdev)
+{
+	struct panthor_fw_global_iface *glb_iface = panthor_fw_get_glb_iface(ptdev);
+
+	return glb_iface->control->version >= CSF_IFACE_VERSION(4, 1, 0);
+}
+
 /**
  * panthor_fw_conv_timeout() - Convert a timeout into a cycle-count
  * @ptdev: Device.
@@ -997,6 +1005,9 @@ static void panthor_fw_init_global_iface(struct panthor_device *ptdev)
 					 GLB_IDLE_EN |
 					 GLB_IDLE;

+	if (panthor_fw_has_glb_state(ptdev))
+		glb_iface->input->ack_irq_mask |= GLB_STATE_MASK;
+
 	panthor_fw_update_reqs(glb_iface, req, GLB_IDLE_EN, GLB_IDLE_EN);
 	panthor_fw_toggle_reqs(glb_iface, req, ack,
 			       GLB_CFG_ALLOC_EN |
@@ -1070,6 +1081,54 @@ static void panthor_fw_stop(struct panthor_device *ptdev)
 		drm_err(&ptdev->base, "Failed to stop MCU");
 }

+static bool panthor_fw_mcu_halted(struct panthor_device *ptdev)
+{
+	struct panthor_fw_global_iface *glb_iface = panthor_fw_get_glb_iface(ptdev);
+	bool halted;
+
+	halted = gpu_read(ptdev, MCU_STATUS) == MCU_STATUS_HALT;
+
+	if (panthor_fw_has_glb_state(ptdev))
+		halted &= (GLB_STATE_GET(glb_iface->output->ack) == GLB_STATE_HALT);
+
+	return halted;
+}
+
+static void panthor_fw_halt_mcu(struct panthor_device *ptdev)
+{
+	struct panthor_fw_global_iface *glb_iface = panthor_fw_get_glb_iface(ptdev);
+
+	if (panthor_fw_has_glb_state(ptdev))
+		panthor_fw_update_reqs(glb_iface, req, GLB_STATE(GLB_STATE_HALT), GLB_STATE_MASK);
+	else
+		panthor_fw_update_reqs(glb_iface, req, GLB_HALT, GLB_HALT);
+
+	gpu_write(ptdev, CSF_DOORBELL(CSF_GLB_DOORBELL_ID), 1);
+}
+
+static bool panthor_fw_wait_mcu_halted(struct panthor_device *ptdev)
+{
+	bool halted = false;
+
+	if (read_poll_timeout_atomic(panthor_fw_mcu_halted, halted, halted, 10,
+				     MCU_HALT_TIMEOUT_US, 0, ptdev)) {
+		drm_warn(&ptdev->base, "Timed out waiting for MCU to halt");
+		return false;
+	}
+
+	return true;
+}
+
+static void panthor_fw_mcu_set_active(struct panthor_device *ptdev)
+{
+	struct panthor_fw_global_iface *glb_iface = panthor_fw_get_glb_iface(ptdev);
+
+	if (panthor_fw_has_glb_state(ptdev))
+		panthor_fw_update_reqs(glb_iface, req, GLB_STATE(GLB_STATE_ACTIVE), GLB_STATE_MASK);
+	else
+		panthor_fw_update_reqs(glb_iface, req, 0, GLB_HALT);
+}
+
 /**
  * panthor_fw_pre_reset() - Call before a reset.
  * @ptdev: Device.
@@ -1086,19 +1145,13 @@ void panthor_fw_pre_reset(struct panthor_device *ptdev, bool on_hang)
 	ptdev->reset.fast = false;

 	if (!on_hang) {
-		struct panthor_fw_global_iface *glb_iface = panthor_fw_get_glb_iface(ptdev);
-		u32 status;
-
-		panthor_fw_update_reqs(glb_iface, req, GLB_HALT, GLB_HALT);
-		gpu_write(ptdev, CSF_DOORBELL(CSF_GLB_DOORBELL_ID), 1);
-		if (!gpu_read_poll_timeout(ptdev, MCU_STATUS, status,
-					   status == MCU_STATUS_HALT, 10,
-					   100000)) {
-			ptdev->reset.fast = true;
-		} else {
+		panthor_fw_halt_mcu(ptdev);
+		if (!panthor_fw_wait_mcu_halted(ptdev))
 			drm_warn(&ptdev->base, "Failed to cleanly suspend MCU");
-		}
+		else
+			ptdev->reset.fast = true;
 	}
+	panthor_fw_stop(ptdev);

 	panthor_job_irq_suspend(&ptdev->fw->irq);
 	panthor_fw_stop(ptdev);
@@ -1127,14 +1180,14 @@ int panthor_fw_post_reset(struct panthor_device *ptdev)
 		 */
 		panthor_reload_fw_sections(ptdev, true);
 	} else {
-		/* The FW detects 0 -> 1 transitions. Make sure we reset
-		 * the HALT bit before the FW is rebooted.
+		/*
+		 * If the FW was previously successfully halted in the pre-reset
+		 * operation, we need to transition it to active again before
+		 * the FW is rebooted.
 		 * This is not needed on a slow reset because FW sections are
 		 * re-initialized.
 		 */
-		struct panthor_fw_global_iface *glb_iface = panthor_fw_get_glb_iface(ptdev);
-
-		panthor_fw_update_reqs(glb_iface, req, 0, GLB_HALT);
+		panthor_fw_mcu_set_active(ptdev);
 	}

 	ret = panthor_fw_start(ptdev);
@@ -1172,6 +1225,10 @@ 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);
 	}

diff --git a/drivers/gpu/drm/panthor/panthor_fw.h b/drivers/gpu/drm/panthor/panthor_fw.h
index 6598d96c6d2a..a19ed48b2d0b 100644
--- a/drivers/gpu/drm/panthor/panthor_fw.h
+++ b/drivers/gpu/drm/panthor/panthor_fw.h
@@ -214,6 +214,13 @@ struct panthor_fw_global_input_iface {
 #define GLB_FWCFG_UPDATE			BIT(9)
 #define GLB_IDLE_EN				BIT(10)
 #define GLB_SLEEP				BIT(12)
+#define GLB_STATE_MASK				GENMASK(14, 12)
+#define   GLB_STATE_ACTIVE			0
+#define   GLB_STATE_HALT			1
+#define   GLB_STATE_SLEEP			2
+#define   GLB_STATE_SUSPEND			3
+#define   GLB_STATE(x)				(((x) << 12) & GLB_STATE_MASK)
+#define   GLB_STATE_GET(x)			(((x) & GLB_STATE_MASK) >> 12)
 #define GLB_INACTIVE_COMPUTE			BIT(20)
 #define GLB_INACTIVE_FRAGMENT			BIT(21)
 #define GLB_INACTIVE_TILER			BIT(22)
--
2.49.0
Re: [PATCH v5 6/8] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
Posted by Aishwarya 1 month, 3 weeks ago
Hi Karunika,

Booting v6.19-rc1 on rk3588-rock-5b succeeds, but the kernel log shows a
panthor firmware load failure followed by a NULL pointer dereference in
panthor_fw_halt_mcu() during probe. The driver fails to load
arm/mali/arch10.8/mali_csffw.bin with -ENOENT.

A git bisect identified the first bad commit as:

51407254986501b19681d55531963f1ea58e89cd
drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs


Failure log (v6.19-rc1):

<4>[   16.915783] panthor fb000000.gpu: Direct firmware load for arm/mali/arch10.8/mali_csffw.bin failed with error -2
<3>[   16.916754] panthor fb000000.gpu: [drm] *ERROR* Failed to load firmware image 'mali_csffw.bin'
<1>[   16.917542] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
<1>[   16.918329] Mem abort info:
<1>[   16.918598]   ESR = 0x0000000096000004
<1>[   16.918949]   EC = 0x25: DABT (current EL), IL = 32 bits
<1>[   16.919436]   SET = 0, FnV = 0
<1>[   16.919742]   EA = 0, S1PTW = 0
<1>[   16.920041]   FSC = 0x04: level 0 translation fault
<1>[   16.920489] Data abort info:
<1>[   16.920766]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
<1>[   16.921269]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
<1>[   16.921272]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
<1>[   16.921275] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000117ca8000
<1>[   16.922802] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
<0>[   16.923423] Internal error: Oops: 0000000096000004 [#1]  SMP
[[0;32m  OK  [0m] Started [0;1;39mgetty@tty1.service[0m - Ge<4>[   16.923941] 
Modules linked in: pci_endpoint_test snd_soc_audio_graph_card
snd_soc_simple_card_utils rockchipdrm snd_soc_core snd_compress panthor(+)
snd_pcm_dmaengine drm_gpuvm drm_exec dw_hdmi_qp analogix_dp dw_dp
dw_mipi_dsi drm_dp_aux_bus dw_hdmi drm_shmem_helper drm_display_helper snd_pcm
cec gpu_sched drm_client_lib drm_dma_helper snd_timer drm_kms_helper snd
soundcore drm backlight dm_mod ipv6
<4>[   16.927513] CPU: 2 UID: 0 PID: 187 Comm: (udev-worker) Not tainted 6.19.0-rc1 #1 PREEMPT 
<4>[   16.928357] Hardware name: Radxa ROCK 5B (DT)
<4>[   16.928761] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
<4>[   16.929392] pc : panthor_fw_halt_mcu+0x24/0x98 [panthor]
<4>[   16.929901] lr : panthor_fw_unplug+0x54/0x134 [panthor]
<4>[   16.930394] sp : ffff800084cf3750
<4>[   16.930707] x29: ffff800084cf3750 x28: ffff000101d1b000 x27: 0000000000000000
<4>[   16.931358] x26: ffff80007b36b618 x25: 0000000000000000 x24: ffff000101d1b800
<4>[   16.932008] x23: ffff80007b373de0 x22: ffff00010126b010 x21: ffff000101d1b000
<4>[   16.932657] x20: ffff000101d1b000 x19: ffff00011b4200a0 x18: 0000000000000006
<4>[   16.933310] x17: 67616d6920657261 x16: 776d726966206461 x15: 6f6c206f74206465
<4>[   16.933963] x14: 6c696146202a524f x13: ffff800082aa6c40 x12: 0000000000000630
<4>[   16.933970] x11: 0000000000000210 x10: ffff800082afec40 x9 : 1fffe0002039be41
<4>[   16.935258] x8 : 0000000000000001 x7 : ffff000101cdf200 x6 : ffff0001165f1830
<4>[   16.935908] x5 : 000000000000007c x4 : 000000000000007c x3 : 0000000000000000
<4>[   16.936557] x2 : 0000000000000000 x1 : 000000000400ffff x0 : 0000000000000000
[[0;32m  OK  [0m] Started [0;1;39mserial-getty@ttyS2…rvice<4>[   16.937207] Call trace:
[0m - Serial Getty on ttyS2.
<4>[   16.937924]  panthor_fw_halt_mcu+0x24/0x98 [panthor] (P)
<4>[   16.938640]  panthor_fw_unplug+0x54/0x134 [panthor]
<4>[   16.939104]  panthor_fw_init+0x1a8/0x81c [panthor]
<4>[   16.939561]  panthor_device_init+0x350/0x4fc [panthor]
<4>[   16.940046]  panthor_probe+0x3c/0x60 [panthor]
<4>[   16.940473]  platform_probe+0x5c/0x98
<4>[   16.940823]  really_probe+0xbc/0x298
<4>[   16.941164]  __driver_probe_device+0x78/0x12c
<4>[   16.941572]  driver_probe_device+0x3c/0x15c
<4>[   16.941965]  __driver_attach+0x94/0x19c
<4>[   16.942328]  bus_for_each_dev+0x78/0xd4
<4>[   16.942691]  driver_attach+0x24/0x30
<4>[   16.943031]  bus_add_driver+0xe4/0x208
<4>[   16.943385]  driver_register+0x60/0x128
<4>[   16.943747]  __platform_driver_register+0x24/0x30
<4>[   16.944184]  panthor_init+0x64/0x1000 [panthor]
<4>[   16.944618]  do_one_initcall+0x80/0x1c4
<4>[   16.944981]  do_init_module+0x58/0x234
<4>[   16.945336]  load_module+0x1c54/0x1c98
<4>[   16.945691]  init_module_from_file+0xd4/0xec
<4>[   16.946091]  __arm64_sys_finit_module+0x144/0x324
<4>[   16.946528]  invoke_syscall+0x48/0x110
<4>[   16.946883]  el0_svc_common.constprop.0+0xc0/0xe0
<4>[   16.947321]  do_el0_svc+0x1c/0x28
<4>[   16.947638]  el0_svc+0x34/0x10c
<4>[   16.947940]  el0t_64_sync_handler+0xa0/0xe4
<4>[   16.948335]  el0t_64_sync+0x198/0x19c
<0>[   16.948344] Code: aa0003f4 f9438413 91008273 f9400660 (b9400000) 
<4>[   16.949233] ---[ end trace 0000000000000000 ]---
[[0;32m  OK  [0m] Reached target [0;1;39mgetty.target[0m - Login Prompts.
[[0;32m  OK  [0m] Reached target [0;1;39mmulti-user.target[0m - Multi-User System.
<6>[   16.956742] mc: Linux media interface: v0.10
<6>[   16.958944] videodev: Linux video capture interface: v2.00
[[0;32m  OK  [0m] Reached target [0;1;39mgraphical.target[0m - Graphical Interface.
         Starting [0;1;39msystemd-update-ut… Record Runlevel Change in UTMP...
[[0;32m  OK  [0m] Finished [0;1;39msystemd-update-ut… - Record Runlevel Change in UTMP.
<6>[   17.034547] rockchip-rga fdb80000.rga: HW Version: 0x03.02
<6>[   17.035459] snps_hdmirx fdee0000.hdmi_receiver: assigned reserved memory node hdmi-receiver-cma
<6>[   17.038646] rockchip-rga fdb80000.rga: Registered rockchip-rga as /dev/video0
<6>[   17.040732] hantro-vpu fdb50000.video-codec: registered rockchip,rk3568-vpu-dec as /dev/video2
Debian GNU/Linux 12 debian-bookworm-arm64 ttyS2


Bisect log summary:

git bisect start
# good: [7d0a66e4bb9081d75c82ec4957c50034cb0ea449] Linux 6.18
git bisect good 7d0a66e4bb9081d75c82ec4957c50034cb0ea449
# bad: [d9771d0dbe18dd643760431870a6abf9b0866bb0] Add linux-next specific files for 20251212
git bisect bad d9771d0dbe18dd643760431870a6abf9b0866bb0
# bad: [2aa680df68062e4e0c356ec2aa7100c13654907b] Merge tag 'sound-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
git bisect bad 2aa680df68062e4e0c356ec2aa7100c13654907b
# good: [8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88] Merge tag 'net-next-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
git bisect good 8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88
# bad: [b3239df349c2c2c94686674489c9629c89ca49a1] Merge tag 'drm-misc-next-2025-12-01-1' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
git bisect bad b3239df349c2c2c94686674489c9629c89ca49a1
# good: [2e640e8e7b9e9fc0f42c1e15ea0e02d00916ad57] drm/amd/pm: Update default power1_cap
git bisect good 2e640e8e7b9e9fc0f42c1e15ea0e02d00916ad57
# good: [89b34ebed02ee39ae02069dcf2e5728aceec9deb] drm/panel: ilitek-ili9881d: Add support for Wanchanglong W552946AAA panel
git bisect good 89b34ebed02ee39ae02069dcf2e5728aceec9deb
# good: [31d3354f42c0da34415164a1f621a195caa1f1bc] drm/nouveau: verify that hardware supports the flush page address
git bisect good 31d3354f42c0da34415164a1f621a195caa1f1bc
# good: [ee31621316cc20108eb2075de5d57f2cbd295677] Merge tag 'drm-msm-next-2025-11-18' of https://gitlab.freedesktop.org/drm/msm into drm-next
git bisect good ee31621316cc20108eb2075de5d57f2cbd295677
# bad: [e5719e7f19009d4fbedf685fc22eec9cd8de154f] drm/colorop: Add 3x4 CTM type
git bisect bad e5719e7f19009d4fbedf685fc22eec9cd8de154f
# good: [b1075ae1a3b56fd0b1275caf51bcc633f665bb19] drm/panthor: Add arch-specific panthor_hw binding
git bisect good b1075ae1a3b56fd0b1275caf51bcc633f665bb19
# bad: [303e9bf147b3a1b48a6d7079f2924b7d43662805] drm/vkms: Add kunit tests for VKMS LUT handling
git bisect bad 303e9bf147b3a1b48a6d7079f2924b7d43662805
# bad: [ab3490493c73374862e47ccc00d3dbb89228f86e] drm/panthor: Add support for Mali-G1 GPUs
git bisect bad ab3490493c73374862e47ccc00d3dbb89228f86e
# good: [ee4f9af07933648f2f9337d7b24da5562a594399] drm/panthor: Implement L2 power on/off via PWR_CONTROL
git bisect good ee4f9af07933648f2f9337d7b24da5562a594399
# bad: [51407254986501b19681d55531963f1ea58e89cd] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
git bisect bad 51407254986501b19681d55531963f1ea58e89cd
# good: [9ee52f5cdc45e397fddad2a9ed879c72a8fcfa65] drm/panthor: Implement soft reset via PWR_CONTROL
git bisect good 9ee52f5cdc45e397fddad2a9ed879c72a8fcfa65
# first bad commit: [51407254986501b19681d55531963f1ea58e89cd] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs

Please let me know if further testing on rk3588-rock-5b would be helpful.

Thanks,
Aishwarya
Re: [PATCH v5 6/8] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
Posted by Boris Brezillon 1 month, 3 weeks ago
On Mon, 15 Dec 2025 16:05:20 +0000
Aishwarya <aishwarya.tcv@arm.com> wrote:

> Hi Karunika,
> 
> Booting v6.19-rc1 on rk3588-rock-5b succeeds, but the kernel log shows a
> panthor firmware load failure followed by a NULL pointer dereference in
> panthor_fw_halt_mcu() during probe. The driver fails to load
> arm/mali/arch10.8/mali_csffw.bin with -ENOENT.
> 
> A git bisect identified the first bad commit as:
> 
> 51407254986501b19681d55531963f1ea58e89cd
> drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
> 
> 
> Failure log (v6.19-rc1):
> 
> <4>[   16.915783] panthor fb000000.gpu: Direct firmware load for arm/mali/arch10.8/mali_csffw.bin failed with error -2
> <3>[   16.916754] panthor fb000000.gpu: [drm] *ERROR* Failed to load firmware image 'mali_csffw.bin'
> <1>[   16.917542] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
> <1>[   16.918329] Mem abort info:
> <1>[   16.918598]   ESR = 0x0000000096000004
> <1>[   16.918949]   EC = 0x25: DABT (current EL), IL = 32 bits
> <1>[   16.919436]   SET = 0, FnV = 0
> <1>[   16.919742]   EA = 0, S1PTW = 0
> <1>[   16.920041]   FSC = 0x04: level 0 translation fault
> <1>[   16.920489] Data abort info:
> <1>[   16.920766]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
> <1>[   16.921269]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
> <1>[   16.921272]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
> <1>[   16.921275] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000117ca8000
> <1>[   16.922802] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
> <0>[   16.923423] Internal error: Oops: 0000000096000004 [#1]  SMP
> [[0;32m  OK  [0m] Started [0;1;39mgetty@tty1.service[0m - Ge<4>[   16.923941] 
> Modules linked in: pci_endpoint_test snd_soc_audio_graph_card
> snd_soc_simple_card_utils rockchipdrm snd_soc_core snd_compress panthor(+)
> snd_pcm_dmaengine drm_gpuvm drm_exec dw_hdmi_qp analogix_dp dw_dp
> dw_mipi_dsi drm_dp_aux_bus dw_hdmi drm_shmem_helper drm_display_helper snd_pcm
> cec gpu_sched drm_client_lib drm_dma_helper snd_timer drm_kms_helper snd
> soundcore drm backlight dm_mod ipv6
> <4>[   16.927513] CPU: 2 UID: 0 PID: 187 Comm: (udev-worker) Not tainted 6.19.0-rc1 #1 PREEMPT 
> <4>[   16.928357] Hardware name: Radxa ROCK 5B (DT)
> <4>[   16.928761] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> <4>[   16.929392] pc : panthor_fw_halt_mcu+0x24/0x98 [panthor]
> <4>[   16.929901] lr : panthor_fw_unplug+0x54/0x134 [panthor]
> <4>[   16.930394] sp : ffff800084cf3750
> <4>[   16.930707] x29: ffff800084cf3750 x28: ffff000101d1b000 x27: 0000000000000000
> <4>[   16.931358] x26: ffff80007b36b618 x25: 0000000000000000 x24: ffff000101d1b800
> <4>[   16.932008] x23: ffff80007b373de0 x22: ffff00010126b010 x21: ffff000101d1b000
> <4>[   16.932657] x20: ffff000101d1b000 x19: ffff00011b4200a0 x18: 0000000000000006
> <4>[   16.933310] x17: 67616d6920657261 x16: 776d726966206461 x15: 6f6c206f74206465
> <4>[   16.933963] x14: 6c696146202a524f x13: ffff800082aa6c40 x12: 0000000000000630
> <4>[   16.933970] x11: 0000000000000210 x10: ffff800082afec40 x9 : 1fffe0002039be41
> <4>[   16.935258] x8 : 0000000000000001 x7 : ffff000101cdf200 x6 : ffff0001165f1830
> <4>[   16.935908] x5 : 000000000000007c x4 : 000000000000007c x3 : 0000000000000000
> <4>[   16.936557] x2 : 0000000000000000 x1 : 000000000400ffff x0 : 0000000000000000
> [[0;32m  OK  [0m] Started [0;1;39mserial-getty@ttyS2…rvice<4>[   16.937207] Call trace:
> [0m - Serial Getty on ttyS2.
> <4>[   16.937924]  panthor_fw_halt_mcu+0x24/0x98 [panthor] (P)
> <4>[   16.938640]  panthor_fw_unplug+0x54/0x134 [panthor]
> <4>[   16.939104]  panthor_fw_init+0x1a8/0x81c [panthor]
> <4>[   16.939561]  panthor_device_init+0x350/0x4fc [panthor]
> <4>[   16.940046]  panthor_probe+0x3c/0x60 [panthor]
> <4>[   16.940473]  platform_probe+0x5c/0x98
> <4>[   16.940823]  really_probe+0xbc/0x298
> <4>[   16.941164]  __driver_probe_device+0x78/0x12c
> <4>[   16.941572]  driver_probe_device+0x3c/0x15c
> <4>[   16.941965]  __driver_attach+0x94/0x19c
> <4>[   16.942328]  bus_for_each_dev+0x78/0xd4
> <4>[   16.942691]  driver_attach+0x24/0x30
> <4>[   16.943031]  bus_add_driver+0xe4/0x208
> <4>[   16.943385]  driver_register+0x60/0x128
> <4>[   16.943747]  __platform_driver_register+0x24/0x30
> <4>[   16.944184]  panthor_init+0x64/0x1000 [panthor]
> <4>[   16.944618]  do_one_initcall+0x80/0x1c4
> <4>[   16.944981]  do_init_module+0x58/0x234
> <4>[   16.945336]  load_module+0x1c54/0x1c98
> <4>[   16.945691]  init_module_from_file+0xd4/0xec
> <4>[   16.946091]  __arm64_sys_finit_module+0x144/0x324
> <4>[   16.946528]  invoke_syscall+0x48/0x110
> <4>[   16.946883]  el0_svc_common.constprop.0+0xc0/0xe0
> <4>[   16.947321]  do_el0_svc+0x1c/0x28
> <4>[   16.947638]  el0_svc+0x34/0x10c
> <4>[   16.947940]  el0t_64_sync_handler+0xa0/0xe4
> <4>[   16.948335]  el0t_64_sync+0x198/0x19c
> <0>[   16.948344] Code: aa0003f4 f9438413 91008273 f9400660 (b9400000) 
> <4>[   16.949233] ---[ end trace 0000000000000000 ]---
> [[0;32m  OK  [0m] Reached target [0;1;39mgetty.target[0m - Login Prompts.
> [[0;32m  OK  [0m] Reached target [0;1;39mmulti-user.target[0m - Multi-User System.
> <6>[   16.956742] mc: Linux media interface: v0.10
> <6>[   16.958944] videodev: Linux video capture interface: v2.00
> [[0;32m  OK  [0m] Reached target [0;1;39mgraphical.target[0m - Graphical Interface.
>          Starting [0;1;39msystemd-update-ut… Record Runlevel Change in UTMP...
> [[0;32m  OK  [0m] Finished [0;1;39msystemd-update-ut… - Record Runlevel Change in UTMP.
> <6>[   17.034547] rockchip-rga fdb80000.rga: HW Version: 0x03.02
> <6>[   17.035459] snps_hdmirx fdee0000.hdmi_receiver: assigned reserved memory node hdmi-receiver-cma
> <6>[   17.038646] rockchip-rga fdb80000.rga: Registered rockchip-rga as /dev/video0
> <6>[   17.040732] hantro-vpu fdb50000.video-codec: registered rockchip,rk3568-vpu-dec as /dev/video2
> Debian GNU/Linux 12 debian-bookworm-arm64 ttyS2
> 
> 
> Bisect log summary:
> 
> git bisect start
> # good: [7d0a66e4bb9081d75c82ec4957c50034cb0ea449] Linux 6.18
> git bisect good 7d0a66e4bb9081d75c82ec4957c50034cb0ea449
> # bad: [d9771d0dbe18dd643760431870a6abf9b0866bb0] Add linux-next specific files for 20251212
> git bisect bad d9771d0dbe18dd643760431870a6abf9b0866bb0
> # bad: [2aa680df68062e4e0c356ec2aa7100c13654907b] Merge tag 'sound-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
> git bisect bad 2aa680df68062e4e0c356ec2aa7100c13654907b
> # good: [8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88] Merge tag 'net-next-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
> git bisect good 8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88
> # bad: [b3239df349c2c2c94686674489c9629c89ca49a1] Merge tag 'drm-misc-next-2025-12-01-1' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
> git bisect bad b3239df349c2c2c94686674489c9629c89ca49a1
> # good: [2e640e8e7b9e9fc0f42c1e15ea0e02d00916ad57] drm/amd/pm: Update default power1_cap
> git bisect good 2e640e8e7b9e9fc0f42c1e15ea0e02d00916ad57
> # good: [89b34ebed02ee39ae02069dcf2e5728aceec9deb] drm/panel: ilitek-ili9881d: Add support for Wanchanglong W552946AAA panel
> git bisect good 89b34ebed02ee39ae02069dcf2e5728aceec9deb
> # good: [31d3354f42c0da34415164a1f621a195caa1f1bc] drm/nouveau: verify that hardware supports the flush page address
> git bisect good 31d3354f42c0da34415164a1f621a195caa1f1bc
> # good: [ee31621316cc20108eb2075de5d57f2cbd295677] Merge tag 'drm-msm-next-2025-11-18' of https://gitlab.freedesktop.org/drm/msm into drm-next
> git bisect good ee31621316cc20108eb2075de5d57f2cbd295677
> # bad: [e5719e7f19009d4fbedf685fc22eec9cd8de154f] drm/colorop: Add 3x4 CTM type
> git bisect bad e5719e7f19009d4fbedf685fc22eec9cd8de154f
> # good: [b1075ae1a3b56fd0b1275caf51bcc633f665bb19] drm/panthor: Add arch-specific panthor_hw binding
> git bisect good b1075ae1a3b56fd0b1275caf51bcc633f665bb19
> # bad: [303e9bf147b3a1b48a6d7079f2924b7d43662805] drm/vkms: Add kunit tests for VKMS LUT handling
> git bisect bad 303e9bf147b3a1b48a6d7079f2924b7d43662805
> # bad: [ab3490493c73374862e47ccc00d3dbb89228f86e] drm/panthor: Add support for Mali-G1 GPUs
> git bisect bad ab3490493c73374862e47ccc00d3dbb89228f86e
> # good: [ee4f9af07933648f2f9337d7b24da5562a594399] drm/panthor: Implement L2 power on/off via PWR_CONTROL
> git bisect good ee4f9af07933648f2f9337d7b24da5562a594399
> # bad: [51407254986501b19681d55531963f1ea58e89cd] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
> git bisect bad 51407254986501b19681d55531963f1ea58e89cd
> # good: [9ee52f5cdc45e397fddad2a9ed879c72a8fcfa65] drm/panthor: Implement soft reset via PWR_CONTROL
> git bisect good 9ee52f5cdc45e397fddad2a9ed879c72a8fcfa65
> # first bad commit: [51407254986501b19681d55531963f1ea58e89cd] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
> 
> Please let me know if further testing on rk3588-rock-5b would be helpful.

Could you try with the following diff applied.

Karunika, do you remember why we have to gracefully halt the MCU
in case of an unplug? Feels to me that we can just pull the plug
by writing DISABLE to MCU_CONTROL, since we don't care about
warm boots after an unplug happened.

--->8---
diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
index 3641829aeb52..2c4e7aa5ba1e 100644
--- a/drivers/gpu/drm/panthor/panthor_fw.c
+++ b/drivers/gpu/drm/panthor/panthor_fw.c
@@ -1266,10 +1266,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);
        }
 
Re: [PATCH v5 6/8] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
Posted by Karunika Choo 1 month, 3 weeks ago
On 15/12/2025 16:25, Boris Brezillon wrote:
> On Mon, 15 Dec 2025 16:05:20 +0000
> Aishwarya <aishwarya.tcv@arm.com> wrote:
> 
>> Hi Karunika,
>>
>> Booting v6.19-rc1 on rk3588-rock-5b succeeds, but the kernel log shows a
>> panthor firmware load failure followed by a NULL pointer dereference in
>> panthor_fw_halt_mcu() during probe. The driver fails to load
>> arm/mali/arch10.8/mali_csffw.bin with -ENOENT.
>>
>> A git bisect identified the first bad commit as:
>>
>> 51407254986501b19681d55531963f1ea58e89cd
>> drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
>>
>>
>> Failure log (v6.19-rc1):
>>
>> <4>[   16.915783] panthor fb000000.gpu: Direct firmware load for arm/mali/arch10.8/mali_csffw.bin failed with error -2
>> <3>[   16.916754] panthor fb000000.gpu: [drm] *ERROR* Failed to load firmware image 'mali_csffw.bin'
>> <1>[   16.917542] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
>> <1>[   16.918329] Mem abort info:
>> <1>[   16.918598]   ESR = 0x0000000096000004
>> <1>[   16.918949]   EC = 0x25: DABT (current EL), IL = 32 bits
>> <1>[   16.919436]   SET = 0, FnV = 0
>> <1>[   16.919742]   EA = 0, S1PTW = 0
>> <1>[   16.920041]   FSC = 0x04: level 0 translation fault
>> <1>[   16.920489] Data abort info:
>> <1>[   16.920766]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
>> <1>[   16.921269]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
>> <1>[   16.921272]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
>> <1>[   16.921275] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000117ca8000
>> <1>[   16.922802] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
>> <0>[   16.923423] Internal error: Oops: 0000000096000004 [#1]  SMP
>> [[0;32m  OK  [0m] Started [0;1;39mgetty@tty1.service[0m - Ge<4>[   16.923941] 
>> Modules linked in: pci_endpoint_test snd_soc_audio_graph_card
>> snd_soc_simple_card_utils rockchipdrm snd_soc_core snd_compress panthor(+)
>> snd_pcm_dmaengine drm_gpuvm drm_exec dw_hdmi_qp analogix_dp dw_dp
>> dw_mipi_dsi drm_dp_aux_bus dw_hdmi drm_shmem_helper drm_display_helper snd_pcm
>> cec gpu_sched drm_client_lib drm_dma_helper snd_timer drm_kms_helper snd
>> soundcore drm backlight dm_mod ipv6
>> <4>[   16.927513] CPU: 2 UID: 0 PID: 187 Comm: (udev-worker) Not tainted 6.19.0-rc1 #1 PREEMPT 
>> <4>[   16.928357] Hardware name: Radxa ROCK 5B (DT)
>> <4>[   16.928761] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
>> <4>[   16.929392] pc : panthor_fw_halt_mcu+0x24/0x98 [panthor]
>> <4>[   16.929901] lr : panthor_fw_unplug+0x54/0x134 [panthor]
>> <4>[   16.930394] sp : ffff800084cf3750
>> <4>[   16.930707] x29: ffff800084cf3750 x28: ffff000101d1b000 x27: 0000000000000000
>> <4>[   16.931358] x26: ffff80007b36b618 x25: 0000000000000000 x24: ffff000101d1b800
>> <4>[   16.932008] x23: ffff80007b373de0 x22: ffff00010126b010 x21: ffff000101d1b000
>> <4>[   16.932657] x20: ffff000101d1b000 x19: ffff00011b4200a0 x18: 0000000000000006
>> <4>[   16.933310] x17: 67616d6920657261 x16: 776d726966206461 x15: 6f6c206f74206465
>> <4>[   16.933963] x14: 6c696146202a524f x13: ffff800082aa6c40 x12: 0000000000000630
>> <4>[   16.933970] x11: 0000000000000210 x10: ffff800082afec40 x9 : 1fffe0002039be41
>> <4>[   16.935258] x8 : 0000000000000001 x7 : ffff000101cdf200 x6 : ffff0001165f1830
>> <4>[   16.935908] x5 : 000000000000007c x4 : 000000000000007c x3 : 0000000000000000
>> <4>[   16.936557] x2 : 0000000000000000 x1 : 000000000400ffff x0 : 0000000000000000
>> [[0;32m  OK  [0m] Started [0;1;39mserial-getty@ttyS2…rvice<4>[   16.937207] Call trace:
>> [0m - Serial Getty on ttyS2.
>> <4>[   16.937924]  panthor_fw_halt_mcu+0x24/0x98 [panthor] (P)
>> <4>[   16.938640]  panthor_fw_unplug+0x54/0x134 [panthor]
>> <4>[   16.939104]  panthor_fw_init+0x1a8/0x81c [panthor]
>> <4>[   16.939561]  panthor_device_init+0x350/0x4fc [panthor]
>> <4>[   16.940046]  panthor_probe+0x3c/0x60 [panthor]
>> <4>[   16.940473]  platform_probe+0x5c/0x98
>> <4>[   16.940823]  really_probe+0xbc/0x298
>> <4>[   16.941164]  __driver_probe_device+0x78/0x12c
>> <4>[   16.941572]  driver_probe_device+0x3c/0x15c
>> <4>[   16.941965]  __driver_attach+0x94/0x19c
>> <4>[   16.942328]  bus_for_each_dev+0x78/0xd4
>> <4>[   16.942691]  driver_attach+0x24/0x30
>> <4>[   16.943031]  bus_add_driver+0xe4/0x208
>> <4>[   16.943385]  driver_register+0x60/0x128
>> <4>[   16.943747]  __platform_driver_register+0x24/0x30
>> <4>[   16.944184]  panthor_init+0x64/0x1000 [panthor]
>> <4>[   16.944618]  do_one_initcall+0x80/0x1c4
>> <4>[   16.944981]  do_init_module+0x58/0x234
>> <4>[   16.945336]  load_module+0x1c54/0x1c98
>> <4>[   16.945691]  init_module_from_file+0xd4/0xec
>> <4>[   16.946091]  __arm64_sys_finit_module+0x144/0x324
>> <4>[   16.946528]  invoke_syscall+0x48/0x110
>> <4>[   16.946883]  el0_svc_common.constprop.0+0xc0/0xe0
>> <4>[   16.947321]  do_el0_svc+0x1c/0x28
>> <4>[   16.947638]  el0_svc+0x34/0x10c
>> <4>[   16.947940]  el0t_64_sync_handler+0xa0/0xe4
>> <4>[   16.948335]  el0t_64_sync+0x198/0x19c
>> <0>[   16.948344] Code: aa0003f4 f9438413 91008273 f9400660 (b9400000) 
>> <4>[   16.949233] ---[ end trace 0000000000000000 ]---
>> [[0;32m  OK  [0m] Reached target [0;1;39mgetty.target[0m - Login Prompts.
>> [[0;32m  OK  [0m] Reached target [0;1;39mmulti-user.target[0m - Multi-User System.
>> <6>[   16.956742] mc: Linux media interface: v0.10
>> <6>[   16.958944] videodev: Linux video capture interface: v2.00
>> [[0;32m  OK  [0m] Reached target [0;1;39mgraphical.target[0m - Graphical Interface.
>>          Starting [0;1;39msystemd-update-ut… Record Runlevel Change in UTMP...
>> [[0;32m  OK  [0m] Finished [0;1;39msystemd-update-ut… - Record Runlevel Change in UTMP.
>> <6>[   17.034547] rockchip-rga fdb80000.rga: HW Version: 0x03.02
>> <6>[   17.035459] snps_hdmirx fdee0000.hdmi_receiver: assigned reserved memory node hdmi-receiver-cma
>> <6>[   17.038646] rockchip-rga fdb80000.rga: Registered rockchip-rga as /dev/video0
>> <6>[   17.040732] hantro-vpu fdb50000.video-codec: registered rockchip,rk3568-vpu-dec as /dev/video2
>> Debian GNU/Linux 12 debian-bookworm-arm64 ttyS2
>>
>>
>> Bisect log summary:
>>
>> git bisect start
>> # good: [7d0a66e4bb9081d75c82ec4957c50034cb0ea449] Linux 6.18
>> git bisect good 7d0a66e4bb9081d75c82ec4957c50034cb0ea449
>> # bad: [d9771d0dbe18dd643760431870a6abf9b0866bb0] Add linux-next specific files for 20251212
>> git bisect bad d9771d0dbe18dd643760431870a6abf9b0866bb0
>> # bad: [2aa680df68062e4e0c356ec2aa7100c13654907b] Merge tag 'sound-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
>> git bisect bad 2aa680df68062e4e0c356ec2aa7100c13654907b
>> # good: [8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88] Merge tag 'net-next-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
>> git bisect good 8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88
>> # bad: [b3239df349c2c2c94686674489c9629c89ca49a1] Merge tag 'drm-misc-next-2025-12-01-1' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
>> git bisect bad b3239df349c2c2c94686674489c9629c89ca49a1
>> # good: [2e640e8e7b9e9fc0f42c1e15ea0e02d00916ad57] drm/amd/pm: Update default power1_cap
>> git bisect good 2e640e8e7b9e9fc0f42c1e15ea0e02d00916ad57
>> # good: [89b34ebed02ee39ae02069dcf2e5728aceec9deb] drm/panel: ilitek-ili9881d: Add support for Wanchanglong W552946AAA panel
>> git bisect good 89b34ebed02ee39ae02069dcf2e5728aceec9deb
>> # good: [31d3354f42c0da34415164a1f621a195caa1f1bc] drm/nouveau: verify that hardware supports the flush page address
>> git bisect good 31d3354f42c0da34415164a1f621a195caa1f1bc
>> # good: [ee31621316cc20108eb2075de5d57f2cbd295677] Merge tag 'drm-msm-next-2025-11-18' of https://gitlab.freedesktop.org/drm/msm into drm-next
>> git bisect good ee31621316cc20108eb2075de5d57f2cbd295677
>> # bad: [e5719e7f19009d4fbedf685fc22eec9cd8de154f] drm/colorop: Add 3x4 CTM type
>> git bisect bad e5719e7f19009d4fbedf685fc22eec9cd8de154f
>> # good: [b1075ae1a3b56fd0b1275caf51bcc633f665bb19] drm/panthor: Add arch-specific panthor_hw binding
>> git bisect good b1075ae1a3b56fd0b1275caf51bcc633f665bb19
>> # bad: [303e9bf147b3a1b48a6d7079f2924b7d43662805] drm/vkms: Add kunit tests for VKMS LUT handling
>> git bisect bad 303e9bf147b3a1b48a6d7079f2924b7d43662805
>> # bad: [ab3490493c73374862e47ccc00d3dbb89228f86e] drm/panthor: Add support for Mali-G1 GPUs
>> git bisect bad ab3490493c73374862e47ccc00d3dbb89228f86e
>> # good: [ee4f9af07933648f2f9337d7b24da5562a594399] drm/panthor: Implement L2 power on/off via PWR_CONTROL
>> git bisect good ee4f9af07933648f2f9337d7b24da5562a594399
>> # bad: [51407254986501b19681d55531963f1ea58e89cd] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
>> git bisect bad 51407254986501b19681d55531963f1ea58e89cd
>> # good: [9ee52f5cdc45e397fddad2a9ed879c72a8fcfa65] drm/panthor: Implement soft reset via PWR_CONTROL
>> git bisect good 9ee52f5cdc45e397fddad2a9ed879c72a8fcfa65
>> # first bad commit: [51407254986501b19681d55531963f1ea58e89cd] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
>>
>> Please let me know if further testing on rk3588-rock-5b would be helpful.
> 
> Could you try with the following diff applied.
> 
> Karunika, do you remember why we have to gracefully halt the MCU
> in case of an unplug? Feels to me that we can just pull the plug
> by writing DISABLE to MCU_CONTROL, since we don't care about
> warm boots after an unplug happened.
> 
> --->8---
> diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
> index 3641829aeb52..2c4e7aa5ba1e 100644
> --- a/drivers/gpu/drm/panthor/panthor_fw.c
> +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> @@ -1266,10 +1266,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);
>         }
>  

Hi Boris,

You are right. We can just pull the plug on unplug. Do you want me to
push a fix for it?

On another note, @Aishwarya you might need to copy mali_csffw.bin into
/lib/firmware/arm/mali/arch10.8/mali_csffw.bin otherwise Panthor will
fail to probe.

Kind regards,
Karunika

Re: [PATCH v5 6/8] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
Posted by Boris Brezillon 1 month, 3 weeks ago
On Mon, 15 Dec 2025 19:09:17 +0000
Karunika Choo <karunika.choo@arm.com> wrote:

> On 15/12/2025 16:25, Boris Brezillon wrote:
> > On Mon, 15 Dec 2025 16:05:20 +0000
> > Aishwarya <aishwarya.tcv@arm.com> wrote:
> >   
> >> Hi Karunika,
> >>
> >> Booting v6.19-rc1 on rk3588-rock-5b succeeds, but the kernel log shows a
> >> panthor firmware load failure followed by a NULL pointer dereference in
> >> panthor_fw_halt_mcu() during probe. The driver fails to load
> >> arm/mali/arch10.8/mali_csffw.bin with -ENOENT.
> >>
> >> A git bisect identified the first bad commit as:
> >>
> >> 51407254986501b19681d55531963f1ea58e89cd
> >> drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
> >>
> >>
> >> Failure log (v6.19-rc1):
> >>
> >> <4>[   16.915783] panthor fb000000.gpu: Direct firmware load for arm/mali/arch10.8/mali_csffw.bin failed with error -2
> >> <3>[   16.916754] panthor fb000000.gpu: [drm] *ERROR* Failed to load firmware image 'mali_csffw.bin'
> >> <1>[   16.917542] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
> >> <1>[   16.918329] Mem abort info:
> >> <1>[   16.918598]   ESR = 0x0000000096000004
> >> <1>[   16.918949]   EC = 0x25: DABT (current EL), IL = 32 bits
> >> <1>[   16.919436]   SET = 0, FnV = 0
> >> <1>[   16.919742]   EA = 0, S1PTW = 0
> >> <1>[   16.920041]   FSC = 0x04: level 0 translation fault
> >> <1>[   16.920489] Data abort info:
> >> <1>[   16.920766]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
> >> <1>[   16.921269]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
> >> <1>[   16.921272]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
> >> <1>[   16.921275] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000117ca8000
> >> <1>[   16.922802] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
> >> <0>[   16.923423] Internal error: Oops: 0000000096000004 [#1]  SMP
> >> [[0;32m  OK  [0m] Started [0;1;39mgetty@tty1.service[0m - Ge<4>[   16.923941] 
> >> Modules linked in: pci_endpoint_test snd_soc_audio_graph_card
> >> snd_soc_simple_card_utils rockchipdrm snd_soc_core snd_compress panthor(+)
> >> snd_pcm_dmaengine drm_gpuvm drm_exec dw_hdmi_qp analogix_dp dw_dp
> >> dw_mipi_dsi drm_dp_aux_bus dw_hdmi drm_shmem_helper drm_display_helper snd_pcm
> >> cec gpu_sched drm_client_lib drm_dma_helper snd_timer drm_kms_helper snd
> >> soundcore drm backlight dm_mod ipv6
> >> <4>[   16.927513] CPU: 2 UID: 0 PID: 187 Comm: (udev-worker) Not tainted 6.19.0-rc1 #1 PREEMPT 
> >> <4>[   16.928357] Hardware name: Radxa ROCK 5B (DT)
> >> <4>[   16.928761] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> >> <4>[   16.929392] pc : panthor_fw_halt_mcu+0x24/0x98 [panthor]
> >> <4>[   16.929901] lr : panthor_fw_unplug+0x54/0x134 [panthor]
> >> <4>[   16.930394] sp : ffff800084cf3750
> >> <4>[   16.930707] x29: ffff800084cf3750 x28: ffff000101d1b000 x27: 0000000000000000
> >> <4>[   16.931358] x26: ffff80007b36b618 x25: 0000000000000000 x24: ffff000101d1b800
> >> <4>[   16.932008] x23: ffff80007b373de0 x22: ffff00010126b010 x21: ffff000101d1b000
> >> <4>[   16.932657] x20: ffff000101d1b000 x19: ffff00011b4200a0 x18: 0000000000000006
> >> <4>[   16.933310] x17: 67616d6920657261 x16: 776d726966206461 x15: 6f6c206f74206465
> >> <4>[   16.933963] x14: 6c696146202a524f x13: ffff800082aa6c40 x12: 0000000000000630
> >> <4>[   16.933970] x11: 0000000000000210 x10: ffff800082afec40 x9 : 1fffe0002039be41
> >> <4>[   16.935258] x8 : 0000000000000001 x7 : ffff000101cdf200 x6 : ffff0001165f1830
> >> <4>[   16.935908] x5 : 000000000000007c x4 : 000000000000007c x3 : 0000000000000000
> >> <4>[   16.936557] x2 : 0000000000000000 x1 : 000000000400ffff x0 : 0000000000000000
> >> [[0;32m  OK  [0m] Started [0;1;39mserial-getty@ttyS2…rvice<4>[   16.937207] Call trace:
> >> [0m - Serial Getty on ttyS2.
> >> <4>[   16.937924]  panthor_fw_halt_mcu+0x24/0x98 [panthor] (P)
> >> <4>[   16.938640]  panthor_fw_unplug+0x54/0x134 [panthor]
> >> <4>[   16.939104]  panthor_fw_init+0x1a8/0x81c [panthor]
> >> <4>[   16.939561]  panthor_device_init+0x350/0x4fc [panthor]
> >> <4>[   16.940046]  panthor_probe+0x3c/0x60 [panthor]
> >> <4>[   16.940473]  platform_probe+0x5c/0x98
> >> <4>[   16.940823]  really_probe+0xbc/0x298
> >> <4>[   16.941164]  __driver_probe_device+0x78/0x12c
> >> <4>[   16.941572]  driver_probe_device+0x3c/0x15c
> >> <4>[   16.941965]  __driver_attach+0x94/0x19c
> >> <4>[   16.942328]  bus_for_each_dev+0x78/0xd4
> >> <4>[   16.942691]  driver_attach+0x24/0x30
> >> <4>[   16.943031]  bus_add_driver+0xe4/0x208
> >> <4>[   16.943385]  driver_register+0x60/0x128
> >> <4>[   16.943747]  __platform_driver_register+0x24/0x30
> >> <4>[   16.944184]  panthor_init+0x64/0x1000 [panthor]
> >> <4>[   16.944618]  do_one_initcall+0x80/0x1c4
> >> <4>[   16.944981]  do_init_module+0x58/0x234
> >> <4>[   16.945336]  load_module+0x1c54/0x1c98
> >> <4>[   16.945691]  init_module_from_file+0xd4/0xec
> >> <4>[   16.946091]  __arm64_sys_finit_module+0x144/0x324
> >> <4>[   16.946528]  invoke_syscall+0x48/0x110
> >> <4>[   16.946883]  el0_svc_common.constprop.0+0xc0/0xe0
> >> <4>[   16.947321]  do_el0_svc+0x1c/0x28
> >> <4>[   16.947638]  el0_svc+0x34/0x10c
> >> <4>[   16.947940]  el0t_64_sync_handler+0xa0/0xe4
> >> <4>[   16.948335]  el0t_64_sync+0x198/0x19c
> >> <0>[   16.948344] Code: aa0003f4 f9438413 91008273 f9400660 (b9400000) 
> >> <4>[   16.949233] ---[ end trace 0000000000000000 ]---
> >> [[0;32m  OK  [0m] Reached target [0;1;39mgetty.target[0m - Login Prompts.
> >> [[0;32m  OK  [0m] Reached target [0;1;39mmulti-user.target[0m - Multi-User System.
> >> <6>[   16.956742] mc: Linux media interface: v0.10
> >> <6>[   16.958944] videodev: Linux video capture interface: v2.00
> >> [[0;32m  OK  [0m] Reached target [0;1;39mgraphical.target[0m - Graphical Interface.
> >>          Starting [0;1;39msystemd-update-ut… Record Runlevel Change in UTMP...
> >> [[0;32m  OK  [0m] Finished [0;1;39msystemd-update-ut… - Record Runlevel Change in UTMP.
> >> <6>[   17.034547] rockchip-rga fdb80000.rga: HW Version: 0x03.02
> >> <6>[   17.035459] snps_hdmirx fdee0000.hdmi_receiver: assigned reserved memory node hdmi-receiver-cma
> >> <6>[   17.038646] rockchip-rga fdb80000.rga: Registered rockchip-rga as /dev/video0
> >> <6>[   17.040732] hantro-vpu fdb50000.video-codec: registered rockchip,rk3568-vpu-dec as /dev/video2
> >> Debian GNU/Linux 12 debian-bookworm-arm64 ttyS2
> >>
> >>
> >> Bisect log summary:
> >>
> >> git bisect start
> >> # good: [7d0a66e4bb9081d75c82ec4957c50034cb0ea449] Linux 6.18
> >> git bisect good 7d0a66e4bb9081d75c82ec4957c50034cb0ea449
> >> # bad: [d9771d0dbe18dd643760431870a6abf9b0866bb0] Add linux-next specific files for 20251212
> >> git bisect bad d9771d0dbe18dd643760431870a6abf9b0866bb0
> >> # bad: [2aa680df68062e4e0c356ec2aa7100c13654907b] Merge tag 'sound-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
> >> git bisect bad 2aa680df68062e4e0c356ec2aa7100c13654907b
> >> # good: [8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88] Merge tag 'net-next-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
> >> git bisect good 8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88
> >> # bad: [b3239df349c2c2c94686674489c9629c89ca49a1] Merge tag 'drm-misc-next-2025-12-01-1' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
> >> git bisect bad b3239df349c2c2c94686674489c9629c89ca49a1
> >> # good: [2e640e8e7b9e9fc0f42c1e15ea0e02d00916ad57] drm/amd/pm: Update default power1_cap
> >> git bisect good 2e640e8e7b9e9fc0f42c1e15ea0e02d00916ad57
> >> # good: [89b34ebed02ee39ae02069dcf2e5728aceec9deb] drm/panel: ilitek-ili9881d: Add support for Wanchanglong W552946AAA panel
> >> git bisect good 89b34ebed02ee39ae02069dcf2e5728aceec9deb
> >> # good: [31d3354f42c0da34415164a1f621a195caa1f1bc] drm/nouveau: verify that hardware supports the flush page address
> >> git bisect good 31d3354f42c0da34415164a1f621a195caa1f1bc
> >> # good: [ee31621316cc20108eb2075de5d57f2cbd295677] Merge tag 'drm-msm-next-2025-11-18' of https://gitlab.freedesktop.org/drm/msm into drm-next
> >> git bisect good ee31621316cc20108eb2075de5d57f2cbd295677
> >> # bad: [e5719e7f19009d4fbedf685fc22eec9cd8de154f] drm/colorop: Add 3x4 CTM type
> >> git bisect bad e5719e7f19009d4fbedf685fc22eec9cd8de154f
> >> # good: [b1075ae1a3b56fd0b1275caf51bcc633f665bb19] drm/panthor: Add arch-specific panthor_hw binding
> >> git bisect good b1075ae1a3b56fd0b1275caf51bcc633f665bb19
> >> # bad: [303e9bf147b3a1b48a6d7079f2924b7d43662805] drm/vkms: Add kunit tests for VKMS LUT handling
> >> git bisect bad 303e9bf147b3a1b48a6d7079f2924b7d43662805
> >> # bad: [ab3490493c73374862e47ccc00d3dbb89228f86e] drm/panthor: Add support for Mali-G1 GPUs
> >> git bisect bad ab3490493c73374862e47ccc00d3dbb89228f86e
> >> # good: [ee4f9af07933648f2f9337d7b24da5562a594399] drm/panthor: Implement L2 power on/off via PWR_CONTROL
> >> git bisect good ee4f9af07933648f2f9337d7b24da5562a594399
> >> # bad: [51407254986501b19681d55531963f1ea58e89cd] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
> >> git bisect bad 51407254986501b19681d55531963f1ea58e89cd
> >> # good: [9ee52f5cdc45e397fddad2a9ed879c72a8fcfa65] drm/panthor: Implement soft reset via PWR_CONTROL
> >> git bisect good 9ee52f5cdc45e397fddad2a9ed879c72a8fcfa65
> >> # first bad commit: [51407254986501b19681d55531963f1ea58e89cd] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
> >>
> >> Please let me know if further testing on rk3588-rock-5b would be helpful.  
> > 
> > Could you try with the following diff applied.
> > 
> > Karunika, do you remember why we have to gracefully halt the MCU
> > in case of an unplug? Feels to me that we can just pull the plug
> > by writing DISABLE to MCU_CONTROL, since we don't care about
> > warm boots after an unplug happened.
> >   
> > --->8---  
> > diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
> > index 3641829aeb52..2c4e7aa5ba1e 100644
> > --- a/drivers/gpu/drm/panthor/panthor_fw.c
> > +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> > @@ -1266,10 +1266,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);
> >         }
> >    
> 
> Hi Boris,
> 
> You are right. We can just pull the plug on unplug. Do you want me to
> push a fix for it?

If you have time, yes, that'd be great.

Thanks,

Boris
Re: [PATCH v5 6/8] drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs
Posted by Aishwarya 1 month, 3 weeks ago
Hi Boris, Karunika,

I tested the diff on rk3588-rock-5b with and without
mali_csffw.bin installed.

With the firmware blob installed at
/lib/firmware/arm/mali/arch10.8/mali_csffw.bin, Panthor
initialises and probes successfully:

<6>[   16.920109] panthor fb000000.gpu: [drm] clock rate = 198000000
<6>[   16.923794] panthor fb000000.gpu: EM: created perf domain
<6>[   16.926724] panthor fb000000.gpu: [drm] Mali-G610 id 0xa867 major 0x0 minor 0x0 status 0x5
<6>[   16.927481] panthor fb000000.gpu: [drm] Features: L2:0x7120306 Tiler:0x809 Mem:0x301 MMU:0x2830 AS:0xff
<6>[   16.929417] panthor fb000000.gpu: [drm] shader_present=0x50005 l2_present=0x1 tiler_present=0x1
<6>[   16.931633] videodev: Linux video capture interface: v2.00
<6>[   16.937816] hantro-vpu fdb50000.video-codec: registered rockchip,rk3568-vpu-dec as /dev/video0
         Starting [0;1;39msystemd-user-sess…vice[0m - Permit User Sessions...
<4>[   16.953212] panthor fb000000.gpu: [drm] Firmware protected mode entry not be supported, ignoring
<6>[   16.954047] panthor fb000000.gpu: [drm] Firmware git sha: 95a25d71030715381f33105394285e1dcc860a65 
<6>[   16.954985] panthor fb000000.gpu: [drm] CSF FW using interface v1.5.0, Features 0x0 Instrumentation features 0x71
[[0;32m  OK  [0m] Finished [0;1;39msystemd-user-sess…ervice[0m - Permit User Sessions.
<6>[   16.988220] hantro-vpu fdba0000.video-codec: registered rockchip,rk3588-vepu121-enc as /dev/video1
<6>[   17.012257] [drm] Initialized panthor 1.5.0 for fb000000.gpu on minor 0
<6>[   17.019183] rockchip-rga fdb80000.rga: HW Version: 0x03.02
<6>[   17.019850] rockchip-rga fdb80000.rga: Registered rockchip-rga as /dev/video2
<6>[   17.027260] hantro-vpu fdba4000.video-codec: missing multi-core support, ignoring this instance
<6>[   17.032242] hantro-vpu fdba8000.video-codec: missing multi-core support, ignoring this instance
[[0;32m  OK  [0m] Started [0;1;39mgetty@tty1.service[0m - Getty on tty1.
<6>[   17.040973] hantro-vpu fdbac000.video-codec: missing multi-core support, ignoring this instance
[[0;32m  OK  [0m] Started [0;1;39mserial-getty@ttyS2…rvice<6>[   17.042138] hantro-vpu fdc70000.video-codec: registered rockchip,rk3588-av1-vpu-dec as /dev/video3
[0m - Serial Getty on ttyS2.
[[0;32m  OK  [0m] Reached target [0;1;39mgetty.target[0m - Login Prompts.
[[0;32m  OK  [0m] Reached target [0;1;39mmulti-user.target[0m - Multi-User System.
<6>[   17.061041] snps_hdmirx fdee0000.hdmi_receiver: assigned reserved memory node hdmi-receiver-cma
[[0;32m  OK  [0m] Reached target [0;1;39mgraphical.target[0m - Graphical Interface.
         Starting [0;1;39msystemd-update-ut… Record Runlevel Change in UTMP...
<6>[   17.097767] input: rk805 pwrkey as /devices/platform/feb20000.spi/spi_master/spi2/spi2.0/rk805-pwrkey.3.auto/input/input0
<6>[   17.105210] xhci-hcd xhci-hcd.4.auto: xHCI Host Controller
<6>[   17.105721] xhci-hcd xhci-hcd.4.auto: new USB bus registered, assigned bus number 5
<6>[   17.106474] xhci-hcd xhci-hcd.4.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000808002000010
<6>[   17.107320] xhci-hcd xhci-hcd.4.auto: irq 106, io mem 0xfcd00000
<6>[   17.107908] xhci-hcd xhci-hcd.4.auto: xHCI Host Controller
<6>[   17.108451] xhci-hcd xhci-hcd.4.auto: new USB bus registered, assigned bus number 6
<6>[   17.109140] xhci-hcd xhci-hcd.4.auto: Host supports USB 3.0 SuperSpeed
<4>[   17.116126] rtc-hym8563 6-0051: no valid clock/calendar values available
[[0;32m  OK  [0m] Finished [0;1;39msystemd-update-ut… - Record Runlevel Change in UTMP.
<6>[   17.136757] hub 5-0:1.0: USB hub found
<6>[   17.137158] hub 5-0:1.0: 1 port detected
<6>[   17.138787] rtc-hym8563 6-0051: registered as rtc0
<4>[   17.140243] rtc-hym8563 6-0051: no valid clock/calendar values available
<3>[   17.141064] rtc-hym8563 6-0051: hctosys: unable to read the hardware clock
Debian GNU/Linux 12 debian-bookworm-arm64 ttyS2
debian-bookworm-arm64 login: root (automatic login)

Without the firmware blob, the driver now fails probe with
but does not oops:

<6>[   16.967454] panthor fb000000.gpu: [drm] clock rate = 198000000
<6>[   16.969049] panthor fb000000.gpu: [drm] Mali-G610 id 0xa867 major 0x0 minor 0x0 status 0x5
<6>[   16.969790] panthor fb000000.gpu: [drm] Features: L2:0x7120306 Tiler:0x809 Mem:0x301 MMU:0x2830 AS:0xff
<6>[   16.970627] panthor fb000000.gpu: [drm] shader_present=0x50005 l2_present=0x1 tiler_present=0x1
<6>[   16.970642] rockchip-rga fdb80000.rga: Registered rockchip-rga as /dev/video3
<4>[   16.999584] panthor fb000000.gpu: Direct firmware load for arm/mali/arch10.8/mali_csffw.bin failed with error -2
<3>[   17.000646] panthor fb000000.gpu: [drm] *ERROR* Failed to load firmware image 'mali_csffw.bin'
<3>[   17.001784] panthor fb000000.gpu: probe with driver panthor failed with error -2
<6>[   17.010673] rockchip-drm display-subsystem: bound fdd90000.vop (ops vop2_component_ops [rockchipdrm])
<6>[   17.017837] input: rk805 pwrkey as /devices/platform/feb20000.spi/spi_master/spi2/spi2.0/rk805-pwrkey.3.auto/input/input0
<6>[   17.018094] dwhdmiqp-rockchip fdea0000.hdmi: registered DesignWare HDMI QP I2C bus driver
<6>[   17.021381] rockchip-drm display-subsystem: bound fdea0000.hdmi (ops dw_hdmi_qp_rockchip_ops [rockchipdrm])
         Starting [0;1;39msystemd-update-ut… Record Runlevel Change in UTMP...
[[0;32m  OK  [0m] Finished [0;1;39msystemd-update-ut… - Record Runlevel Change in UTMP.
<6>[   17.053595] xhci-hcd xhci-hcd.5.auto: xHCI Host Controller
<6>[   17.054241] xhci-hcd xhci-hcd.5.auto: new USB bus registered, assigned bus number 5
<4>[   17.054386] rtc-hym8563 6-0051: no valid clock/calendar values available
<6>[   17.055144] xhci-hcd xhci-hcd.5.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000808002000010
<6>[   17.056434] xhci-hcd xhci-hcd.5.auto: irq 109, io mem 0xfcd00000
<6>[   17.057099] xhci-hcd xhci-hcd.5.auto: xHCI Host Controller
<6>[   17.057336] dwhdmiqp-rockchip fdea0000.hdmi: registered DesignWare HDMI QP I2C bus driver
<6>[   17.057607] xhci-hcd xhci-hcd.5.auto: new USB bus registered, assigned bus number 6
<6>[   17.059024] xhci-hcd xhci-hcd.5.auto: Host supports USB 3.0 SuperSpeed
<6>[   17.061667] rtc-hym8563 6-0051: registered as rtc0
<6>[   17.062808] rockchip-drm display-subsystem: bound fdea0000.hdmi (ops dw_hdmi_qp_rockchip_ops [rockchipdrm])
<4>[   17.063381] rtc-hym8563 6-0051: no valid clock/calendar values available
<3>[   17.064342] rtc-hym8563 6-0051: hctosys: unable to read the hardware clock
<6>[   17.072001] rfkill_gpio rfkill-bt: rfkill-m2-bt device registered.
Debian GNU/Linux 12 debian-bookworm-arm64 ttyS2
debian-bookworm-arm64 login: root (automatic login)

Thanks,
Aishwarya