dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix DRM driver initialization failure in kernel v5.14
@ 2021-08-10 19:59 Dan Moulding
  2021-08-10 19:59 ` [PATCH 1/1] drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails Dan Moulding
  2021-08-13 16:50 ` [PATCH 0/1] Fix DRM driver initialization failure in kernel v5.14 Dan Moulding
  0 siblings, 2 replies; 9+ messages in thread
From: Dan Moulding @ 2021-08-10 19:59 UTC (permalink / raw)
  To: dri-devel; +Cc: christian.koenig, ray.huang, jason, Dan Moulding

After trying out kernel v5.14-rc5 on my system, I no longer get any
display output. Checking dmesg, I found it's because my DRM driver
(nouveau) is failing at ttm_device_init. That is failing because of a
behavior change in ttm_global_init with respect to debugfs. debugfs is
disabled on my system, which causes ttm_global_init to fail. The
following patch fixes the issue by ignoring the debugfs failure, which
is expected, rather than allowing it to cause ttm_global_init to fail.

Dan Moulding (1):
  drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails

 drivers/gpu/drm/ttm/ttm_device.c | 2 --
 1 file changed, 2 deletions(-)

-- 
2.31.1


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

* [PATCH 1/1] drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails
  2021-08-10 19:59 [PATCH 0/1] Fix DRM driver initialization failure in kernel v5.14 Dan Moulding
@ 2021-08-10 19:59 ` Dan Moulding
  2021-08-11  9:27   ` Huacai Chen
                     ` (2 more replies)
  2021-08-13 16:50 ` [PATCH 0/1] Fix DRM driver initialization failure in kernel v5.14 Dan Moulding
  1 sibling, 3 replies; 9+ messages in thread
From: Dan Moulding @ 2021-08-10 19:59 UTC (permalink / raw)
  To: dri-devel; +Cc: christian.koenig, ray.huang, jason, Dan Moulding

