linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpu: host1x: fix uninitialized variable use
@ 2023-01-27 22:14 Arnd Bergmann
  2023-01-27 23:18 ` Nathan Chancellor
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Arnd Bergmann @ 2023-01-27 22:14 UTC (permalink / raw)
  To: Thierry Reding, David Airlie, Daniel Vetter
  Cc: Arnd Bergmann, Nathan Chancellor, Nick Desaulniers, Tom Rix,
	Mikko Perttunen, Christophe JAILLET, Robin Murphy, dri-devel,
	linux-tegra, linux-kernel, llvm

From: Arnd Bergmann <arnd@arndb.de>

The error handling for platform_get_irq() failing no longer
works after a recent change, clang now points this out with
a warning:

drivers/gpu/host1x/dev.c:520:6: error: variable 'syncpt_irq' is uninitialized when used here [-Werror,-Wuninitialized]
        if (syncpt_irq < 0)
            ^~~~~~~~~~

Fix this by removing the variable and checking the correct
error status.

Fixes: 625d4ffb438c ("gpu: host1x: Rewrite syncpoint interrupt handling")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/host1x/dev.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
index 4872d183d860..aae2efeef503 100644
--- a/drivers/gpu/host1x/dev.c
+++ b/drivers/gpu/host1x/dev.c
@@ -487,7 +487,6 @@ static int host1x_get_resets(struct host1x *host)
 static int host1x_probe(struct platform_device *pdev)
 {
 	struct host1x *host;
-	int syncpt_irq;
 	int err;
 
 	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
@@ -517,8 +516,8 @@ static int host1x_probe(struct platform_device *pdev)
 	}
 
 	host->syncpt_irq = platform_get_irq(pdev, 0);
-	if (syncpt_irq < 0)
-		return syncpt_irq;
+	if (host->syncpt_irq < 0)
+		return host->syncpt_irq;
 
 	mutex_init(&host->devices_lock);
 	INIT_LIST_HEAD(&host->devices);
-- 
2.39.0


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

* Re: [PATCH] gpu: host1x: fix uninitialized variable use
  2023-01-27 22:14 [PATCH] gpu: host1x: fix uninitialized variable use Arnd Bergmann
@ 2023-01-27 23:18 ` Nathan Chancellor
  2023-01-28  8:12   ` Mikko Perttunen
  2023-02-01 23:19 ` Nick Desaulniers
  2023-02-23 16:28 ` Nathan Chancellor
  2 siblings, 1 reply; 11+ messages in thread
From: Nathan Chancellor @ 2023-01-27 23:18 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Thierry Reding, David Airlie, Daniel Vetter, Arnd Bergmann,
	Nick Desaulniers, Tom Rix, Mikko Perttunen, Christophe JAILLET,
	Robin Murphy, dri-devel, linux-tegra, linux-kernel, llvm

On Fri, Jan 27, 2023 at 11:14:00PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The error handling for platform_get_irq() failing no longer
> works after a recent change, clang now points this out with
> a warning:
> 
> drivers/gpu/host1x/dev.c:520:6: error: variable 'syncpt_irq' is uninitialized when used here [-Werror,-Wuninitialized]
>         if (syncpt_irq < 0)
>             ^~~~~~~~~~
> 
> Fix this by removing the variable and checking the correct
> error status.
> 
> Fixes: 625d4ffb438c ("gpu: host1x: Rewrite syncpoint interrupt handling")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I had the same diff pending but civic duty called today :)

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  drivers/gpu/host1x/dev.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> index 4872d183d860..aae2efeef503 100644
> --- a/drivers/gpu/host1x/dev.c
> +++ b/drivers/gpu/host1x/dev.c
> @@ -487,7 +487,6 @@ static int host1x_get_resets(struct host1x *host)
>  static int host1x_probe(struct platform_device *pdev)
>  {
>  	struct host1x *host;
> -	int syncpt_irq;
>  	int err;
>  
>  	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
> @@ -517,8 +516,8 @@ static int host1x_probe(struct platform_device *pdev)
>  	}
>  
>  	host->syncpt_irq = platform_get_irq(pdev, 0);
> -	if (syncpt_irq < 0)
> -		return syncpt_irq;
> +	if (host->syncpt_irq < 0)
> +		return host->syncpt_irq;
>  
>  	mutex_init(&host->devices_lock);
>  	INIT_LIST_HEAD(&host->devices);
> -- 
> 2.39.0
> 

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

* Re: [PATCH] gpu: host1x: fix uninitialized variable use
  2023-01-27 23:18 ` Nathan Chancellor
