From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk,
Marcin Slusarz <marcin.slusarz@gmail.com>,
Ben Skeggs <bskeggs@redhat.com>
Subject: [06/26] drm/nouveau: initialize chan->fence.lock before use
Date: Fri, 18 Nov 2011 15:58:19 -0800 [thread overview]
Message-ID: <20111119000004.502633461@clark.kroah.org> (raw)
In-Reply-To: <20111119000026.GA6679@kroah.com>
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcin Slusarz <marcin.slusarz@gmail.com>
commit 5e60ee780e792efe6dce97eceb110b1d30bab850 upstream.
Fence lock needs to be initialized before any call to nouveau_channel_put
because it calls nouveau_channel_idle->nouveau_fence_update which uses
fence lock.
BUG: spinlock bad magic on CPU#0, test/24134
lock: ffff88019f90dba8, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
Pid: 24134, comm: test Not tainted 3.0.0-nv+ #800
Call Trace:
spin_bug+0x9c/0xa3
do_raw_spin_lock+0x29/0x13c
_raw_spin_lock+0x1e/0x22
nouveau_fence_update+0x2d/0xf1
nouveau_channel_idle+0x22/0xa0
nouveau_channel_put_unlocked+0x84/0x1bd
nouveau_channel_put+0x20/0x24
nouveau_channel_alloc+0x4ec/0x585
nouveau_ioctl_fifo_alloc+0x50/0x130
drm_ioctl+0x289/0x361
do_vfs_ioctl+0x4dd/0x52c
sys_ioctl+0x42/0x65
system_call_fastpath+0x16/0x1b
It's easily triggerable from userspace.
Additionally remove double initialization of chan->fence.pending.
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/gpu/drm/nouveau/nouveau_channel.c | 1 +
drivers/gpu/drm/nouveau/nouveau_fence.c | 2 --
2 files changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/gpu/drm/nouveau/nouveau_channel.c
+++ b/drivers/gpu/drm/nouveau/nouveau_channel.c
@@ -159,6 +159,7 @@ nouveau_channel_alloc(struct drm_device
INIT_LIST_HEAD(&chan->nvsw.vbl_wait);
INIT_LIST_HEAD(&chan->nvsw.flip);
INIT_LIST_HEAD(&chan->fence.pending);
+ spin_lock_init(&chan->fence.lock);
/* Allocate DMA push buffer */
chan->pushbuf_bo = nouveau_channel_user_pushbuf_alloc(dev);
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
@@ -542,8 +542,6 @@ nouveau_fence_channel_init(struct nouvea
return ret;
}
- INIT_LIST_HEAD(&chan->fence.pending);
- spin_lock_init(&chan->fence.lock);
atomic_set(&chan->fence.last_sequence_irq, 0);
return 0;
}
next prev parent reply other threads:[~2011-11-19 0:09 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-19 0:00 [00/26] 3.0.10-stable review Greg KH
2011-11-18 23:58 ` [01/26] ALSA: hda - Dont add elements of other codecs to vmaster slave Greg KH
2011-11-18 23:58 ` [02/26] virtio-pci: fix use after free Greg KH
2011-11-18 23:58 ` [03/26] ASoC: Dont use wm8994->control_data in wm8994_readable_register() Greg KH
2011-11-18 23:58 ` [04/26] sh: Fix cached/uncaced address calculation in 29bit mode Greg KH
2011-11-18 23:58 ` [05/26] drm/i915: Fix object refcount leak on mmappable size limit error path Greg KH
2011-11-18 23:58 ` Greg KH [this message]
2011-11-18 23:58 ` [07/26] drm/radeon/kms: make an aux failure debug only Greg KH
2011-11-18 23:58 ` [08/26] ALSA: usb-audio - Check the dB-range validity in the later read, too Greg KH
2011-11-18 23:58 ` [09/26] ALSA: usb-audio - Fix the missing volume quirks at delayed init Greg KH
2011-11-18 23:58 ` [10/26] KEYS: Fix a NULL pointer deref in the user-defined key type Greg KH
2011-11-18 23:58 ` [11/26] hfs: add sanity check for file name length Greg KH
2011-11-18 23:58 ` [12/26] Revert "leds: save the delay values after a successful call to blink_set()" Greg KH
2011-11-18 23:58 ` [13/26] drm/radeon: add some missing FireMV pci ids Greg KH
2011-11-18 23:58 ` [14/26] drm/i915: enable ring freq scaling, RC6 and graphics turbo on Ivy Bridge v3 Greg KH
2011-11-18 23:58 ` [15/26] sfi: table irq 0xFF means no interrupt Greg KH
2011-11-18 23:58 ` [16/26] x86, mrst: use a temporary variable for SFI irq Greg KH
2011-11-18 23:58 ` [17/26] b43: refuse to load unsupported firmware Greg KH
2011-11-18 23:58 ` [18/26] md/raid5: abort any pending parity operations when array fails Greg KH
2011-11-18 23:58 ` [19/26] mfd: Fix twl4030 dependencies for audio codec Greg KH
2011-11-18 23:58 ` [20/26] xen:pvhvm: enable PVHVM VCPU placement when using more than 32 CPUs Greg KH
2011-11-18 23:58 ` [21/26] xen-gntalloc: integer overflow in gntalloc_ioctl_alloc() Greg KH
2011-11-18 23:58 ` [22/26] xen-gntalloc: signedness bug in add_grefs() Greg KH
2011-11-18 23:58 ` [23/26] powerpc/ps3: Fix lost SMP IPIs Greg KH
2011-11-18 23:58 ` [24/26] powerpc: Copy down exception vectors after feature fixups Greg KH
2011-11-18 23:58 ` [25/26] backing-dev: ensure wakeup_timer is deleted Greg KH
2011-11-18 23:58 ` [26/26] block: Always check length of all iov entries in blk_rq_map_user_iov() Greg KH
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=20111119000004.502633461@clark.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=bskeggs@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcin.slusarz@gmail.com \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.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 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®