video: sm501fb: Early initialization of mm_lock mutex.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Saturday, July 4, 2009 - 2:00 pm

Gitweb:     http://git.kernel.org/linus/f50bf2b2f5e83b794e0bdb2f3f589f55ef0d52d0
Commit:     f50bf2b2f5e83b794e0bdb2f3f589f55ef0d52d0
Parent:     de481ba925e880764e38b8756c93c05006892507
Author:     Paul Mundt <lethal@linux-sh.org>
AuthorDate: Fri Jul 3 15:45:56 2009 +0900
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Sat Jul 4 10:39:06 2009 -0700

    video: sm501fb: Early initialization of mm_lock mutex.
    
    Commit 537a1bf059fa312355696fa6db80726e655e7f17 (fbdev: add mutex for
    fb_mmap locking) introduces a ->mm_lock mutex for protecting smem
    assignments. Unfortunately in the case of sm501fb these happen quite
    early in the initialization code, well before the mutex_init() that takes
    place in register_framebuffer(), leading to:
    
       Badness at kernel/mutex.c:207
    
       Pid : 1, Comm:          swapper
       CPU : 0                 Not tainted  (2.6.31-rc1-00284-g529ba0d-dirty #2273)
    
       PC is at __mutex_lock_slowpath+0x72/0x1bc
       PR is at __mutex_lock_slowpath+0x66/0x1bc
       ...
    
    matroxfb appears to have the same issue and has solved it with an early
    mutex_init(), so we do the same for sm501fb.
    
    Signed-off-by: Paul Mundt <lethal@linux-sh.org>
    Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 drivers/video/sm501fb.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index 98f24f0..16d4f4c 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -1624,6 +1624,8 @@ static int __devinit sm501fb_start_one(struct sm501fb_info *info,
 	if (!fbi)
 		return 0;
 
+	mutex_init(&info->fb[head]->mm_lock);
+
 	ret = sm501fb_init_fb(info->fb[head], head, drvname);
 	if (ret) {
 		dev_err(info->dev, "cannot initialise fb %s\n", drvname);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
video: sm501fb: Early initialization of mm_lock mutex., Linux Kernel Mailing List..., (Sat Jul 4, 2:00 pm)