@ 2023-01-28  8:12   ` Mikko Perttunen
  0 siblings, 0 replies; 11+ messages in thread
From: Mikko Perttunen @ 2023-01-28  8:12 UTC (permalink / raw)
  To: Nathan Chancellor, Arnd Bergmann
  Cc: Thierry Reding, David Airlie, Daniel Vetter, Arnd Bergmann,
	Nick Desaulniers, Tom Rix, Mikko Perttunen, Christophe JAILLET,
	Robin Murphy, dri-devel, linux-tegra, linux-kernel, llvm

On 1/28/23 01:18, Nathan Chancellor wrote:
> On Fri, Jan 27, 2023 at 11:14:00PM +0100, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> The error handling for platform_get_irq() failing no longer
>> works after a recent change, clang now points this out with
>> a warning:
>>
>> drivers/gpu/host1x/dev.c:520:6: error: variable 'syncpt_irq' is uninitialized when used here [-Werror,-Wuninitialized]
>>          if (syncpt_irq < 0)
>>              ^~~~~~~~~~
>>
>> Fix this by removing the variable and checking the correct
>> error status.
>>
>> Fixes: 625d4ffb438c ("gpu: host1x: Rewrite syncpoint interrupt handling")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> I had the same diff pending but civic duty called today :)
> 
> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> 
>> ---
>>   drivers/gpu/host1x/dev.c | 5 ++---
>>   1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
>> index 4872d183d860..aae2efeef503 100644
>> --- a/drivers/gpu/host1x/dev.c
>> +++ b/drivers/gpu/host1x/dev.c
>> @@ -487,7 +487,6 @@ static int host1x_get_resets(struct host1x *host)
>>   static int host1x_probe(struct platform_device *pdev)
>>   {
>>   	struct host1x *host;
>> -	int syncpt_irq;
>>   	int err;
>>   
>>   	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
>> @@ -517,8 +516,8 @@ static int host1x_probe(struct platform_device *pdev)
>>   	}
>>   
>>   	host->syncpt_irq = platform_get_irq(pdev, 0);
>> -	if (syncpt_irq < 0)
>> -		return syncpt_irq;
>> +	if (host->syncpt_irq < 0)
>> +		return host->syncpt_irq;
>>   
>>   	mutex_init(&host->devices_lock);
>>   	INIT_LIST_HEAD(&host->devices);
>> -- 
>> 2.39.0
>>

Thanks both for the fix :)

FWIW,

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>

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

* Re: [PATCH] gpu: host1x: fix uninitialized variable use
  2023-01-27 22:14 [PATCH] gpu: host1x: fix uninitialized variable use Arnd Bergmann
  2023-01-27 23:18 ` Nathan Chancellor
@ 2023-02-01 23:19 ` Nick Desaulniers
  2023-02-23 16:28 ` Nathan Chancellor
  2 siblings, 0 replies; 11+ messages in thread
From: Nick Desaulniers @ 2023-02-01 23:19 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Thierry Reding, David Airlie, Daniel Vetter, Arnd Bergmann,
	Nathan Chancellor, Tom Rix, Mikko Perttunen, Christophe JAILLET,
	Robin Murphy, dri-devel, linux-tegra, linux-kernel, llvm

On Fri, Jan 27, 2023 at 11:14:00PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The error handling for platform_get_irq() failing no longer
> works after a recent change, clang now points this out with
> a warning:
> 
> drivers/gpu/host1x/dev.c:520:6: error: variable 'syncpt_irq' is uninitialized when used here [-Werror,-Wuninitialized]
>         if (syncpt_irq < 0)
>             ^~~~~~~~~~
> 
> Fix this by removing the variable and checking the correct
> error status.
> 
> Fixes: 625d4ffb438c ("gpu: host1x: Rewrite syncpoint interrupt handling")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks Arnd, I saw some reports from kernelci about this, too.
https://lore.kernel.org/linux-next/?q=warning%3A+variable+%27syncpt_irq%27+is+uninitialized+when+used+here

Reported-by: "kernelci.org bot" <bot@kernelci.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  drivers/gpu/host1x/dev.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> index 4872d183d860..aae2efeef503 100644
> --- a/drivers/gpu/host1x/dev.c
> +++ b/drivers/gpu/host1x/dev.c
> @@ -487,7 +487,6 @@ static int host1x_get_resets(struct host1x *host)
>  static int host1x_probe(struct platform_device *pdev)
>  {
>  	struct host1x *host;
> -	int syncpt_irq;
>  	int err;
>  
>  	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
> @@ -517,8 +516,8 @@ static int host1x_probe(struct platform_device *pdev)
>  	}
>  
>  	host->syncpt_irq = platform_get_irq(pdev, 0);
> -	if (syncpt_irq < 0)
> -		return syncpt_irq;
> +	if (host->syncpt_irq < 0)
> +		return host->syncpt_irq;
>  
>  	mutex_init(&host->devices_lock);
>  	INIT_LIST_HEAD(&host->devices);
> -- 
> 2.39.0
> 
> 

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

* Re: [PATCH] gpu: host1x: fix uninitialized variable use
  2023-01-27 22:14 [PATCH] gpu: host1x: fix uninitialized variable use Arnd Bergmann
  2023-01-27 23:18 ` Nathan Chancellor
  2023-02-01 23:19 ` Nick Desaulniers
@ 2023-02-23 16:28 ` Nathan Chancellor
  2023-03-08 16:56   ` Nathan Chancellor
  2 siblings, 1 reply; 11+ messages in thread
From: Nathan Chancellor @ 2023-02-23 16:28 UTC (permalink / raw)
  To: Thierry Reding, David Airlie, Daniel Vetter
  Cc: Arnd Bergmann, Nick Desaulniers, Tom Rix, Mikko Perttunen,
	Christophe JAILLET, Robin Murphy, dri-devel, linux-tegra,
	linux-kernel, llvm

Hi Thierry, Daniel, and David,

On Fri, Jan 27, 2023 at 11:14:00PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The error handling for platform_get_irq() failing no longer
> works after a recent change, clang now points this out with
> a warning:
> 
> drivers/gpu/host1x/dev.c:520:6: error: variable 'syncpt_irq' is uninitialized when used here [-Werror,-Wuninitialized]
>         if (syncpt_irq < 0)
>             ^~~~~~~~~~
> 
> Fix this by removing the variable and checking the correct
> error status.
> 
> Fixes: 625d4ffb438c ("gpu: host1x: Rewrite syncpoint interrupt handling")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/gpu/host1x/dev.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> index 4872d183d860..aae2efeef503 100644
> --- a/drivers/gpu/host1x/dev.c
> +++ b/drivers/gpu/host1x/dev.c
> @@ -487,7 +487,6 @@ static int host1x_get_resets(struct host1x *host)
>  static int host1x_probe(struct platform_device *pdev)
>  {
>  	struct host1x *host;
> -	int syncpt_irq;
>  	int err;
>  
>  	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
> @@ -517,8 +516,8 @@ static int host1x_probe(struct platform_device *pdev)
>  	}
>  
>  	host->syncpt_irq = platform_get_irq(pdev, 0);
> -	if (syncpt_irq < 0)
> -		return syncpt_irq;
> +	if (host->syncpt_irq < 0)
> +		return host->syncpt_irq;
>  
>  	mutex_init(&host->devices_lock);
>  	INIT_LIST_HEAD(&host->devices);
> -- 
> 2.39.0
> 

Apologies if this has been reported already or has a solution in
progress but mainline is now broken because this change got separated
from the change it is fixing:

https://github.com/ClangBuiltLinux/continuous-integration2/actions/runs/4249931209/jobs/7391912774
https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2M7y9HpiXB13qiC2mkHMyeZOcLW/build.log

I see this change sitting in the drm-tegra tree [1], which is getting
merged into -next, so it is fixed there, which is why we did not notice
any issues until the drm-next tree was merged into mainline. Can this be
fast tracked to Linus to unbreak clang builds with -Werror?

[1]: https://gitlab.freedesktop.org/drm/tegra/-/commit/b9930311641cf2ed905a84aabe27e8f3868aee4a

Cheers,
Nathan

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

