Skip to contentSkip to conversation

accel/amdxdna: Handle DETACH_DEBUG_BO through config_debug_bo path

PATCH In review Lizhi Hou 2 participants 3 messages Apr 6 – Apr 7

Subsystems (2)
lore
Share & tools
lore

Lizhi Hou

author maintainer
#0 lore raw

PATCH 1/1 accel/amdxdna: Handle DETACH_DEBUG_BO through config_debug_bo path

From: Max Zhen <[email protected]>

Route DETACH_DEBUG_BO through aie2_config_debug_bo() the same way as ATTACH_DEBUG_BO.

The scheduler switch in aie2_sched_job_run() already handles ATTACH_DEBUG_BO with aie2_config_debug_bo(), but DETACH_DEBUG_BO was not included in that path. Add an explicit fallthrough so both attach and detach operations use the same handler.

This fixes debug BO detach handling by ensuring the detach command is processed by the expected configuration path.

Fixes 7ea046838021 ("accel/amdxdna: Support firmware debug buffer")
---
 drivers/accel/amdxdna/aie2_ctx.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/accel/amdxdna/aie2_ctx.c +2 -0
index 8db32f8e2362..c464cf8024c3 100644
@@ -360,6 +360,8 @@ aie2_sched_job_run(struct drm_sched_job *sched_job)
 			ret = aie2_sync_bo(hwctx, job, aie2_sched_drvcmd_resp_handler);
 			break;
 		case ATTACH_DEBUG_BO:
+			fallthrough;
+		case DETACH_DEBUG_BO:
 			ret = aie2_config_debug_bo(hwctx, job, aie2_sched_drvcmd_resp_handler);
 			break;
 		default:
Signature · 1 line
2.34.1
Reviewed-by Mario Limonciello (AMD) on v1 1/1
#1 lore raw
Quoted 25 lines · Lizhi Hou

From: Max Zhen <[email protected]>

Route DETACH_DEBUG_BO through aie2_config_debug_bo() the same way as ATTACH_DEBUG_BO.

The scheduler switch in aie2_sched_job_run() already handles ATTACH_DEBUG_BO with aie2_config_debug_bo(), but DETACH_DEBUG_BO was not included in that path. Add an explicit fallthrough so both attach and detach operations use the same handler.

This fixes debug BO detach handling by ensuring the detach command is processed by the expected configuration path.

Fixes 7ea046838021 ("accel/amdxdna: Support firmware debug buffer")
---
  drivers/accel/amdxdna/aie2_ctx.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/accel/amdxdna/aie2_ctx.c +0 -0
index 8db32f8e2362..c464cf8024c3 100644

drivers/accel/amdxdna/aie2_ctx.c aie2_sched_job_run(struct drm_sched_job *sched_job) · line 364

Quoted 5 lines
drivers/accel/amdxdna/aie2_ctx.c +2 -0
@@ -360,6 +360,8 @@ aie2_sched_job_run(struct drm_sched_job *sched_job)
  			ret = aie2_sync_bo(hwctx, job, aie2_sched_drvcmd_resp_handler);
  			break;
  		case ATTACH_DEBUG_BO:
+			fallthrough;
+		case DETACH_DEBUG_BO:

TBH - I don't think you actually need the fallthrough command here unless you plan to add new code in the ATTACH_DEBUG_BO case.

IE you can do this:

case ATTACH_DEBUG_BO:
case DETACH_DEBUG_BO:

Quoted 3 lines
drivers/accel/amdxdna/aie2_ctx.c +0 -0
  			ret = aie2_config_debug_bo(hwctx, job, aie2_sched_drvcmd_resp_handler);
  			break;
  		default:
author maintainer
#2 lore raw
Quoted 36 lines · Mario Limonciello
Quoted 27 lines · Lizhi Hou

From: Max Zhen <[email protected]>

Route DETACH_DEBUG_BO through aie2_config_debug_bo() the same way as ATTACH_DEBUG_BO.

The scheduler switch in aie2_sched_job_run() already handles ATTACH_DEBUG_BO with aie2_config_debug_bo(), but DETACH_DEBUG_BO was not included in that path. Add an explicit fallthrough so both attach and detach operations use the same handler.

This fixes debug BO detach handling by ensuring the detach command is processed by the expected configuration path.

Fixes 7ea046838021 ("accel/amdxdna: Support firmware debug buffer")

---
  drivers/accel/amdxdna/aie2_ctx.c | 2 ++

  1 file changed, 2 insertions(+)
drivers/accel/amdxdna/aie2_ctx.c +0 -0
index 8db32f8e2362..c464cf8024c3 100644
@@ -360,6 +360,8 @@ aie2_sched_job_run(struct drm_sched_job *sched_job)
               ret = aie2_sync_bo(hwctx, job, aie2_sched_drvcmd_resp_handler);
               break;
Quoted 3 lines

          case ATTACH_DEBUG_BO:
+            fallthrough;
+        case DETACH_DEBUG_BO:

TBH - I don't think you actually need the fallthrough command here unless you plan to add new code in the ATTACH_DEBUG_BO case.

Quoted 6 lines

IE you can do this:

case ATTACH_DEBUG_BO:
case DETACH_DEBUG_BO:

Thanks. Applied to drm-misc-next.

Lizhi

Quoted 5 lines
Quoted 4 lines

              ret = aie2_config_debug_bo(hwctx, job, aie2_sched_drvcmd_resp_handler); break;
          default: