mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] nouveau: Fix crash after D3
@ 2012-11-06 14:03 Daniel J Blueman
  2012-11-07 18:48 ` Marcin Slusarz
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel J Blueman @ 2012-11-06 14:03 UTC (permalink / raw)
  To: David Airlie
  Cc: Marcin Slusarz, dri-devel, linux-kernel, nouveau, Daniel J Blueman

In 3.7-rc4, when starting X with the integrated GPU and suspending the discrete GPU,
after one or more 32-bit applications are used (eg Skype) and X is stopped,
we hit a panic.

Prevent this by testing if the fini function is valid.

Full panic bootlog is at: http://quora.org/2012/nouveau/dmesg-crash.txt
Xorg.log is at: http://quora.org/2012/nouveau/Xorg.0.log-crash.txt
Kernel log after fix is at: http://quora.org/2012/nouveau/dmesg-fix.txt

Signed-off-by: Daniel J Blueman <daniel@quora.org>
---
 drivers/gpu/drm/nouveau/core/core/object.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/core/core/object.c b/drivers/gpu/drm/nouveau/core/core/object.c
index 0daab62..3da3525 100644
--- a/drivers/gpu/drm/nouveau/core/core/object.c
+++ b/drivers/gpu/drm/nouveau/core/core/object.c
@@ -354,12 +354,16 @@ static int
 nouveau_object_decf(struct nouveau_object *object)
 {
 	int ret;
+	struct nouveau_ofuncs *pfuncs;
 
 	nv_trace(object, "stopping...\n");
 
-	ret = nv_ofuncs(object)->fini(object, false);
-	if (ret)
-		nv_warn(object, "failed fini, %d\n", ret);
+	pfuncs = nv_ofuncs(object);
+	if (pfuncs->fini) {
+		ret = nv_ofuncs(object)->fini(object, false);
+		if (ret)
+			nv_warn(object, "failed fini, %d\n", ret);
+	}
 
 	if (object->engine) {
 		mutex_lock(&nv_subdev(object->engine)->mutex);
-- 
1.7.10.4


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

* Re: [PATCH] nouveau: Fix crash after D3
  2012-11-06 14:03 [PATCH] nouveau: Fix crash after D3 Daniel J Blueman
@ 2012-11-07 18:48 ` Marcin Slusarz
  0 siblings, 0 replies; 2+ messages in thread
From: Marcin Slusarz @ 2012-11-07 18:48 UTC (permalink / raw)
  To: Daniel J Blueman; +Cc: David Airlie, dri-devel, linux-kernel, nouveau

On Tue, Nov 06, 2012 at 10:03:40PM +0800, Daniel J Blueman wrote:
> In 3.7-rc4, when starting X with the integrated GPU and suspending the discrete GPU,
> after one or more 32-bit applications are used (eg Skype) and X is stopped,
> we hit a panic.
> 
> Prevent this by testing if the fini function is valid.

It's a bit weird. Can you explain better what is going on?
Why do we try to destroy this object (with NULL fini) only when GPU is
suspended? Maybe it means we are leaking this object on normal close/destroy?
Did you test what happens when you resume nv GPU after stopping X?

> Full panic bootlog is at: http://quora.org/2012/nouveau/dmesg-crash.txt
> Xorg.log is at: http://quora.org/2012/nouveau/Xorg.0.log-crash.txt
> Kernel log after fix is at: http://quora.org/2012/nouveau/dmesg-fix.txt
> 
> Signed-off-by: Daniel J Blueman <daniel@quora.org>
> ---
>  drivers/gpu/drm/nouveau/core/core/object.c |   10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/core/core/object.c b/drivers/gpu/drm/nouveau/core/core/object.c
> index 0daab62..3da3525 100644
> --- a/drivers/gpu/drm/nouveau/core/core/object.c
> +++ b/drivers/gpu/drm/nouveau/core/core/object.c
> @@ -354,12 +354,16 @@ static int
>  nouveau_object_decf(struct nouveau_object *object)
>  {
>  	int ret;
> +	struct nouveau_ofuncs *pfuncs;
>  
>  	nv_trace(object, "stopping...\n");
>  
> -	ret = nv_ofuncs(object)->fini(object, false);
> -	if (ret)
> -		nv_warn(object, "failed fini, %d\n", ret);
> +	pfuncs = nv_ofuncs(object);
> +	if (pfuncs->fini) {
> +		ret = nv_ofuncs(object)->fini(object, false);
> +		if (ret)
> +			nv_warn(object, "failed fini, %d\n", ret);
> +	}
>  
>  	if (object->engine) {
>  		mutex_lock(&nv_subdev(object->engine)->mutex);
> -- 
> 1.7.10.4
> 

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

end of thread, other threads:[~2012-11-07 18:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-06 14:03 [PATCH] nouveau: Fix crash after D3 Daniel J Blueman
2012-11-07 18:48 ` Marcin Slusarz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®