* Re: [PATCH] gpu: host1x: fix uninitialized variable use
  2023-02-23 16:28 ` Nathan Chancellor
@ 2023-03-08 16:56   ` Nathan Chancellor
  2023-03-08 17:28     ` Jon Hunter
  0 siblings, 1 reply; 11+ messages in thread
From: Nathan Chancellor @ 2023-03-08 16:56 UTC (permalink / raw)
  To: Thierry Reding, David Airlie, Daniel Vetter
  Cc: Arnd Bergmann, Nick Desaulniers, Tom Rix, Mikko Perttunen,
	Christophe JAILLET, Robin Murphy, dri-devel, linux-tegra,
	linux-kernel, llvm

Ping? This warning is now in 6.3-rc1.

On Thu, Feb 23, 2023 at 09:28:28AM -0700, Nathan Chancellor wrote:
> Hi Thierry, Daniel, and David,
> 
> On Fri, Jan 27, 2023 at 11:14:00PM +0100, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> > 
> > The error handling for platform_get_irq() failing no longer
> > works after a recent change, clang now points this out with
> > a warning:
> > 
> > drivers/gpu/host1x/dev.c:520:6: error: variable 'syncpt_irq' is uninitialized when used here [-Werror,-Wuninitialized]
> >         if (syncpt_irq < 0)
> >             ^~~~~~~~~~
> > 
> > Fix this by removing the variable and checking the correct
> > error status.
> > 
> > Fixes: 625d4ffb438c ("gpu: host1x: Rewrite syncpoint interrupt handling")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/gpu/host1x/dev.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> > index 4872d183d860..aae2efeef503 100644
> > --- a/drivers/gpu/host1x/dev.c
> > +++ b/drivers/gpu/host1x/dev.c
> > @@ -487,7 +487,6 @@ static int host1x_get_resets(struct host1x *host)
> >  static int host1x_probe(struct platform_device *pdev)
> >  {
> >  	struct host1x *host;
> > -	int syncpt_irq;
> >  	int err;
> >  
> >  	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
> > @@ -517,8 +516,8 @@ static int host1x_probe(struct platform_device *pdev)
> >  	}
> >  
> >  	host->syncpt_irq = platform_get_irq(pdev, 0);
> > -	if (syncpt_irq < 0)
> > -		return syncpt_irq;
> > +	if (host->syncpt_irq < 0)
> > +		return host->syncpt_irq;
> >  
> >  	mutex_init(&host->devices_lock);
> >  	INIT_LIST_HEAD(&host->devices);
> > -- 
> > 2.39.0
> > 
> 
> Apologies if this has been reported already or has a solution in
> progress but mainline is now broken because this change got separated
> from the change it is fixing:
> 
> https://github.com/ClangBuiltLinux/continuous-integration2/actions/runs/4249931209/jobs/7391912774
> https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2M7y9HpiXB13qiC2mkHMyeZOcLW/build.log
> 
> I see this change sitting in the drm-tegra tree [1], which is getting
> merged into -next, so it is fixed there, which is why we did not notice
> any issues until the drm-next tree was merged into mainline. Can this be
> fast tracked to Linus to unbreak clang builds with -Werror?
> 
> [1]: https://gitlab.freedesktop.org/drm/tegra/-/commit/b9930311641cf2ed905a84aabe27e8f3868aee4a

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

* Re: [PATCH] gpu: host1x: fix uninitialized variable use
  2023-03-08 16:56   ` Nathan Chancellor
@ 2023-03-08 17:28     ` Jon Hunter
  2023-03-24  9:46       ` Daniel Vetter
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Hunter @ 2023-03-08 17:28 UTC (permalink / raw)
  To: Nathan Chancellor, Thierry Reding, David Airlie, Daniel Vetter
  Cc: Arnd Bergmann, Nick Desaulniers, Tom Rix, Mikko Perttunen,
	Christophe JAILLET, Robin Murphy, dri-devel, linux-tegra,
	linux-kernel, llvm



On 08/03/2023 16:56, Nathan Chancellor wrote:
> Ping? This warning is now in 6.3-rc1.

Thierry is away at the moment.

David, Daniel, do you want to pick this up directly in the meantime as a 
fix for 6.3? Mikko has already reviewed and FWIW ...

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>

Thanks
Jon


