All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Luca Barbieri <luca-Ukmtq+NC3rhBHFWNQifrYwC/G2K4zDHf@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH] drm/nouveau: fix missing spin_unlock in failure path
Date: Sat, 20 Feb 2010 22:35:15 +0100	[thread overview]
Message-ID: <20100220213515.GA8199@joi.lan> (raw)
In-Reply-To: <1266660536-10688-1-git-send-email-luca-Ukmtq+NC3rhBHFWNQifrYwC/G2K4zDHf@public.gmane.org>

On Sat, Feb 20, 2010 at 11:08:56AM +0100, Luca Barbieri wrote:
> Found by sparse.
> 
> Signed-off-by: Luca Barbieri <luca-Ukmtq+NC3rhBHFWNQifrYwC/G2K4zDHf@public.gmane.org>
> ---
>  drivers/gpu/drm/nouveau/nouveau_gem.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
> index 03d8935..d7ace31 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_gem.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
> @@ -557,11 +557,11 @@ nouveau_gem_pushbuf_reloc_apply(struct drm_device *dev,
>  
>  		spin_lock(&nvbo->bo.lock);
>  		ret = ttm_bo_wait(&nvbo->bo, false, false, false);
> +		spin_unlock(&nvbo->bo.lock);
>  		if (ret) {
>  			NV_ERROR(dev, "reloc wait_idle failed: %d\n", ret);
>  			break;
>  		}
> -		spin_unlock(&nvbo->bo.lock);
>  
>  		nouveau_bo_wr32(nvbo, r->reloc_bo_offset >> 2, data);
>  	}
> -- 

just FYI - i hit this code two times today
without this patch:

Feb 20 20:08:49 [kernel] [21713.664339] [drm] nouveau 0000:02:00.0: PFIFO_DMA_PUSHER - Ch 3
Feb 20 20:08:52 [kernel] [21716.949829] [drm] nouveau 0000:02:00.0: reloc wait_idle failed: -16
Feb 20 20:08:52 [kernel] [21716.949832] [drm] nouveau 0000:02:00.0: reloc apply: -16
Feb 20 20:08:52 [kernel] [21716.949835] BUG: sleeping function called from invalid context at arch/x86/mm/mmio-mod.c:332
Feb 20 20:08:52 [kernel] [21716.949838] in_atomic(): 1, irqs_disabled(): 0, pid: 2613, name: X
Feb 20 20:08:52 [kernel] [21716.949841] Pid: 2613, comm: X Not tainted 2.6.32-nv5 #253
Feb 20 20:08:52 [kernel] [21716.949843] Call Trace:
Feb 20 20:08:52 [kernel] [21716.949851]  [<ffffffff8103722e>] __might_sleep+0x10a/0x10e
Feb 20 20:08:52 [kernel] [21716.949855]  [<ffffffff8102ce24>] mmiotrace_iounmap+0x21/0x10d
Feb 20 20:08:52 [kernel] [21716.949859]  [<ffffffff810351ee>] ? __wake_up+0x3f/0x48
Feb 20 20:08:52 [kernel] [21716.949863]  [<ffffffff8102820f>] iounmap+0x44/0xca
Feb 20 20:08:52 [kernel] [21716.949870]  [<ffffffffa00bc4c7>] ttm_bo_kunmap+0x36/0x56 [ttm]
Feb 20 20:08:52 [kernel] [21716.949881]  [<ffffffffa00d80dc>] validate_fini_list+0x88/0xfc [nouveau]
Feb 20 20:08:52 [kernel] [21716.949885]  [<ffffffff813c47e1>] ? printk+0x3c/0x3e
Feb 20 20:08:52 [kernel] [21716.949894]  [<ffffffffa00d817c>] validate_fini+0x2c/0x31 [nouveau]
Feb 20 20:08:52 [kernel] [21716.949903]  [<ffffffffa00d8e70>] nouveau_gem_ioctl_pushbuf+0xcef/0xdd2 [nouveau]
Feb 20 20:08:52 [kernel] [21716.949912]  [<ffffffffa0074f3b>] drm_ioctl+0x25f/0x314 [drm]
Feb 20 20:08:52 [kernel] [21716.949921]  [<ffffffffa00d8181>] ? nouveau_gem_ioctl_pushbuf+0x0/0xdd2 [nouveau]
Feb 20 20:08:52 [kernel] [21716.949927]  [<ffffffff810dcb2d>] vfs_ioctl+0x1d/0x82
Feb 20 20:08:52 [kernel] [21716.949931]  [<ffffffff810dd0ca>] do_vfs_ioctl+0x4c1/0x507
Feb 20 20:08:52 [kernel] [21716.949934]  [<ffffffff81039071>] ? sub_preempt_count+0x9e/0xb2
Feb 20 20:08:52 [kernel] [21716.949938]  [<ffffffff810dd152>] sys_ioctl+0x42/0x65
Feb 20 20:08:52 [kernel] [21716.949942]  [<ffffffff8100af6b>] system_call_fastpath+0x16/0x1b
+ lots of "scheduling while atomic" and lockup

with this patch:
Feb 20 22:16:50 [kernel] [ 5471.144533] [drm] nouveau 0000:02:00.0: PFIFO_DMA_PUSHER - Ch 3
Feb 20 22:16:53 [kernel] [ 5474.361086] [drm] nouveau 0000:02:00.0: reloc wait_idle failed: -16
Feb 20 22:16:53 [kernel] [ 5474.361089] [drm] nouveau 0000:02:00.0: reloc apply: -16
and silent lockup

so it's an improvement :)

  parent reply	other threads:[~2010-02-20 21:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-20 10:08 [PATCH] drm/nouveau: fix missing spin_unlock in failure path Luca Barbieri
     [not found] ` <1266660536-10688-1-git-send-email-luca-Ukmtq+NC3rhBHFWNQifrYwC/G2K4zDHf@public.gmane.org>
2010-02-20 21:35   ` Marcin Slusarz [this message]
2010-02-21  0:00   ` Francisco Jerez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100220213515.GA8199@joi.lan \
    --to=marcin.slusarz-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=luca-Ukmtq+NC3rhBHFWNQifrYwC/G2K4zDHf@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.