diff mbox series

[2/2] drm/panfrost: Propagate panfrost_fence_create() errors to the scheduler

Message ID 20200204143504.135388-2-boris.brezillon@collabora.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/panfrost: Make sure MMU context lifetime is not bound to panfrost_priv | expand

Commit Message

Boris Brezillon Feb. 4, 2020, 2:35 p.m. UTC
->job_run() can return an ERR_PTR() if somethings fails. Let's
propagate the error returned by panfrost_fence_create() instead of
returning NULL.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/gpu/drm/panfrost/panfrost_job.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alyssa Rosenzweig Feb. 4, 2020, 2:37 p.m. UTC | #1
Patch 2 is `Reviewed-by: Alyssa Rosenzweig
<alyssa.rosenzweig@collabora.com>`
On Tue, Feb 04, 2020 at 03:35:04PM +0100, Boris Brezillon wrote:
> ->job_run() can return an ERR_PTR() if somethings fails. Let's
> propagate the error returned by panfrost_fence_create() instead of
> returning NULL.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  drivers/gpu/drm/panfrost/panfrost_job.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c
> index b0716e49eeca..242147b36d8e 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_job.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_job.c
> @@ -349,7 +349,7 @@ static struct dma_fence *panfrost_job_run(struct drm_sched_job *sched_job)
>  
>  	fence = panfrost_fence_create(pfdev, slot);
>  	if (IS_ERR(fence))
> -		return NULL;
> +		return fence;
>  
>  	if (job->done_fence)
>  		dma_fence_put(job->done_fence);
> -- 
> 2.24.1
>
Steven Price Feb. 5, 2020, 1:47 p.m. UTC | #2
On 04/02/2020 14:35, Boris Brezillon wrote:
> ->job_run() can return an ERR_PTR() if somethings fails. Let's
> propagate the error returned by panfrost_fence_create() instead of
> returning NULL.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

In your previous posting[1] you also handled the case where
job->base.s_fence->finished.error is non-zero. Is there a good reason to
drop that?

[1] https://patchwork.kernel.org/patch/11267153/

But this change on its own stands, so:

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
>  drivers/gpu/drm/panfrost/panfrost_job.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c
> index b0716e49eeca..242147b36d8e 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_job.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_job.c
> @@ -349,7 +349,7 @@ static struct dma_fence *panfrost_job_run(struct drm_sched_job *sched_job)
>  
>  	fence = panfrost_fence_create(pfdev, slot);
>  	if (IS_ERR(fence))
> -		return NULL;
> +		return fence;
>  
>  	if (job->done_fence)
>  		dma_fence_put(job->done_fence);
>
Boris Brezillon Feb. 5, 2020, 2:21 p.m. UTC | #3
On Wed, 5 Feb 2020 13:47:55 +0000
Steven Price <steven.price@arm.com> wrote:

> On 04/02/2020 14:35, Boris Brezillon wrote:
> > ->job_run() can return an ERR_PTR() if somethings fails. Let's  
> > propagate the error returned by panfrost_fence_create() instead of
> > returning NULL.
> > 
> > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>  
> 
> In your previous posting[1] you also handled the case where
> job->base.s_fence->finished.error is non-zero. Is there a good reason to
> drop that?

[2] has been applied in the meantime: returning NULL now preserves
the finished.error field.

> 
> [1] https://patchwork.kernel.org/patch/11267153/

[2]https://patchwork.kernel.org/patch/11218399/

> 
> But this change on its own stands, so:
> 
> Reviewed-by: Steven Price <steven.price@arm.com>
> 
> > ---
> >  drivers/gpu/drm/panfrost/panfrost_job.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c
> > index b0716e49eeca..242147b36d8e 100644
> > --- a/drivers/gpu/drm/panfrost/panfrost_job.c
> > +++ b/drivers/gpu/drm/panfrost/panfrost_job.c
> > @@ -349,7 +349,7 @@ static struct dma_fence *panfrost_job_run(struct drm_sched_job *sched_job)
> >  
> >  	fence = panfrost_fence_create(pfdev, slot);
> >  	if (IS_ERR(fence))
> > -		return NULL;
> > +		return fence;
> >  
> >  	if (job->done_fence)
> >  		dma_fence_put(job->done_fence);
> >   
>
Steven Price Feb. 5, 2020, 2:28 p.m. UTC | #4
On Wed, Feb 05, 2020 at 02:21:55PM +0000, Boris Brezillon wrote:
> On Wed, 5 Feb 2020 13:47:55 +0000
> Steven Price <steven.price@arm.com> wrote:
> 
> > On 04/02/2020 14:35, Boris Brezillon wrote:
> > > ->job_run() can return an ERR_PTR() if somethings fails. Let's  
> > > propagate the error returned by panfrost_fence_create() instead of
> > > returning NULL.
> > > 
> > > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>  
> > 
> > In your previous posting[1] you also handled the case where
> > job->base.s_fence->finished.error is non-zero. Is there a good reason to
> > drop that?
> 
> [2] has been applied in the meantime: returning NULL now preserves
> the finished.error field.

Ah, I'd missed that - looks good.

Thanks,

Steve

> 
> > 
> > [1] https://patchwork.kernel.org/patch/11267153/
> 
> [2]https://patchwork.kernel.org/patch/11218399/
> 
> > 
> > But this change on its own stands, so:
> > 
> > Reviewed-by: Steven Price <steven.price@arm.com>
> > 
> > > ---
> > >  drivers/gpu/drm/panfrost/panfrost_job.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c
> > > index b0716e49eeca..242147b36d8e 100644
> > > --- a/drivers/gpu/drm/panfrost/panfrost_job.c
> > > +++ b/drivers/gpu/drm/panfrost/panfrost_job.c
> > > @@ -349,7 +349,7 @@ static struct dma_fence *panfrost_job_run(struct drm_sched_job *sched_job)
> > >  
> > >  	fence = panfrost_fence_create(pfdev, slot);
> > >  	if (IS_ERR(fence))
> > > -		return NULL;
> > > +		return fence;
> > >  
> > >  	if (job->done_fence)
> > >  		dma_fence_put(job->done_fence);
> > >   
> > 
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c
index b0716e49eeca..242147b36d8e 100644
--- a/drivers/gpu/drm/panfrost/panfrost_job.c
+++ b/drivers/gpu/drm/panfrost/panfrost_job.c
@@ -349,7 +349,7 @@  static struct dma_fence *panfrost_job_run(struct drm_sched_job *sched_job)
 
 	fence = panfrost_fence_create(pfdev, slot);
 	if (IS_ERR(fence))
-		return NULL;
+		return fence;
 
 	if (job->done_fence)
 		dma_fence_put(job->done_fence);