> On Thu, Feb 23, 2023 at 09:28:28AM -0700, Nathan Chancellor wrote:
>> Hi Thierry, Daniel, and David,
>>
>> On Fri, Jan 27, 2023 at 11:14:00PM +0100, Arnd Bergmann wrote:
>>> From: Arnd Bergmann <arnd@arndb.de>
>>>
>>> The error handling for platform_get_irq() failing no longer
>>> works after a recent change, clang now points this out with
>>> a warning:
>>>
>>> drivers/gpu/host1x/dev.c:520:6: error: variable 'syncpt_irq' is uninitialized when used here [-Werror,-Wuninitialized]
>>>          if (syncpt_irq < 0)
>>>              ^~~~~~~~~~
>>>
>>> Fix this by removing the variable and checking the correct
>>> error status.
>>>
>>> Fixes: 625d4ffb438c ("gpu: host1x: Rewrite syncpoint interrupt handling")
>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>> ---
>>>   drivers/gpu/host1x/dev.c | 5 ++---
>>>   1 file changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
>>> index 4872d183d860..aae2efeef503 100644
>>> --- a/drivers/gpu/host1x/dev.c
>>> +++ b/drivers/gpu/host1x/dev.c
>>> @@ -487,7 +487,6 @@ static int host1x_get_resets(struct host1x *host)
>>>   static int host1x_probe(struct platform_device *pdev)
>>>   {
>>>   	struct host1x *host;
>>> -	int syncpt_irq;
>>>   	int err;
>>>   
>>>   	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
>>> @@ -517,8 +516,8 @@ static int host1x_probe(struct platform_device *pdev)
>>>   	}
>>>   
>>>   	host->syncpt_irq = platform_get_irq(pdev, 0);
>>> -	if (syncpt_irq < 0)
>>> -		return syncpt_irq;
>>> +	if (host->syncpt_irq < 0)
>>> +		return host->syncpt_irq;
>>>   
>>>   	mutex_init(&host->devices_lock);
>>>   	INIT_LIST_HEAD(&host->devices);
>>> -- 
>>> 2.39.0
>>>
>>
>> Apologies if this has been reported already or has a solution in
>> progress but mainline is now broken because this change got separated
>> from the change it is fixing:
>>
>> https://github.com/ClangBuiltLinux/continuous-integration2/actions/runs/4249931209/jobs/7391912774
>> https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2M7y9HpiXB13qiC2mkHMyeZOcLW/build.log
>>
>> I see this change sitting in the drm-tegra tree [1], which is getting
>> merged into -next, so it is fixed there, which is why we did not notice
>> any issues until the drm-next tree was merged into mainline. Can this be
>> fast tracked to Linus to unbreak clang builds with -Werror?
>>
>> [1]: https://gitlab.freedesktop.org/drm/tegra/-/commit/b9930311641cf2ed905a84aabe27e8f3868aee4a

-- 
nvpublic

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

* Re: [PATCH] gpu: host1x: fix uninitialized variable use
  2023-03-08 17:28     ` Jon Hunter
@ 2023-03-24  9:46       ` Daniel Vetter
  2023-03-24  9:59         ` Daniel Vetter
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Vetter @ 2023-03-24  9:46 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Nathan Chancellor, Thierry Reding, David Airlie, Daniel Vetter,
	Arnd Bergmann, Nick Desaulniers, Tom Rix, Mikko Perttunen,
	Christophe JAILLET, Robin Murphy, dri-devel, linux-tegra,
	linux-kernel, llvm

On Wed, Mar 08, 2023 at 05:28:06PM +0000, Jon Hunter wrote:
> 
> 
> On 08/03/2023 16:56, Nathan Chancellor wrote:
> > Ping? This warning is now in 6.3-rc1.
> 
> Thierry is away at the moment.
> 
> David, Daniel, do you want to pick this up directly in the meantime as a fix
> for 6.3? Mikko has already reviewed and FWIW ...

Generally first fallback should be drm-misc maintainers (or anyone else
with commit rights), but since this fell through cracks for weeks it seems
I'll pick it up to drm-fixes now directly.
-Daniel

> 
> Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
> 
> Thanks
> Jon
> 
> 
> > On Thu, Feb 23, 2023 at 09:28:28AM -0700, Nathan Chancellor wrote:
> > > Hi Thierry, Daniel, and David,
> > > 
> > > On Fri, Jan 27, 2023 at 11:14:00PM +0100, Arnd Bergmann wrote:
> > > > From: Arnd Bergmann <arnd@arndb.de>
> > > > 
> > > > The error handling for platform_get_irq() failing no longer
> > > > works after a recent change, clang now points this out with
> > > > a warning:
> > > > 
> > > > drivers/gpu/host1x/dev.c:520:6: error: variable 'syncpt_irq' is uninitialized when used here [-Werror,-Wuninitialized]
> > > >          if (syncpt_irq < 0)
> > > >              ^~~~~~~~~~
> > > > 
> > > > Fix this by removing the variable and checking the correct
> > > > error status.
> > > > 
> > > > Fixes: 625d4ffb438c ("gpu: host1x: Rewrite syncpoint interrupt handling")
> > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > > ---
> > > >   drivers/gpu/host1x/dev.c | 5 ++---
> > > >   1 file changed, 2 insertions(+), 3 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> > > > index 4872d183d860..aae2efeef503 100644
> > > > --- a/drivers/gpu/host1x/dev.c
> > > > +++ b/drivers/gpu/host1x/dev.c
> > > > @@ -487,7 +487,6 @@ static int host1x_get_resets(struct host1x *host)
> > > >   static int host1x_probe(struct platform_device *pdev)
> > > >   {
> > > >   	struct host1x *host;
> > > > -	int syncpt_irq;
> > > >   	int err;
> > > >   	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
> > > > @@ -517,8 +516,8 @@ static int host1x_probe(struct platform_device *pdev)
> > > >   	}
> > > >   	host->syncpt_irq = platform_get_irq(pdev, 0);
> > > > -	if (syncpt_irq < 0)
> > > > -		return syncpt_irq;
> > > > +	if (host->syncpt_irq < 0)
> > > > +		return host->syncpt_irq;
> > > >   	mutex_init(&host->devices_lock);
> > > >   	INIT_LIST_HEAD(&host->devices);
> > > > -- 
> > > > 2.39.0
> > > > 
> > > 
> > > Apologies if this has been reported already or has a solution in
> > > progress but mainline is now broken because this change got separated
> > > from the change it is fixing:
> > > 
> > > https://github.com/ClangBuiltLinux/continuous-integration2/actions/runs/4249931209/jobs/7391912774
> > > https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2M7y9HpiXB13qiC2mkHMyeZOcLW/build.log
> > > 
> > > I see this change sitting in the drm-tegra tree [1], which is getting
> > > merged into -next, so it is fixed there, which is why we did not notice
> > > any issues until the drm-next tree was merged into mainline. Can this be
> > > fast tracked to Linus to unbreak clang builds with -Werror?
> > > 
> > > [1]: https://gitlab.freedesktop.org/drm/tegra/-/commit/b9930311641cf2ed905a84aabe27e8f3868aee4a
> 
> -- 
> nvpublic

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH] gpu: host1x: fix uninitialized variable use
  2023-03-24  9:46       ` Daniel Vetter
