[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-d63c489b881707adf9c0b89f771b30a1d78f4197@git.kernel.org>
Date: Wed, 14 Oct 2009 15:45:49 GMT
From: tip-bot for Thomas Gleixner <tglx@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: jdike@...toit.com, linux-kernel@...r.kernel.org, hpa@...or.com,
mingo@...hat.com, tglx@...utronix.de
Subject: [tip:bkl/arch] um: Remove BKL from mmapper
Commit-ID: d63c489b881707adf9c0b89f771b30a1d78f4197
Gitweb: http://git.kernel.org/tip/d63c489b881707adf9c0b89f771b30a1d78f4197
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Sat, 10 Oct 2009 15:36:34 +0000
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Wed, 14 Oct 2009 15:35:51 +0200
um: Remove BKL from mmapper
cycle_kernel_lock() was added during the big BKL pushdown. It should
ensure the serializiation against driver init code.
mmapper_open() cannot be called before misc_register() succeeded, but
p_buf might be uninitialized.
Move the initialization of p_buf before the misc_register() call and
get rid of cycle_kernel_lock().
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
LKML-Reference: <20091010153349.682213670@...utronix.de>
Cc: Jeff Dike <jdike@...toit.com>
---
arch/um/drivers/mmapper_kern.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c
index eb24032..d22f9e5 100644
--- a/arch/um/drivers/mmapper_kern.c
+++ b/arch/um/drivers/mmapper_kern.c
@@ -16,7 +16,7 @@
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/mm.h>
-#include <linux/smp_lock.h>
+
#include <asm/uaccess.h>
#include "mem_user.h"
@@ -78,7 +78,6 @@ out:
static int mmapper_open(struct inode *inode, struct file *file)
{
- cycle_kernel_lock();
return 0;
}
@@ -115,18 +114,16 @@ static int __init mmapper_init(void)
v_buf = (char *) find_iomem("mmapper", &mmapper_size);
if (mmapper_size == 0) {
printk(KERN_ERR "mmapper_init - find_iomem failed\n");
- goto out;
+ return -ENODEV;
}
+ p_buf = __pa(v_buf);
err = misc_register(&mmapper_dev);
if (err) {
printk(KERN_ERR "mmapper - misc_register failed, err = %d\n",
err);
- goto out;
+ return err;;
}
-
- p_buf = __pa(v_buf);
-out:
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists