2024-03-26 18:05:14

by Miguel Ojeda

[permalink] [raw]
Subject: drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable 'out' set but not used

Hi,

In today's next, I got:

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable
'out' set but not used [-Werror,-Wunused-but-set-variable]

`out` seems to be there since commit 64d6255650d4 ("drm/msm: More
fully implement devcoredump for a7xx").

Untested diff below assuming `dumper->iova` is constant -- if you want
a formal patch, please let me know.

Cheers,
Miguel

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
index 1f5245fc2cdc..a847a0f7a73c 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
@@ -852,7 +852,7 @@ static void a6xx_get_shader_block(struct msm_gpu *gpu,
(block->type << 8) | i);

in += CRASHDUMP_READ(in, REG_A6XX_HLSQ_DBG_AHB_READ_APERTURE,
- block->size, dumper->iova + A6XX_CD_DATA_OFFSET);
+ block->size, out);

out += block->size * sizeof(u32);
}


2024-03-26 18:19:27

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable 'out' set but not used

On Tue, 26 Mar 2024 at 20:05, Miguel Ojeda
<[email protected]> wrote:
>
> Hi,
>
> In today's next, I got:
>
> drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable
> 'out' set but not used [-Werror,-Wunused-but-set-variable]
>
> `out` seems to be there since commit 64d6255650d4 ("drm/msm: More
> fully implement devcoredump for a7xx").
>
> Untested diff below assuming `dumper->iova` is constant -- if you want
> a formal patch, please let me know.

Please send a proper patch that we can pick up.

>
> Cheers,
> Miguel
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
> b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
> index 1f5245fc2cdc..a847a0f7a73c 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
> @@ -852,7 +852,7 @@ static void a6xx_get_shader_block(struct msm_gpu *gpu,
> (block->type << 8) | i);
>
> in += CRASHDUMP_READ(in, REG_A6XX_HLSQ_DBG_AHB_READ_APERTURE,
> - block->size, dumper->iova + A6XX_CD_DATA_OFFSET);
> + block->size, out);
>
> out += block->size * sizeof(u32);
> }



--
With best wishes
Dmitry

2024-03-26 18:32:45

by Abhinav Kumar

[permalink] [raw]
Subject: Re: drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable 'out' set but not used



On 3/26/2024 11:19 AM, Dmitry Baryshkov wrote:
> On Tue, 26 Mar 2024 at 20:05, Miguel Ojeda
> <[email protected]> wrote:
>>
>> Hi,
>>
>> In today's next, I got:
>>
>> drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable
>> 'out' set but not used [-Werror,-Wunused-but-set-variable]
>>
>> `out` seems to be there since commit 64d6255650d4 ("drm/msm: More
>> fully implement devcoredump for a7xx").
>>
>> Untested diff below assuming `dumper->iova` is constant -- if you want
>> a formal patch, please let me know.
>
> Please send a proper patch that we can pick up.
>

This should be fixed with https://patchwork.freedesktop.org/patch/581853/.

We can pickup that one with a Fixes tag applied.

>>
>> Cheers,
>> Miguel
>>
>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
>> b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
>> index 1f5245fc2cdc..a847a0f7a73c 100644
>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
>> @@ -852,7 +852,7 @@ static void a6xx_get_shader_block(struct msm_gpu *gpu,
>> (block->type << 8) | i);
>>
>> in += CRASHDUMP_READ(in, REG_A6XX_HLSQ_DBG_AHB_READ_APERTURE,
>> - block->size, dumper->iova + A6XX_CD_DATA_OFFSET);
>> + block->size, out);
>>
>> out += block->size * sizeof(u32);
>> }
>
>
>

2024-03-26 18:35:22

by Miguel Ojeda

[permalink] [raw]
Subject: Re: drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable 'out' set but not used

On Tue, Mar 26, 2024 at 7:31 PM Abhinav Kumar <[email protected]> wrote:
>
> This should be fixed with https://patchwork.freedesktop.org/patch/581853/.

Ah, so in that case the `CRASHDUMP_READ` target should really be
constant, unlike in other cases in that file?

> We can pickup that one with a Fixes tag applied.

Thanks!

Cheers,
Miguel

2024-03-26 19:11:20

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable 'out' set but not used

On Tue, 26 Mar 2024 at 20:31, Abhinav Kumar <[email protected]> wrote:
>
>
>
> On 3/26/2024 11:19 AM, Dmitry Baryshkov wrote:
> > On Tue, 26 Mar 2024 at 20:05, Miguel Ojeda
> > <[email protected]> wrote:
> >>
> >> Hi,
> >>
> >> In today's next, I got:
> >>
> >> drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable
> >> 'out' set but not used [-Werror,-Wunused-but-set-variable]
> >>
> >> `out` seems to be there since commit 64d6255650d4 ("drm/msm: More
> >> fully implement devcoredump for a7xx").
> >>
> >> Untested diff below assuming `dumper->iova` is constant -- if you want
> >> a formal patch, please let me know.
> >
> > Please send a proper patch that we can pick up.
> >
>
> This should be fixed with https://patchwork.freedesktop.org/patch/581853/.

Is that a correct fix? If you check other usage locations for
CRASHDUMP_READ, you'll see that `out` is the last parameter and it is
being incremented.

>
> We can pickup that one with a Fixes tag applied.
>
> >>
> >> Cheers,
> >> Miguel
> >>
> >> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
> >> b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
> >> index 1f5245fc2cdc..a847a0f7a73c 100644
> >> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
> >> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
> >> @@ -852,7 +852,7 @@ static void a6xx_get_shader_block(struct msm_gpu *gpu,
> >> (block->type << 8) | i);
> >>
> >> in += CRASHDUMP_READ(in, REG_A6XX_HLSQ_DBG_AHB_READ_APERTURE,
> >> - block->size, dumper->iova + A6XX_CD_DATA_OFFSET);
> >> + block->size, out);
> >>
> >> out += block->size * sizeof(u32);
> >> }
> >
> >
> >



--
With best wishes
Dmitry

2024-03-26 19:34:50

by Abhinav Kumar

[permalink] [raw]
Subject: Re: drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable 'out' set but not used



On 3/26/2024 12:10 PM, Dmitry Baryshkov wrote:
> On Tue, 26 Mar 2024 at 20:31, Abhinav Kumar <[email protected]> wrote:
>>
>>
>>
>> On 3/26/2024 11:19 AM, Dmitry Baryshkov wrote:
>>> On Tue, 26 Mar 2024 at 20:05, Miguel Ojeda
>>> <[email protected]> wrote:
>>>>
>>>> Hi,
>>>>
>>>> In today's next, I got:
>>>>
>>>> drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable
>>>> 'out' set but not used [-Werror,-Wunused-but-set-variable]
>>>>
>>>> `out` seems to be there since commit 64d6255650d4 ("drm/msm: More
>>>> fully implement devcoredump for a7xx").
>>>>
>>>> Untested diff below assuming `dumper->iova` is constant -- if you want
>>>> a formal patch, please let me know.
>>>
>>> Please send a proper patch that we can pick up.
>>>
>>
>> This should be fixed with https://patchwork.freedesktop.org/patch/581853/.
>
> Is that a correct fix? If you check other usage locations for
> CRASHDUMP_READ, you'll see that `out` is the last parameter and it is
> being incremented.
>

Right but in this function out is not the last parameter of CRASHDUMP_READ.

Maybe you or Rob can correct me but I thought the fix looked sane
although noone commented on that patch.

>>
>> We can pickup that one with a Fixes tag applied.
>>
>>>>
>>>> Cheers,
>>>> Miguel
>>>>
>>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
>>>> b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
>>>> index 1f5245fc2cdc..a847a0f7a73c 100644
>>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
>>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
>>>> @@ -852,7 +852,7 @@ static void a6xx_get_shader_block(struct msm_gpu *gpu,
>>>> (block->type << 8) | i);
>>>>
>>>> in += CRASHDUMP_READ(in, REG_A6XX_HLSQ_DBG_AHB_READ_APERTURE,
>>>> - block->size, dumper->iova + A6XX_CD_DATA_OFFSET);
>>>> + block->size, out);
>>>>
>>>> out += block->size * sizeof(u32);
>>>> }
>>>
>>>
>>>
>
>
>