@ 2023-03-24  9:59         ` Daniel Vetter
  2023-03-24 10:38           ` Thierry Reding
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Vetter @ 2023-03-24  9:59 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Nathan Chancellor, Thierry Reding, David Airlie, Arnd Bergmann,
	Nick Desaulniers, Tom Rix, Mikko Perttunen, Christophe JAILLET,
	Robin Murphy, dri-devel, linux-tegra, linux-kernel, llvm

On Fri, 24 Mar 2023 at 10:46, Daniel Vetter <daniel@ffwll.ch> wrote:
>
> On Wed, Mar 08, 2023 at 05:28:06PM +0000, Jon Hunter wrote:
> >
> >
> > On 08/03/2023 16:56, Nathan Chancellor wrote:
> > > Ping? This warning is now in 6.3-rc1.
> >
> > Thierry is away at the moment.
> >
> > David, Daniel, do you want to pick this up directly in the meantime as a fix
> > for 6.3? Mikko has already reviewed and FWIW ...
>
> Generally first fallback should be drm-misc maintainers (or anyone else
> with commit rights), but since this fell through cracks for weeks it seems
> I'll pick it up to drm-fixes now directly.

Ok I think I found out why this fell through cracks, MAINTAINERS isn't
updated that host1x&tegra is maintained in drm-misc.

