Skip to contentSkip to conversation

accel/ivpu: Improve IVPU_TEST_MODE_FW_TEST handling

PATCH Applied Andrzej Kacprowski 3 participants 4 messages Oct 8 – Oct 9

Subsystems (2)
lore
Share & tools
lore

Andrzej Kacprowski

author maintainer
#0 lore raw

PATCH v3 1/1 accel/ivpu: Improve IVPU_TEST_MODE_FW_TEST handling

In FW_TEST mode, boot the firmware but skip the ready wait and all subsequent firmware communication. The firmware test reports its results through the firmware log.

Disable driver timeouts in this mode so timeout handling does not interrupt the firmware test.

---
 drivers/accel/ivpu/ivpu_drv.c | 3 +++
 drivers/accel/ivpu/ivpu_hw.c  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/accel/ivpu/ivpu_drv.c +3 -0
index 6b71edf566e7..8c3fb0f01a31 100644
@@ -539,6 +539,9 @@ int ivpu_boot(struct ivpu_device *vdev)
 	ivpu_hw_irq_enable(vdev);
 	ivpu_ipc_enable(vdev);
 
+	if (ivpu_test_mode & IVPU_TEST_MODE_FW_TEST)
+		return 0;
+
 	if (!ivpu_fw_is_warm_boot(vdev)) {
 		ret = ivpu_pm_dct_init(vdev);
 		if (ret)
drivers/accel/ivpu/ivpu_hw.c +1 -1
index 59a5de8d9270..8b63140e3160 100644
@@ -94,7 +94,7 @@ static void wa_init(struct ivpu_device *vdev)
 
 static void timeouts_init(struct ivpu_device *vdev)
 {
-	if (ivpu_test_mode & IVPU_TEST_MODE_DISABLE_TIMEOUTS) {
+	if (ivpu_test_mode & (IVPU_TEST_MODE_DISABLE_TIMEOUTS | IVPU_TEST_MODE_FW_TEST)) {
 		/* in milliseconds, negative value disables the timeout */
 		vdev->timeout.boot = -1;
 		vdev->timeout.jsm = -1;
Signature · 1 line
2.43.0
maintainer Reviewed-by on v3 1/1
#1 lore raw
Quoted 32 lines · Andrzej Kacprowski

In FW_TEST mode, boot the firmware but skip the ready wait and all subsequent firmware communication. The firmware test reports its results through the firmware log.

Disable driver timeouts in this mode so timeout handling does not interrupt the firmware test.

---
  drivers/accel/ivpu/ivpu_drv.c | 3 +++
  drivers/accel/ivpu/ivpu_hw.c  | 2 +-
  2 files changed, 4 insertions(+), 1 deletion(-)
drivers/accel/ivpu/ivpu_drv.c +3 -0
index 6b71edf566e7..8c3fb0f01a31 100644
@@ -539,6 +539,9 @@ int ivpu_boot(struct ivpu_device *vdev)
  	ivpu_hw_irq_enable(vdev);
  	ivpu_ipc_enable(vdev);
 
+	if (ivpu_test_mode & IVPU_TEST_MODE_FW_TEST)
+		return 0;
+
  	if (!ivpu_fw_is_warm_boot(vdev)) {
  		ret = ivpu_pm_dct_init(vdev);
  		if (ret)
drivers/accel/ivpu/ivpu_hw.c +0 -0
index 59a5de8d9270..8b63140e3160 100644

drivers/accel/ivpu/ivpu_hw.c static void wa_init(struct ivpu_device *vdev) · line 100

Quoted 8 lines
drivers/accel/ivpu/ivpu_hw.c +1 -1
@@ -94,7 +94,7 @@ static void wa_init(struct ivpu_device *vdev)
 
  static void timeouts_init(struct ivpu_device *vdev)
  {
-	if (ivpu_test_mode & IVPU_TEST_MODE_DISABLE_TIMEOUTS) {
+	if (ivpu_test_mode & (IVPU_TEST_MODE_DISABLE_TIMEOUTS | IVPU_TEST_MODE_FW_TEST)) {
  		/* in milliseconds, negative value disables the timeout */
  		vdev->timeout.boot = -1;
  		vdev->timeout.jsm = -1;
maintainer Applied
#3 lore raw
Quoted 11 lines · Jeff Hugo
Quoted 8 lines · Andrzej Kacprowski

In FW_TEST mode, boot the firmware but skip the ready wait and all subsequent firmware communication. The firmware test reports its results through the firmware log.

Disable driver timeouts in this mode so timeout handling does not interrupt the firmware test.

Thanks, applied to drm-misc-next.