* [PATCH] drm/amdgpu: remove useless condition in amdgpu_job_stop_all_jobs_on_sched()
@ 2022-07-19 10:39 Andrey Strachuk
2022-07-25 16:40 ` Andrey Grodzovsky
0 siblings, 1 reply; 4+ messages in thread
From: Andrey Strachuk @ 2022-07-19 10:39 UTC (permalink / raw)
To: Alex Deucher
Cc: dri-devel, Jack Zhang, Andrey Strachuk, Guchun Chen, Emma Anholt,
David Airlie, Felix Kuehling, Pan, Xinhui, linux-kernel,
Surbhi Kakarya, Melissa Wen, ldv-project, amd-gfx,
Christian König, Hawking Zhang
Local variable 'rq' is initialized by an address
of field of drm_sched_job, so it does not make
sense to compare 'rq' with NULL.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Andrey Strachuk <strochuk@ispras.ru>
Fixes: 7c6e68c777f1 ("drm/amdgpu: Avoid HW GPU reset for RAS.")
---
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index 67f66f2f1809..600401f2a98f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -285,10 +285,6 @@ void amdgpu_job_stop_all_jobs_on_sched(struct drm_gpu_scheduler *sched)
/* Signal all jobs not yet scheduled */
for (i = DRM_SCHED_PRIORITY_COUNT - 1; i >= DRM_SCHED_PRIORITY_MIN; i--) {
struct drm_sched_rq *rq = &sched->sched_rq[i];
-
- if (!rq)
- continue;
-
spin_lock(&rq->lock);
list_for_each_entry(s_entity, &rq->entities, list) {
while ((s_job = to_drm_sched_job(spsc_queue_pop(&s_entity->job_queue)))) {
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: remove useless condition in amdgpu_job_stop_all_jobs_on_sched()
2022-07-19 10:39 [PATCH] drm/amdgpu: remove useless condition in amdgpu_job_stop_all_jobs_on_sched() Andrey Strachuk
@ 2022-07-25 16:40 ` Andrey Grodzovsky
2022-08-12 11:12 ` Christian König
0 siblings, 1 reply; 4+ messages in thread
From: Andrey Grodzovsky @ 2022-07-25 16:40 UTC (permalink / raw)
To: Andrey Strachuk, Alex Deucher
Cc: dri-devel, ldv-project, Jack Zhang, Guchun Chen, Emma Anholt,
David Airlie, Felix Kuehling, Pan, Xinhui, linux-kernel,
Surbhi Kakarya, Melissa Wen, amd-gfx, Christian König,
Hawking Zhang
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Andrey
On 2022-07-19 06:39, Andrey Strachuk wrote:
> Local variable 'rq' is initialized by an address
> of field of drm_sched_job, so it does not make
> sense to compare 'rq' with NULL.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Andrey Strachuk <strochuk@ispras.ru>
> Fixes: 7c6e68c777f1 ("drm/amdgpu: Avoid HW GPU reset for RAS.")
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> index 67f66f2f1809..600401f2a98f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> @@ -285,10 +285,6 @@ void amdgpu_job_stop_all_jobs_on_sched(struct drm_gpu_scheduler *sched)
> /* Signal all jobs not yet scheduled */
> for (i = DRM_SCHED_PRIORITY_COUNT - 1; i >= DRM_SCHED_PRIORITY_MIN; i--) {
> struct drm_sched_rq *rq = &sched->sched_rq[i];
> -
> - if (!rq)
> - continue;
> -
> spin_lock(&rq->lock);
> list_for_each_entry(s_entity, &rq->entities, list) {
> while ((s_job = to_drm_sched_job(spsc_queue_pop(&s_entity->job_queue)))) {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: remove useless condition in amdgpu_job_stop_all_jobs_on_sched()
2022-07-25 16:40 ` Andrey Grodzovsky
@ 2022-08-12 11:12 ` Christian König
2022-08-15 20:21 ` Alex Deucher
0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2022-08-12 11:12 UTC (permalink / raw)
To: Andrey Grodzovsky, Andrey Strachuk, Alex Deucher
Cc: dri-devel, ldv-project, Jack Zhang, Guchun Chen, Emma Anholt,
David Airlie, Felix Kuehling, Pan, Xinhui, linux-kernel,
Surbhi Kakarya, Melissa Wen, amd-gfx, Hawking Zhang
@Alex was that one already picked up?
Am 25.07.22 um 18:40 schrieb Andrey Grodzovsky:
> Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
>
> Andrey
>
> On 2022-07-19 06:39, Andrey Strachuk wrote:
>> Local variable 'rq' is initialized by an address
>> of field of drm_sched_job, so it does not make
>> sense to compare 'rq' with NULL.
>>
>> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>>
>> Signed-off-by: Andrey Strachuk <strochuk@ispras.ru>
>> Fixes: 7c6e68c777f1 ("drm/amdgpu: Avoid HW GPU reset for RAS.")
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 4 ----
>> 1 file changed, 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
>> index 67f66f2f1809..600401f2a98f 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
>> @@ -285,10 +285,6 @@ void amdgpu_job_stop_all_jobs_on_sched(struct
>> drm_gpu_scheduler *sched)
>> /* Signal all jobs not yet scheduled */
>> for (i = DRM_SCHED_PRIORITY_COUNT - 1; i >=
>> DRM_SCHED_PRIORITY_MIN; i--) {
>> struct drm_sched_rq *rq = &sched->sched_rq[i];
>> -
>> - if (!rq)
>> - continue;
>> -
>> spin_lock(&rq->lock);
>> list_for_each_entry(s_entity, &rq->entities, list) {
>> while ((s_job =
>> to_drm_sched_job(spsc_queue_pop(&s_entity->job_queue)))) {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: remove useless condition in amdgpu_job_stop_all_jobs_on_sched()
2022-08-12 11:12 ` Christian König
@ 2022-08-15 20:21 ` Alex Deucher
0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2022-08-15 20:21 UTC (permalink / raw)
To: Christian König
Cc: ldv-project, Jack Zhang, amd-gfx, Andrey Strachuk, Emma Anholt,
Guchun Chen, David Airlie, Felix Kuehling, Pan, Xinhui,
linux-kernel, dri-devel, Melissa Wen, Surbhi Kakarya,
Alex Deucher, Hawking Zhang
Applied. Thanks!
On Fri, Aug 12, 2022 at 7:13 AM Christian König
<christian.koenig@amd.com> wrote:
>
> @Alex was that one already picked up?
>
> Am 25.07.22 um 18:40 schrieb Andrey Grodzovsky:
> > Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
> >
> > Andrey
> >
> > On 2022-07-19 06:39, Andrey Strachuk wrote:
> >> Local variable 'rq' is initialized by an address
> >> of field of drm_sched_job, so it does not make
> >> sense to compare 'rq' with NULL.
> >>
> >> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> >>
> >> Signed-off-by: Andrey Strachuk <strochuk@ispras.ru>
> >> Fixes: 7c6e68c777f1 ("drm/amdgpu: Avoid HW GPU reset for RAS.")
> >> ---
> >> drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 4 ----
> >> 1 file changed, 4 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> >> index 67f66f2f1809..600401f2a98f 100644
> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> >> @@ -285,10 +285,6 @@ void amdgpu_job_stop_all_jobs_on_sched(struct
> >> drm_gpu_scheduler *sched)
> >> /* Signal all jobs not yet scheduled */
> >> for (i = DRM_SCHED_PRIORITY_COUNT - 1; i >=
> >> DRM_SCHED_PRIORITY_MIN; i--) {
> >> struct drm_sched_rq *rq = &sched->sched_rq[i];
> >> -
> >> - if (!rq)
> >> - continue;
> >> -
> >> spin_lock(&rq->lock);
> >> list_for_each_entry(s_entity, &rq->entities, list) {
> >> while ((s_job =
> >> to_drm_sched_job(spsc_queue_pop(&s_entity->job_queue)))) {
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-15 20:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 10:39 [PATCH] drm/amdgpu: remove useless condition in amdgpu_job_stop_all_jobs_on_sched() Andrey Strachuk
2022-07-25 16:40 ` Andrey Grodzovsky
2022-08-12 11:12 ` Christian König
2022-08-15 20:21 ` Alex Deucher
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).