John, since Thierry is out, can you pls create the MAINTAINERS patch to
- point at drm-misc git repo everywhere needed
- add any missing host1x paths to the drm-misc entry so that
get_maintainers.pl adds the right people for this patch (currently it
doesn't)

Also should we have at least a 2nd person for tegra stuff (or well
maybe nvidia stuff in general) for drm-misc? Currently it's just
Thierry, and I don't think that's enough. Whomever gets volunteered
please follow

https://drm.pages.freedesktop.org/maintainer-tools/commit-access.html#drm-misc

Thanks, Daniel


>
> >
> > Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
> >
> > Thanks
> > Jon
> >
> >
> > > On Thu, Feb 23, 2023 at 09:28:28AM -0700, Nathan Chancellor wrote:
> > > > Hi Thierry, Daniel, and David,
> > > >
> > > > On Fri, Jan 27, 2023 at 11:14:00PM +0100, Arnd Bergmann wrote:
> > > > > From: Arnd Bergmann <arnd@arndb.de>
> > > > >
> > > > > The error handling for platform_get_irq() failing no longer
> > > > > works after a recent change, clang now points this out with
> > > > > a warning:
> > > > >
> > > > > drivers/gpu/host1x/dev.c:520:6: error: variable 'syncpt_irq' is uninitialized when used here [-Werror,-Wuninitialized]
> > > > >          if (syncpt_irq < 0)
> > > > >              ^~~~~~~~~~
> > > > >
> > > > > Fix this by removing the variable and checking the correct
> > > > > error status.
> > > > >
> > > > > Fixes: 625d4ffb438c ("gpu: host1x: Rewrite syncpoint interrupt handling")
> > > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > > > ---
> > > > >   drivers/gpu/host1x/dev.c | 5 ++---
> > > > >   1 file changed, 2 insertions(+), 3 deletions(-)
> > > > >
> > > > > diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> > > > > index 4872d183d860..aae2efeef503 100644
> > > > > --- a/drivers/gpu/host1x/dev.c
> > > > > +++ b/drivers/gpu/host1x/dev.c
> > > > > @@ -487,7 +487,6 @@ static int host1x_get_resets(struct host1x *host)
> > > > >   static int host1x_probe(struct platform_device *pdev)
> > > > >   {
> > > > >         struct host1x *host;
> > > > > -       int syncpt_irq;
> > > > >         int err;
> > > > >         host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
> > > > > @@ -517,8 +516,8 @@ static int host1x_probe(struct platform_device *pdev)
> > > > >         }
> > > > >         host->syncpt_irq = platform_get_irq(pdev, 0);
> > > > > -       if (syncpt_irq < 0)
> > > > > -               return syncpt_irq;
> > > > > +       if (host->syncpt_irq < 0)
> > > > > +               return host->syncpt_irq;
> > > > >         mutex_init(&host->devices_lock);
> > > > >         INIT_LIST_HEAD(&host->devices);
> > > > > --
> > > > > 2.39.0
> > > > >
> > > >
> > > > Apologies if this has been reported already or has a solution in
> > > > progress but mainline is now broken because this change got separated
> > > > from the change it is fixing:
> > > >
> > > > https://github.com/ClangBuiltLinux/continuous-integration2/actions/runs/4249931209/jobs/7391912774
> > > > https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2M7y9HpiXB13qiC2mkHMyeZOcLW/build.log
> > > >
> > > > I see this change sitting in the drm-tegra tree [1], which is getting
> > > > merged into -next, so it is fixed there, which is why we did not notice
> > > > any issues until the drm-next tree was merged into mainline. Can this be
> > > > fast tracked to Linus to unbreak clang builds with -Werror?
> > > >
> > > > [1]: https://gitlab.freedesktop.org/drm/tegra/-/commit/b9930311641cf2ed905a84aabe27e8f3868aee4a
> >
> > --
> > nvpublic
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH] gpu: host1x: fix uninitialized variable use
  2023-03-24  9:59         ` Daniel Vetter
@ 2023-03-24 10:38           ` Thierry Reding
  2023-03-24 10:50             ` Daniel Vetter
  0 siblings, 1 reply; 11+ messages in thread
From: Thierry Reding @ 2023-03-24 10:38 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Jon Hunter, Nathan Chancellor, David Airlie, Arnd Bergmann,
	Nick Desaulniers, Tom Rix, Mikko Perttunen, Christophe JAILLET,
	Robin Murphy, dri-devel, linux-tegra, linux-kernel, llvm

[-- Attachment #1: Type: text/plain, Size: 1947 bytes --]

On Fri, Mar 24, 2023 at 10:59:23AM +0100, Daniel Vetter wrote:
> On Fri, 24 Mar 2023 at 10:46, Daniel Vetter <daniel@ffwll.ch> wrote:
> >
> > On Wed, Mar 08, 2023 at 05:28:06PM +0000, Jon Hunter wrote:
> > >
> > >
> > > On 08/03/2023 16:56, Nathan Chancellor wrote:
> > > > Ping? This warning is now in 6.3-rc1.
> > >
> > > Thierry is away at the moment.
> > >
> > > David, Daniel, do you want to pick this up directly in the meantime as a fix
> > > for 6.3? Mikko has already reviewed and FWIW ...
> >
> > Generally first fallback should be drm-misc maintainers (or anyone else
> > with commit rights), but since this fell through cracks for weeks it seems
> > I'll pick it up to drm-fixes now directly.
> 
> Ok I think I found out why this fell through cracks, MAINTAINERS isn't
> updated that host1x&tegra is maintained in drm-misc.
> 
> John, since Thierry is out, can you pls create the MAINTAINERS patch to
> - point at drm-misc git repo everywhere needed
> - add any missing host1x paths to the drm-misc entry so that
> get_maintainers.pl adds the right people for this patch (currently it
> doesn't)
> 
> Also should we have at least a 2nd person for tegra stuff (or well
> maybe nvidia stuff in general) for drm-misc? Currently it's just
> Thierry, and I don't think that's enough. Whomever gets volunteered
> please follow
> 
> https://drm.pages.freedesktop.org/maintainer-tools/commit-access.html#drm-misc

We never actually moved host1x and Tegra DRM to drm-misc completely.
There's still a separate tree that feeds into linux-next. This made
sense a while ago because there was a lot going on, but development
speed has decreased recently, so we may want to fix that. The big
benefit is that drm-misc is better oiled than drm-tegra, so getting
things merged would be easier for everyone.

I'm all in favor of adding a second Tegra person to take pick up the
slack when necessary.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] gpu: host1x: fix uninitialized variable use
  2023-03-24 10:38           ` Thierry Reding
