* [PATCH] drm/lima: fix sched context destroy
@ 2023-06-06 14:32 Erico Nunes
2023-06-07 1:18 ` [Lima] " Vasily Khoruzhick
0 siblings, 1 reply; 4+ messages in thread
From: Erico Nunes @ 2023-06-06 14:32 UTC (permalink / raw)
To: yuq825, dri-devel, lima
Cc: linux-kernel, luben.tuikov, christian.koenig, Erico Nunes
The drm sched entity must be flushed before finishing, to account for
jobs potentially still in flight at that time.
Lima did not do this flush until now, so switch the destroy call to the
drm_sched_entity_destroy() wrapper which will take care of that.
This fixes a regression on lima which started since the rework in
commit 2fdb8a8f07c2 ("drm/scheduler: rework entity flush, kill and fini")
where some specific types of applications may hang indefinitely.
Fixes: 2fdb8a8f07c2 ("drm/scheduler: rework entity flush, kill and fini")
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
---
drivers/gpu/drm/lima/lima_sched.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c
index ff003403fbbc..ffd91a5ee299 100644
--- a/drivers/gpu/drm/lima/lima_sched.c
+++ b/drivers/gpu/drm/lima/lima_sched.c
@@ -165,7 +165,7 @@ int lima_sched_context_init(struct lima_sched_pipe *pipe,
void lima_sched_context_fini(struct lima_sched_pipe *pipe,
struct lima_sched_context *context)
{
- drm_sched_entity_fini(&context->base);
+ drm_sched_entity_destroy(&context->base);
}
struct dma_fence *lima_sched_context_queue_task(struct lima_sched_task *task)
--
2.40.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Lima] [PATCH] drm/lima: fix sched context destroy
2023-06-06 14:32 [PATCH] drm/lima: fix sched context destroy Erico Nunes
@ 2023-06-07 1:18 ` Vasily Khoruzhick
2023-06-07 4:04 ` Qiang Yu
0 siblings, 1 reply; 4+ messages in thread
From: Vasily Khoruzhick @ 2023-06-07 1:18 UTC (permalink / raw)
To: Erico Nunes
Cc: lima, linux-kernel, dri-devel, luben.tuikov, yuq825,
christian.koenig
On Tue, Jun 6, 2023 at 7:33 AM Erico Nunes <nunes.erico@gmail.com> wrote:
>
> The drm sched entity must be flushed before finishing, to account for
> jobs potentially still in flight at that time.
> Lima did not do this flush until now, so switch the destroy call to the
> drm_sched_entity_destroy() wrapper which will take care of that.
>
> This fixes a regression on lima which started since the rework in
> commit 2fdb8a8f07c2 ("drm/scheduler: rework entity flush, kill and fini")
> where some specific types of applications may hang indefinitely.
>
> Fixes: 2fdb8a8f07c2 ("drm/scheduler: rework entity flush, kill and fini")
> Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
> drivers/gpu/drm/lima/lima_sched.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c
> index ff003403fbbc..ffd91a5ee299 100644
> --- a/drivers/gpu/drm/lima/lima_sched.c
> +++ b/drivers/gpu/drm/lima/lima_sched.c
> @@ -165,7 +165,7 @@ int lima_sched_context_init(struct lima_sched_pipe *pipe,
> void lima_sched_context_fini(struct lima_sched_pipe *pipe,
> struct lima_sched_context *context)
> {
> - drm_sched_entity_fini(&context->base);
> + drm_sched_entity_destroy(&context->base);
> }
>
> struct dma_fence *lima_sched_context_queue_task(struct lima_sched_task *task)
> --
> 2.40.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Lima] [PATCH] drm/lima: fix sched context destroy
2023-06-07 1:18 ` [Lima] " Vasily Khoruzhick
@ 2023-06-07 4:04 ` Qiang Yu
2023-06-07 9:20 ` Christian König
0 siblings, 1 reply; 4+ messages in thread
From: Qiang Yu @ 2023-06-07 4:04 UTC (permalink / raw)
To: Vasily Khoruzhick
Cc: lima, linux-kernel, dri-devel, luben.tuikov, christian.koenig,
Erico Nunes
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Applied to drm-misc-fixes.
On Wed, Jun 7, 2023 at 9:18 AM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
>
> On Tue, Jun 6, 2023 at 7:33 AM Erico Nunes <nunes.erico@gmail.com> wrote:
> >
> > The drm sched entity must be flushed before finishing, to account for
> > jobs potentially still in flight at that time.
> > Lima did not do this flush until now, so switch the destroy call to the
> > drm_sched_entity_destroy() wrapper which will take care of that.
> >
> > This fixes a regression on lima which started since the rework in
> > commit 2fdb8a8f07c2 ("drm/scheduler: rework entity flush, kill and fini")
> > where some specific types of applications may hang indefinitely.
> >
> > Fixes: 2fdb8a8f07c2 ("drm/scheduler: rework entity flush, kill and fini")
> > Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
>
> Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
>
> > ---
> > drivers/gpu/drm/lima/lima_sched.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c
> > index ff003403fbbc..ffd91a5ee299 100644
> > --- a/drivers/gpu/drm/lima/lima_sched.c
> > +++ b/drivers/gpu/drm/lima/lima_sched.c
> > @@ -165,7 +165,7 @@ int lima_sched_context_init(struct lima_sched_pipe *pipe,
> > void lima_sched_context_fini(struct lima_sched_pipe *pipe,
> > struct lima_sched_context *context)
> > {
> > - drm_sched_entity_fini(&context->base);
> > + drm_sched_entity_destroy(&context->base);
> > }
> >
> > struct dma_fence *lima_sched_context_queue_task(struct lima_sched_task *task)
> > --
> > 2.40.1
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Lima] [PATCH] drm/lima: fix sched context destroy
2023-06-07 4:04 ` Qiang Yu
@ 2023-06-07 9:20 ` Christian König
0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2023-06-07 9:20 UTC (permalink / raw)
To: Qiang Yu, Vasily Khoruzhick
Cc: lima, linux-kernel, dri-devel, luben.tuikov, Erico Nunes
Acked-by: Christian König <christian.koenig@amd.com>
While you are at it: It's beneficial for drivers to implement the flush
callback on the file descriptor.
This way you can still send a SIGKILL when a terminating application
waits for the entity to be flushed out to the hardware and all the
pending jobs are canceled.
Regards,
Christian.
Am 07.06.23 um 06:04 schrieb Qiang Yu:
> Reviewed-by: Qiang Yu <yuq825@gmail.com>
>
> Applied to drm-misc-fixes.
>
> On Wed, Jun 7, 2023 at 9:18 AM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
>> On Tue, Jun 6, 2023 at 7:33 AM Erico Nunes <nunes.erico@gmail.com> wrote:
>>> The drm sched entity must be flushed before finishing, to account for
>>> jobs potentially still in flight at that time.
>>> Lima did not do this flush until now, so switch the destroy call to the
>>> drm_sched_entity_destroy() wrapper which will take care of that.
>>>
>>> This fixes a regression on lima which started since the rework in
>>> commit 2fdb8a8f07c2 ("drm/scheduler: rework entity flush, kill and fini")
>>> where some specific types of applications may hang indefinitely.
>>>
>>> Fixes: 2fdb8a8f07c2 ("drm/scheduler: rework entity flush, kill and fini")
>>> Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
>> Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
>>
>>> ---
>>> drivers/gpu/drm/lima/lima_sched.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c
>>> index ff003403fbbc..ffd91a5ee299 100644
>>> --- a/drivers/gpu/drm/lima/lima_sched.c
>>> +++ b/drivers/gpu/drm/lima/lima_sched.c
>>> @@ -165,7 +165,7 @@ int lima_sched_context_init(struct lima_sched_pipe *pipe,
>>> void lima_sched_context_fini(struct lima_sched_pipe *pipe,
>>> struct lima_sched_context *context)
>>> {
>>> - drm_sched_entity_fini(&context->base);
>>> + drm_sched_entity_destroy(&context->base);
>>> }
>>>
>>> struct dma_fence *lima_sched_context_queue_task(struct lima_sched_task *task)
>>> --
>>> 2.40.1
>>>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-06-07 9:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-06 14:32 [PATCH] drm/lima: fix sched context destroy Erico Nunes
2023-06-07 1:18 ` [Lima] " Vasily Khoruzhick
2023-06-07 4:04 ` Qiang Yu
2023-06-07 9:20 ` Christian König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).