In 69de4421bb4c ("drm/ttm: Initialize debugfs from
ttm_global_init()"), ttm_global_init was changed so that if creation
of the debugfs global root directory fails, ttm_global_init will bail
out early and return an error, leading to initialization failure of
DRM drivers. However, not every system will be using debugfs. On such
a system, debugfs directory creation can be expected to fail, but DRM
drivers must still be usable. This changes it so that if creation of
TTM's debugfs root directory fails, then no biggie: keep calm and
carry on.

Fixes: 69de4421bb4c ("drm/ttm: Initialize debugfs from ttm_global_init()")
Signed-off-by: Dan Moulding <dmoulding@me.com>
---
 drivers/gpu/drm/ttm/ttm_device.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
index 74e3b460132b..2df59b3c2ea1 100644
--- a/drivers/gpu/drm/ttm/ttm_device.c
+++ b/drivers/gpu/drm/ttm/ttm_device.c
@@ -78,9 +78,7 @@ static int ttm_global_init(void)
 
 	ttm_debugfs_root = debugfs_create_dir("ttm", NULL);
 	if (IS_ERR(ttm_debugfs_root)) {
-		ret = PTR_ERR(ttm_debugfs_root);
 		ttm_debugfs_root = NULL;
-		goto out;
 	}
 
 	/* Limit the number of pages in the pool to about 50% of the total
-- 
2.31.1


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

* Re: [PATCH 1/1] drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails
  2021-08-10 19:59 ` [PATCH 1/1] drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails Dan Moulding
@ 2021-08-11  9:27   ` Huacai Chen
  2021-08-16  6:06   ` Huang Rui
  2021-08-16  7:40   ` Christian König
  2 siblings, 0 replies; 9+ messages in thread
From: Huacai Chen @ 2021-08-11  9:27 UTC (permalink / raw)
  To: Dan Moulding
  Cc: Maling list - DRI developers, Christian König, ray.huang, jason

Tested-by: Huacai Chen <chenhuacai@loongson.cn>

On Wed, Aug 11, 2021 at 6:42 AM Dan Moulding <dmoulding@me.com> wrote:
>
> In 69de4421bb4c ("drm/ttm: Initialize debugfs from
> ttm_global_init()"), ttm_global_init was changed so that if creation
> of the debugfs global root directory fails, ttm_global_init will bail
> out early and return an error, leading to initialization failure of
> DRM drivers. However, not every system will be using debugfs. On such
> a system, debugfs directory creation can be expected to fail, but DRM
> drivers must still be usable. This changes it so that if creation of
> TTM's debugfs root directory fails, then no biggie: keep calm and
> carry on.
>
> Fixes: 69de4421bb4c ("drm/ttm: Initialize debugfs from ttm_global_init()")
> Signed-off-by: Dan Moulding <dmoulding@me.com>
> ---
>  drivers/gpu/drm/ttm/ttm_device.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
> index 74e3b460132b..2df59b3c2ea1 100644
> --- a/drivers/gpu/drm/ttm/ttm_device.c
> +++ b/drivers/gpu/drm/ttm/ttm_device.c
> @@ -78,9 +78,7 @@ static int ttm_global_init(void)
>
>         ttm_debugfs_root = debugfs_create_dir("ttm", NULL);
>         if (IS_ERR(ttm_debugfs_root)) {
> -               ret = PTR_ERR(ttm_debugfs_root);
>                 ttm_debugfs_root = NULL;
> -               goto out;
>         }
>
>         /* Limit the number of pages in the pool to about 50% of the total
> --
> 2.31.1
>

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

* Re: [PATCH 0/1] Fix DRM driver initialization failure in kernel v5.14
  2021-08-10 19:59 [PATCH 0/1] Fix DRM driver initialization failure in kernel v5.14 Dan Moulding
  2021-08-10 19:59 ` [PATCH 1/1] drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails Dan Moulding
@ 2021-08-13 16:50 ` Dan Moulding
  2021-08-16  6:20   ` Huang Rui
  1 sibling, 1 reply; 9+ messages in thread
From: Dan Moulding @ 2021-08-13 16:50 UTC (permalink / raw)
  To: dmoulding; +Cc: christian.koenig, dri-devel, jason, ray.huang

Just a friendly reminder that this fix for a regression needs
review. It should be a quick review.

It would probably be good to ensure this gets in before the final 5.14
release, otherwise this is going to be a very visible regression for
anyone that uses DRM and does not use debugfs.

Thanks!

-- Dan

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

* Re: [PATCH 1/1] drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails
  2021-08-10 19:59 ` [PATCH 1/1] drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails Dan Moulding
  2021-08-11  9:27   ` Huacai Chen
@ 2021-08-16  6:06   ` Huang Rui
  2021-08-16  7:40   ` Christian König
  2 siblings, 0 replies; 9+ messages in thread
From: Huang Rui @ 2021-08-16  6:06 UTC (permalink / raw)
  To: Dan Moulding; +Cc: dri-devel, Koenig, Christian, jason, Alex Deucher

On Wed, Aug 11, 2021 at 03:59:06AM +0800, Dan Moulding wrote:
> In 69de4421bb4c ("drm/ttm: Initialize debugfs from
> ttm_global_init()"), ttm_global_init was changed so that if creation
> of the debugfs global root directory fails, ttm_global_init will bail
> out early and return an error, leading to initialization failure of
> DRM drivers. However, not every system will be using debugfs. On such
> a system, debugfs directory creation can be expected to fail, but DRM
> drivers must still be usable. This changes it so that if creation of
> TTM's debugfs root directory fails, then no biggie: keep calm and
> carry on.
> 
> Fixes: 69de4421bb4c ("drm/ttm: Initialize debugfs from ttm_global_init()")
> Signed-off-by: Dan Moulding <dmoulding@me.com>

It looks ok for me.

Reviewed-by: Huang Rui <ray.huang@amd.com>

Thanks,
Ray

> ---
>  drivers/gpu/drm/ttm/ttm_device.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
> index 74e3b460132b..2df59b3c2ea1 100644
> --- a/drivers/gpu/drm/ttm/ttm_device.c
> +++ b/drivers/gpu/drm/ttm/ttm_device.c
> @@ -78,9 +78,7 @@ static int ttm_global_init(void)
>  
>  	ttm_debugfs_root = debugfs_create_dir("ttm", NULL);
>  	if (IS_ERR(ttm_debugfs_root)) {
> -		ret = PTR_ERR(ttm_debugfs_root);
>  		ttm_debugfs_root = NULL;
> -		goto out;
>  	}
>  
>  	/* Limit the number of pages in the pool to about 50% of the total
> -- 
> 2.31.1
> 

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

* Re: [PATCH 0/1] Fix DRM driver initialization failure in kernel v5.14
  2021-08-13 16:50 ` [PATCH 0/1] Fix DRM driver initialization failure in kernel v5.14 Dan Moulding
@ 2021-08-16  6:20   ` Huang Rui
  2021-08-16 12:12     ` Christian König
  0 siblings, 1 reply; 9+ messages in thread
From: Huang Rui @ 2021-08-16  6:20 UTC (permalink / raw)
  To: Dan Moulding; +Cc: Koenig, Christian, dri-devel, jason, Alex Deucher

On Sat, Aug 14, 2021 at 12:50:14AM +0800, Dan Moulding wrote:
> Just a friendly reminder that this fix for a regression needs
> review. It should be a quick review.
> 
> It would probably be good to ensure this gets in before the final 5.14
> release, otherwise this is going to be a very visible regression for
> anyone that uses DRM and does not use debugfs.
> 

Just took a look at your patch, it's ok for me. Alex/Christian, could you
help to apply this fix if you have no concern?

Best Regards,
Ray

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

* Re: [PATCH 1/1] drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails
  2021-08-10 19:59 ` [PATCH 1/1] drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails Dan Moulding
  2021-08-11  9:27   ` Huacai Chen
  2021-08-16  6:06   ` Huang Rui
@ 2021-08-16  7:40   ` Christian König
  2021-08-16 14:28     ` Jason Ekstrand
  2 siblings, 1 reply; 9+ messages in thread
From: Christian König @ 2021-08-16  7:40 UTC (permalink / raw)
  To: Dan Moulding, dri-devel; +Cc: ray.huang, jason

Am 10.08.21 um 21:59 schrieb Dan Moulding:
> In 69de4421bb4c ("drm/ttm: Initialize debugfs from
> ttm_global_init()"), ttm_global_init was changed so that if creation
> of the debugfs global root directory fails, ttm_global_init will bail
> out early and return an error, leading to initialization failure of
> DRM drivers. However, not every system will be using debugfs. On such
> a system, debugfs directory creation can be expected to fail, but DRM
> drivers must still be usable. This changes it so that if creation of
> TTM's debugfs root directory fails, then no biggie: keep calm and
> carry on.
>
> Fixes: 69de4421bb4c ("drm/ttm: Initialize debugfs from ttm_global_init()")
> Signed-off-by: Dan Moulding <dmoulding@me.com>

Good point, patch is Reviewed-by: Christian König 
<christian.koenig@amd.com>.

Going to pick that up later today.

Regards,
Christian.

> ---
>   drivers/gpu/drm/ttm/ttm_device.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
> index 74e3b460132b..2df59b3c2ea1 100644
> --- a/drivers/gpu/drm/ttm/ttm_device.c
> +++ b/drivers/gpu/drm/ttm/ttm_device.c
> @@ -78,9 +78,7 @@ static int ttm_global_init(void)
>   
>   	ttm_debugfs_root = debugfs_create_dir("ttm", NULL);
>   	if (IS_ERR(ttm_debugfs_root)) {
> -		ret = PTR_ERR(ttm_debugfs_root);
>   		ttm_debugfs_root = NULL;
> -		goto out;
>   	}
>   
>   	/* Limit the number of pages in the pool to about 50% of the total


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

* Re: [PATCH 0/1] Fix DRM driver initialization failure in kernel v5.14
  2021-08-16  6:20   ` Huang Rui
@ 2021-08-16 12:12     ` Christian König
  0 siblings, 0 replies; 9+ messages in thread
From: Christian König @ 2021-08-16 12:12 UTC (permalink / raw)
  To: Huang Rui, Dan Moulding; +Cc: dri-devel, jason, Alex Deucher



Am 16.08.21 um 08:20 schrieb Huang Rui:
> On Sat, Aug 14, 2021 at 12:50:14AM +0800, Dan Moulding wrote:
>> Just a friendly reminder that this fix for a regression needs
>> review. It should be a quick review.
>>
>> It would probably be good to ensure this gets in before the final 5.14
>> release, otherwise this is going to be a very visible regression for
>> anyone that uses DRM and does not use debugfs.
>>
> Just took a look at your patch, it's ok for me. Alex/Christian, could you
> help to apply this fix if you have no concern?

Sorry for the delay, just came back from vacation today.

Patch is pushed to drm-misc-fixes and will hopefully still get into 5.14.

Thanks,
Christian.

>
> Best Regards,
> Ray


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

* Re: [PATCH 1/1] drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails
  2021-08-16  7:40   ` Christian König
@ 2021-08-16 14:28     ` Jason Ekstrand
  0 siblings, 0 replies; 9+ messages in thread
From: Jason Ekstrand @ 2021-08-16 14:28 UTC (permalink / raw)
  To: Christian König
  Cc: Dan Moulding, Maling list - DRI developers, Huang Rui

Makes sense

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

On Mon, Aug 16, 2021 at 2:40 AM Christian König
<christian.koenig@amd.com> wrote:
>
> Am 10.08.21 um 21:59 schrieb Dan Moulding:
> > In 69de4421bb4c ("drm/ttm: Initialize debugfs from
> > ttm_global_init()"), ttm_global_init was changed so that if creation
> > of the debugfs global root directory fails, ttm_global_init will bail
> > out early and return an error, leading to initialization failure of
> > DRM drivers. However, not every system will be using debugfs. On such
> > a system, debugfs directory creation can be expected to fail, but DRM
> > drivers must still be usable. This changes it so that if creation of
> > TTM's debugfs root directory fails, then no biggie: keep calm and
> > carry on.
> >
> > Fixes: 69de4421bb4c ("drm/ttm: Initialize debugfs from ttm_global_init()")
> > Signed-off-by: Dan Moulding <dmoulding@me.com>
>
> Good point, patch is Reviewed-by: Christian König
> <christian.koenig@amd.com>.
>
> Going to pick that up later today.
>
> Regards,
> Christian.
>
> > ---
> >   drivers/gpu/drm/ttm/ttm_device.c | 2 --
> >   1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
> > index 74e3b460132b..2df59b3c2ea1 100644
> > --- a/drivers/gpu/drm/ttm/ttm_device.c
> > +++ b/drivers/gpu/drm/ttm/ttm_device.c
> > @@ -78,9 +78,7 @@ static int ttm_global_init(void)
> >
> >       ttm_debugfs_root = debugfs_create_dir("ttm", NULL);
> >       if (IS_ERR(ttm_debugfs_root)) {
> > -             ret = PTR_ERR(ttm_debugfs_root);
> >               ttm_debugfs_root = NULL;
> > -             goto out;
> >       }
> >
> >       /* Limit the number of pages in the pool to about 50% of the total
>

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

end of thread, other threads:[~2021-08-16 14:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 19:59 [PATCH 0/1] Fix DRM driver initialization failure in kernel v5.14 Dan Moulding
2021-08-10 19:59 ` [PATCH 1/1] drm: ttm: Don't bail from ttm_global_init if debugfs_create_dir fails Dan Moulding
2021-08-11  9:27   ` Huacai Chen
2021-08-16  6:06   ` Huang Rui
2021-08-16  7:40   ` Christian König
2021-08-16 14:28     ` Jason Ekstrand
2021-08-13 16:50 ` [PATCH 0/1] Fix DRM driver initialization failure in kernel v5.14 Dan Moulding
2021-08-16  6:20   ` Huang Rui
2021-08-16 12:12     ` Christian König

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