Re: [PATCH v4 3/6] drm/tests: managed: Remove the waitqueue usage

From: Maxime Ripard
Date: Mon Jan 08 2024 - 05:46:46 EST


On Fri, Jan 05, 2024 at 11:13:21AM +0100, Michał Winiarski wrote:
> DRM managed release (drm_managed_release) is called as part of devres
> release (devres_release_all), which is not async.
> The release action should have already been executed once
> drm_kunit_helper_free_device exits, meaning that there's no need to use
> a waitqueue - we can just inspect the "action_done" state directly.
>
> Signed-off-by: Michał Winiarski <michal.winiarski@xxxxxxxxx>

I disagree, nothing guarantees in the API that it will be executed right
away. Since it might be asynchronous (if something else holds a
reference for example), we need the workqueue.

Fortunately, it turns out that it's actually done right away, which also
means we'll never hit the timeout and thus never stall the test run.

Maxime

Attachment: signature.asc
Description: PGP signature