2024-03-26 19:47:50

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable 'out' set but not used

On Tue, 26 Mar 2024 at 21:32, Abhinav Kumar <[email protected]> wrote:
>
>
>
> On 3/26/2024 12:10 PM, Dmitry Baryshkov wrote:
> > On Tue, 26 Mar 2024 at 20:31, Abhinav Kumar <[email protected]> wrote:
> >>
> >>
> >>
> >> On 3/26/2024 11:19 AM, Dmitry Baryshkov wrote:
> >>> On Tue, 26 Mar 2024 at 20:05, Miguel Ojeda
> >>> <[email protected]> wrote:
> >>>>
> >>>> Hi,
> >>>>
> >>>> In today's next, I got:
> >>>>
> >>>> drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable
> >>>> 'out' set but not used [-Werror,-Wunused-but-set-variable]
> >>>>
> >>>> `out` seems to be there since commit 64d6255650d4 ("drm/msm: More
> >>>> fully implement devcoredump for a7xx").
> >>>>
> >>>> Untested diff below assuming `dumper->iova` is constant -- if you want
> >>>> a formal patch, please let me know.
> >>>
> >>> Please send a proper patch that we can pick up.
> >>>
> >>
> >> This should be fixed with https://patchwork.freedesktop.org/patch/581853/.
> >
> > Is that a correct fix? If you check other usage locations for
> > CRASHDUMP_READ, you'll see that `out` is the last parameter and it is
> > being incremented.
> >
>
> Right but in this function out is not the last parameter of CRASHDUMP_READ.

Yes. I think in this case the patch from this email is more correct.

>
> Maybe you or Rob can correct me but I thought the fix looked sane
> although noone commented on that patch.

>
> >>
> >> We can pickup that one with a Fixes tag applied.
> >>
> >>>>
> >>>> Cheers,
> >>>> Miguel
> >>>>
> >>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
> >>>> b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
> >>>> index 1f5245fc2cdc..a847a0f7a73c 100644
> >>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
> >>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
> >>>> @@ -852,7 +852,7 @@ static void a6xx_get_shader_block(struct msm_gpu *gpu,
> >>>> (block->type << 8) | i);
> >>>>
> >>>> in += CRASHDUMP_READ(in, REG_A6XX_HLSQ_DBG_AHB_READ_APERTURE,
> >>>> - block->size, dumper->iova + A6XX_CD_DATA_OFFSET);
> >>>> + block->size, out);
> >>>>
> >>>> out += block->size * sizeof(u32);
> >>>> }
> >>>
> >>>
> >>>
> >
> >
> >



--
With best wishes
Dmitry

2024-03-26 19:52:15

by Connor Abbott

[permalink] [raw]
Subject: Re: drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable 'out' set but not used

