kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/selftest: Fix an error code in live_noa_gpr()
@ 2020-07-14 14:12 Dan Carpenter
  2020-07-14 14:16 ` Lionel Landwerlin
  2021-02-15 15:58 ` [PATCH] drm/i915/selftest: Fix an error code in mock_context_barrier() Dan Carpenter
  0 siblings, 2 replies; 9+ messages in thread
From: Dan Carpenter @ 2020-07-14 14:12 UTC (permalink / raw)
  To: Jani Nikula, Chris Wilson; +Cc: David Airlie, intel-gfx, kernel-janitors

The error code is not set on this error path.  It's either zero or
uninitialized at this point.

Fixes: ed2690a9ca89 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/selftests/i915_perf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c
index deb6dec1b5ab..7aa73bb03381 100644
--- a/drivers/gpu/drm/i915/selftests/i915_perf.c
+++ b/drivers/gpu/drm/i915/selftests/i915_perf.c
@@ -329,6 +329,7 @@ static int live_noa_gpr(void *arg)
 	cs = intel_ring_begin(rq, 2 * 32 + 2);
 	if (IS_ERR(cs)) {
 		i915_request_add(rq);
+		err = PTR_ERR(cs);
 		goto out_rq;
 	}
 
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/i915/selftest: Fix an error code in live_noa_gpr()
  2020-07-14 14:12 [PATCH] drm/i915/selftest: Fix an error code in live_noa_gpr() Dan Carpenter
@ 2020-07-14 14:16 ` Lionel Landwerlin
  2020-07-14 14:31   ` Dan Carpenter
  2020-07-14 14:36   ` [PATCH v2] " Dan Carpenter
  2021-02-15 15:58 ` [PATCH] drm/i915/selftest: Fix an error code in mock_context_barrier() Dan Carpenter
  1 sibling, 2 replies; 9+ messages in thread
From: Lionel Landwerlin @ 2020-07-14 14:16 UTC (permalink / raw)
  To: Dan Carpenter, Jani Nikula, Chris Wilson
  Cc: David Airlie, intel-gfx, kernel-janitors

On 14/07/2020 17:12, Dan Carpenter wrote:
> The error code is not set on this error path.  It's either zero or
> uninitialized at this point.
>
> Fixes: ed2690a9ca89 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>   drivers/gpu/drm/i915/selftests/i915_perf.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c
> index deb6dec1b5ab..7aa73bb03381 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_perf.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_perf.c
> @@ -329,6 +329,7 @@ static int live_noa_gpr(void *arg)
>   	cs = intel_ring_begin(rq, 2 * 32 + 2);
>   	if (IS_ERR(cs)) {
>   		i915_request_add(rq);
> +		err = PTR_ERR(cs);
>   		goto out_rq;
>   	}
>   

Looks like there is another below :

cs = intel_ring_begin(rq, 4);
if (IS_ERR(cs)) {
         i915_request_add(rq);
         goto out_rq;
}

