Re: [PATCH] accel/amdxdna: Refactor hardware context destroy routine

From: Jeffrey Hugo
Date: Fri Jan 31 2025 - 12:37:16 EST


On 1/24/2025 10:35 AM, Lizhi Hou wrote:
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@xxxxxxx>

Reviewed-by: Jeffrey Hugo <quic_jhugo@xxxxxxxxxxx>