]> www.infradead.org Git - users/jedix/linux-maple.git/commit
accel/amdxdna: Refactor hardware context destroy routine
authorLizhi Hou <lizhi.hou@amd.com>
Fri, 24 Jan 2025 17:35:36 +0000 (09:35 -0800)
committerJeffrey Hugo <quic_jhugo@quicinc.com>
Fri, 14 Feb 2025 15:36:07 +0000 (08:36 -0700)
commit4fd6ca90fc7f509977585d39885f21b2911123f3
tree90452f2483865a4c4ac78a66e4055c0b07f38251
parent41129e236f14c6c54145c722da06f6793e9fd13d
accel/amdxdna: Refactor hardware context destroy routine

It is required by firmware to wait up to 2 seconds for pending commands
before sending the destroy hardware context command. After 2 seconds
wait, if there are still pending commands, driver needs to cancel them.

So the context destroy steps need to be:
  1. Stop drm scheduler. (drm_sched_entity_destroy)
  2. Wait up to 2 seconds for pending commands.
  3. Destroy hardware context and cancel the rest pending requests.
  4. Wait all jobs associated with the hwctx are freed.
  5. Free job resources.

Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124173536.148676-1-lizhi.hou@amd.com
drivers/accel/amdxdna/aie2_ctx.c
drivers/accel/amdxdna/amdxdna_ctx.c
drivers/accel/amdxdna/amdxdna_ctx.h