@ 2023-03-24 10:50             ` Daniel Vetter
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Vetter @ 2023-03-24 10:50 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jon Hunter, Nathan Chancellor, David Airlie, Arnd Bergmann,
	Nick Desaulniers, Tom Rix, Mikko Perttunen, Christophe JAILLET,
	Robin Murphy, dri-devel, linux-tegra, linux-kernel, llvm

On Fri, 24 Mar 2023 at 11:38, Thierry Reding <thierry.reding@gmail.com> wrote:
>
> On Fri, Mar 24, 2023 at 10:59:23AM +0100, Daniel Vetter wrote:
> > On Fri, 24 Mar 2023 at 10:46, Daniel Vetter <daniel@ffwll.ch> wrote:
> > >
> > > On Wed, Mar 08, 2023 at 05:28:06PM +0000, Jon Hunter wrote:
> > > >
> > > >
> > > > On 08/03/2023 16:56, Nathan Chancellor wrote:
> > > > > Ping? This warning is now in 6.3-rc1.
> > > >
> > > > Thierry is away at the moment.
> > > >
> > > > David, Daniel, do you want to pick this up directly in the meantime as a fix
> > > > for 6.3? Mikko has already reviewed and FWIW ...
> > >
> > > Generally first fallback should be drm-misc maintainers (or anyone else
> > > with commit rights), but since this fell through cracks for weeks it seems
> > > I'll pick it up to drm-fixes now directly.
> >
> > Ok I think I found out why this fell through cracks, MAINTAINERS isn't
> > updated that host1x&tegra is maintained in drm-misc.
> >
> > John, since Thierry is out, can you pls create the MAINTAINERS patch to
> > - point at drm-misc git repo everywhere needed
> > - add any missing host1x paths to the drm-misc entry so that
> > get_maintainers.pl adds the right people for this patch (currently it
> > doesn't)
> >
> > Also should we have at least a 2nd person for tegra stuff (or well
> > maybe nvidia stuff in general) for drm-misc? Currently it's just
> > Thierry, and I don't think that's enough. Whomever gets volunteered
> > please follow
> >
> > https://drm.pages.freedesktop.org/maintainer-tools/commit-access.html#drm-misc
>
> We never actually moved host1x and Tegra DRM to drm-misc completely.
> There's still a separate tree that feeds into linux-next. This made
> sense a while ago because there was a lot going on, but development
> speed has decreased recently, so we may want to fix that. The big
> benefit is that drm-misc is better oiled than drm-tegra, so getting
> things merged would be easier for everyone.

Hm I thought you had a split where you feed -fixes through misc and
features through tegra.git? Just listing both trees would cover that.

> I'm all in favor of adding a second Tegra person to take pick up the
> slack when necessary.

Imo features still through tegra.git with just you is fine, there's
not going to be anyone else (like ci farms) blocked if that's held up
for a bit. It's more the bugfixes where a 2nd nvidia person would be
great.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

end of thread, other threads:[~2023-03-24 10:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27 22:14 [PATCH] gpu: host1x: fix uninitialized variable use Arnd Bergmann
2023-01-27 23:18 ` Nathan Chancellor
2023-01-28  8:12   ` Mikko Perttunen
2023-02-01 23:19 ` Nick Desaulniers
2023-02-23 16:28 ` Nathan Chancellor
2023-03-08 16:56   ` Nathan Chancellor
2023-03-08 17:28     ` Jon Hunter
2023-03-24  9:46       ` Daniel Vetter
2023-03-24  9:59         ` Daniel Vetter
2023-03-24 10:38           ` Thierry Reding
2023-03-24 10:50             ` Daniel Vetter

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