On Tue, Mar 26, 2024 at 7:47 PM Dmitry Baryshkov
<[email protected]> wrote:
>
> On Tue, 26 Mar 2024 at 21:32, Abhinav Kumar <[email protected]> wrote:
> >
> >
> >
> > On 3/26/2024 12:10 PM, Dmitry Baryshkov wrote:
> > > On Tue, 26 Mar 2024 at 20:31, Abhinav Kumar <[email protected]> wrote:
> > >>
> > >>
> > >>
> > >> On 3/26/2024 11:19 AM, Dmitry Baryshkov wrote:
> > >>> On Tue, 26 Mar 2024 at 20:05, Miguel Ojeda
> > >>> <[email protected]> wrote:
> > >>>>
> > >>>> Hi,
> > >>>>
> > >>>> In today's next, I got:
> > >>>>
> > >>>> drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable
> > >>>> 'out' set but not used [-Werror,-Wunused-but-set-variable]
> > >>>>
> > >>>> `out` seems to be there since commit 64d6255650d4 ("drm/msm: More
> > >>>> fully implement devcoredump for a7xx").
> > >>>>
> > >>>> Untested diff below assuming `dumper->iova` is constant -- if you want
> > >>>> a formal patch, please let me know.
> > >>>
> > >>> Please send a proper patch that we can pick up.
> > >>>
> > >>
> > >> This should be fixed with https://patchwork.freedesktop.org/patch/581853/.
> > >
> > > Is that a correct fix? If you check other usage locations for
> > > CRASHDUMP_READ, you'll see that `out` is the last parameter and it is
> > > being incremented.
> > >
> >
> > Right but in this function out is not the last parameter of CRASHDUMP_READ.
>
> Yes. I think in this case the patch from this email is more correct.

Yes, this patch is more correct than the other one. I tried to fix a
bug with a6xx that I noticed while adding support for a7xx, which I
forgot to split out from "drm/msm: More fully implement devcoredump
for a7xx" into a separate commit, and this hunk was missing. Sorry
about that.

Connor

2024-03-26 20:01:56

by Abhinav Kumar

[permalink] [raw]
Subject: Re: drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable 'out' set but not used



On 3/26/2024 12:47 PM, Dmitry Baryshkov wrote:
> On Tue, 26 Mar 2024 at 21:32, Abhinav Kumar <[email protected]> wrote:
>>
>>
>>
>> On 3/26/2024 12:10 PM, Dmitry Baryshkov wrote:
>>> On Tue, 26 Mar 2024 at 20:31, Abhinav Kumar <[email protected]> wrote:
>>>>
>>>>
>>>>
>>>> On 3/26/2024 11:19 AM, Dmitry Baryshkov wrote:
>>>>> On Tue, 26 Mar 2024 at 20:05, Miguel Ojeda
>>>>> <[email protected]> wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> In today's next, I got:
>>>>>>
>>>>>> drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable
>>>>>> 'out' set but not used [-Werror,-Wunused-but-set-variable]
>>>>>>
>>>>>> `out` seems to be there since commit 64d6255650d4 ("drm/msm: More
>>>>>> fully implement devcoredump for a7xx").
>>>>>>
>>>>>> Untested diff below assuming `dumper->iova` is constant -- if you want
>>>>>> a formal patch, please let me know.
>>>>>
>>>>> Please send a proper patch that we can pick up.
>>>>>
>>>>
>>>> This should be fixed with https://patchwork.freedesktop.org/patch/581853/.
>>>
>>> Is that a correct fix? If you check other usage locations for
>>> CRASHDUMP_READ, you'll see that `out` is the last parameter and it is
>>> being incremented.
>>>
>>
>> Right but in this function out is not the last parameter of CRASHDUMP_READ.
>
> Yes. I think in this case the patch from this email is more correct.
>

Alright, in that case, Miguel can you please repost this with the Fixes
tags and in a patch form.

>>
>> Maybe you or Rob can correct me but I thought the fix looked sane
>> although noone commented on that patch.
>
>>
>>>>
>>>> We can pickup that one with a Fixes tag applied.
>>>>
>>>>>>
>>>>>> Cheers,
>>>>>> Miguel
>>>>>>
>>>>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
>>>>>> b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
>>>>>> index 1f5245fc2cdc..a847a0f7a73c 100644
>>>>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
>>>>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
>>>>>> @@ -852,7 +852,7 @@ static void a6xx_get_shader_block(struct msm_gpu *gpu,
>>>>>> (block->type << 8) | i);
>>>>>>
>>>>>> in += CRASHDUMP_READ(in, REG_A6XX_HLSQ_DBG_AHB_READ_APERTURE,
>>>>>> - block->size, dumper->iova + A6XX_CD_DATA_OFFSET);
>>>>>> + block->size, out);
>>>>>>
>>>>>> out += block->size * sizeof(u32);
>>>>>> }
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>
>
>

2024-03-26 21:31:35

by Miguel Ojeda

[permalink] [raw]
Subject: Re: drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:843:6: error: variable 'out' set but not used

On Tue, Mar 26, 2024 at 8:56 PM Abhinav Kumar <[email protected]> wrote:
>
> Alright, in that case, Miguel can you please repost this with the Fixes
> tags and in a patch form.

Done at https://lore.kernel.org/lkml/[email protected]/

Thanks all!

Cheers,
Miguel