-Lionel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/i915/selftest: Fix an error code in live_noa_gpr()
  2020-07-14 14:16 ` Lionel Landwerlin
@ 2020-07-14 14:31   ` Dan Carpenter
  2020-07-14 14:36   ` [PATCH v2] " Dan Carpenter
  1 sibling, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2020-07-14 14:31 UTC (permalink / raw)
  To: Lionel Landwerlin; +Cc: David Airlie, intel-gfx, kernel-janitors, Chris Wilson

On Tue, Jul 14, 2020 at 05:16:33PM +0300, Lionel Landwerlin wrote:
> On 14/07/2020 17:12, Dan Carpenter wrote:
> > The error code is not set on this error path.  It's either zero or
> > uninitialized at this point.
> > 
> > Fixes: ed2690a9ca89 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> >   drivers/gpu/drm/i915/selftests/i915_perf.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c
> > index deb6dec1b5ab..7aa73bb03381 100644
> > --- a/drivers/gpu/drm/i915/selftests/i915_perf.c
> > +++ b/drivers/gpu/drm/i915/selftests/i915_perf.c
> > @@ -329,6 +329,7 @@ static int live_noa_gpr(void *arg)
> >   	cs = intel_ring_begin(rq, 2 * 32 + 2);
> >   	if (IS_ERR(cs)) {
> >   		i915_request_add(rq);
> > +		err = PTR_ERR(cs);
> >   		goto out_rq;
> >   	}
> 
> Looks like there is another below :
> 
> cs = intel_ring_begin(rq, 4);
> if (IS_ERR(cs)) {
>         i915_request_add(rq);
>         goto out_rq;
> }

Oh...  Hm...  I'm looking at linux-next now and you're right.  Also
Colin already fixed the return that I fixed.  I'll resend.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] drm/i915/selftest: Fix an error code in live_noa_gpr()
  2020-07-14 14:16 ` Lionel Landwerlin
  2020-07-14 14:31   ` Dan Carpenter
@ 2020-07-14 14:36   ` Dan Carpenter
  2020-07-14 14:39     ` Lionel Landwerlin
  1 sibling, 1 reply; 9+ messages in thread
From: Dan Carpenter @ 2020-07-14 14:36 UTC (permalink / raw)
  To: Jani Nikula, Lionel Landwerlin
  Cc: David Airlie, intel-gfx, kernel-janitors, Chris Wilson

The error code needs to be set on this path.  It currently returns
success.

Fixes: ed2690a9ca89 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: Fix a different bug instead.  :P  Colin fixed mine already.

 drivers/gpu/drm/i915/selftests/i915_perf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c
index 0aa151501fb3..c232194c60a2 100644
--- a/drivers/gpu/drm/i915/selftests/i915_perf.c
+++ b/drivers/gpu/drm/i915/selftests/i915_perf.c
@@ -358,6 +358,7 @@ static int live_noa_gpr(void *arg)
 		cs = intel_ring_begin(rq, 4);
 		if (IS_ERR(cs)) {
 			i915_request_add(rq);
+			err = PTR_ERR(cs);
 			goto out_rq;
 		}
 
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] drm/i915/selftest: Fix an error code in live_noa_gpr()
  2020-07-14 14:36   ` [PATCH v2] " Dan Carpenter
@ 2020-07-14 14:39     ` Lionel Landwerlin
  2020-07-14 17:15       ` [Intel-gfx] " Chris Wilson
  0 siblings, 1 reply; 9+ messages in thread
From: Lionel Landwerlin @ 2020-07-14 14:39 UTC (permalink / raw)
  To: Dan Carpenter, Jani Nikula
  Cc: David Airlie, intel-gfx, kernel-janitors, Chris Wilson

On 14/07/2020 17:36, Dan Carpenter wrote:
> The error code needs to be set on this path.  It currently returns
> success.
>
> Fixes: ed2690a9ca89 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
> Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2: Fix a different bug instead.  :P  Colin fixed mine already.
>
>   drivers/gpu/drm/i915/selftests/i915_perf.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c
> index 0aa151501fb3..c232194c60a2 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_perf.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_perf.c
> @@ -358,6 +358,7 @@ static int live_noa_gpr(void *arg)
>   		cs = intel_ring_begin(rq, 4);
>   		if (IS_ERR(cs)) {
>   			i915_request_add(rq);
> +			err = PTR_ERR(cs);
>   			goto out_rq;
>   		}
>   

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Intel-gfx] [PATCH v2] drm/i915/selftest: Fix an error code in live_noa_gpr()
  2020-07-14 14:39     ` Lionel Landwerlin
@ 2020-07-14 17:15       ` Chris Wilson
  2020-07-14 18:08         ` Dan Carpenter
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Wilson @ 2020-07-14 17:15 UTC (permalink / raw)
  To: Dan Carpenter, Jani Nikula, Lionel Landwerlin
  Cc: David Airlie, intel-gfx, kernel-janitors

Quoting Lionel Landwerlin (2020-07-14 15:39:21)
> On 14/07/2020 17:36, Dan Carpenter wrote:
> > The error code needs to be set on this path.  It currently returns
> > success.
> >
> > Fixes: ed2690a9ca89 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
> > Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > v2: Fix a different bug instead.  :P  Colin fixed mine already.

I was thinking that Colin already sent the patch for this one...

> >
> >   drivers/gpu/drm/i915/selftests/i915_perf.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c
> > index 0aa151501fb3..c232194c60a2 100644
> > --- a/drivers/gpu/drm/i915/selftests/i915_perf.c
> > +++ b/drivers/gpu/drm/i915/selftests/i915_perf.c
> > @@ -358,6 +358,7 @@ static int live_noa_gpr(void *arg)
> >               cs = intel_ring_begin(rq, 4);
> >               if (IS_ERR(cs)) {
> >                       i915_request_add(rq);
> > +                     err = PTR_ERR(cs);
> >                       goto out_rq;
> >               }
> >   
> 
> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>

Ta,
-Chris

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Intel-gfx] [PATCH v2] drm/i915/selftest: Fix an error code in live_noa_gpr()
  2020-07-14 17:15       ` [Intel-gfx] " Chris Wilson
@ 2020-07-14 18:08         ` Dan Carpenter
  2020-07-14 18:12           ` Colin Ian King
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Carpenter @ 2020-07-14 18:08 UTC (permalink / raw)
  To: Chris Wilson; +Cc: David Airlie, intel-gfx, kernel-janitors

On Tue, Jul 14, 2020 at 06:15:22PM +0100, Chris Wilson wrote:
> Quoting Lionel Landwerlin (2020-07-14 15:39:21)
> > On 14/07/2020 17:36, Dan Carpenter wrote:
> > > The error code needs to be set on this path.  It currently returns
> > > success.
> > >
> > > Fixes: ed2690a9ca89 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
> > > Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > > ---
> > > v2: Fix a different bug instead.  :P  Colin fixed mine already.
> 
> I was thinking that Colin already sent the patch for this one...

Colin sent a fix for my v1 bug.  commit d2921096e707 ("drm/i915/selftest:
fix an error return path where err is not being set") but I don't think
he fixed this one.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Intel-gfx] [PATCH v2] drm/i915/selftest: Fix an error code in live_noa_gpr()
  2020-07-14 18:08         ` Dan Carpenter
@ 2020-07-14 18:12           ` Colin Ian King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin Ian King @ 2020-07-14 18:12 UTC (permalink / raw)
  To: Dan Carpenter, Chris Wilson; +Cc: David Airlie, intel-gfx, kernel-janitors

On 14/07/2020 19:08, Dan Carpenter wrote:
> On Tue, Jul 14, 2020 at 06:15:22PM +0100, Chris Wilson wrote:
>> Quoting Lionel Landwerlin (2020-07-14 15:39:21)
>>> On 14/07/2020 17:36, Dan Carpenter wrote:
>>>> The error code needs to be set on this path.  It currently returns
>>>> success.
>>>>
>>>> Fixes: ed2690a9ca89 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
>>>> Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>>>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>>> ---
>>>> v2: Fix a different bug instead.  :P  Colin fixed mine already.
>>
>> I was thinking that Colin already sent the patch for this one...
> 
> Colin sent a fix for my v1 bug.  commit d2921096e707 ("drm/i915/selftest:
> fix an error return path where err is not being set") but I don't think
> he fixed this one.

Yep, coverity didn't pick the other issue up for some reason.

> 
> regards,
> dan carpenter
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] drm/i915/selftest: Fix an error code in mock_context_barrier()
  2020-07-14 14:12 [PATCH] drm/i915/selftest: Fix an error code in live_noa_gpr() Dan Carpenter
  2020-07-14 14:16 ` Lionel Landwerlin
@ 2021-02-15 15:58 ` Dan Carpenter
  1 sibling, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2021-02-15 15:58 UTC (permalink / raw)
  To: Jani Nikula, Chris Wilson
  Cc: kernel-janitors, David Airlie, intel-gfx, Thomas Hellström

If the igt_request_alloc() call fails then this should return a
negative error code, but currently it returns success.

Fixes: 85fddf0b0027 ("drm/i915: Introduce a context barrier callback")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
index d3f87dc4eda3..c30b583522ca 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
@@ -1942,6 +1942,7 @@ static int mock_context_barrier(void *arg)
 	rq = igt_request_alloc(ctx, i915->gt.engine[RCS0]);
 	if (IS_ERR(rq)) {
 		pr_err("Request allocation failed!\n");
+		err = PTR_ERR(rq);
 		goto out;
 	}
 	i915_request_add(rq);
-- 
2.30.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-15 15:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14 14:12 [PATCH] drm/i915/selftest: Fix an error code in live_noa_gpr() Dan Carpenter
2020-07-14 14:16 ` Lionel Landwerlin
2020-07-14 14:31   ` Dan Carpenter
2020-07-14 14:36   ` [PATCH v2] " Dan Carpenter
2020-07-14 14:39     ` Lionel Landwerlin
2020-07-14 17:15       ` [Intel-gfx] " Chris Wilson
2020-07-14 18:08         ` Dan Carpenter
2020-07-14 18:12           ` Colin Ian King
2021-02-15 15:58 ` [PATCH] drm/i915/selftest: Fix an error code in mock_context_barrier() Dan Carpenter

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).