Commit f8fbcd3b authored by Corey Minyard's avatar Corey Minyard Committed by Linus Torvalds

IPMI: remove bogus semaphore from watchdog

Lockdep was giving an error when loading the IPMI watchdog module.  It turns
out that if you try to claim a lock in a parameter handling routine, lockdep
won't see that lock as "static" yet because the module is not yet on the
module list, so it will complain.

However, the semaphore in question is completely unnecessary.  So just remove
it.
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c45adc39
...@@ -166,8 +166,6 @@ static char expect_close; ...@@ -166,8 +166,6 @@ static char expect_close;
static int ifnum_to_use = -1; static int ifnum_to_use = -1;
static DECLARE_RWSEM(register_sem);
/* Parameters to ipmi_set_timeout */ /* Parameters to ipmi_set_timeout */
#define IPMI_SET_TIMEOUT_NO_HB 0 #define IPMI_SET_TIMEOUT_NO_HB 0
#define IPMI_SET_TIMEOUT_HB_IF_NECESSARY 1 #define IPMI_SET_TIMEOUT_HB_IF_NECESSARY 1
...@@ -193,11 +191,9 @@ static int set_param_int(const char *val, struct kernel_param *kp) ...@@ -193,11 +191,9 @@ static int set_param_int(const char *val, struct kernel_param *kp)
if (endp == val) if (endp == val)
return -EINVAL; return -EINVAL;
down_read(&register_sem);
*((int *)kp->arg) = l; *((int *)kp->arg) = l;
if (watchdog_user) if (watchdog_user)
rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY); rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY);
up_read(&register_sem);
return rv; return rv;
} }
...@@ -226,17 +222,15 @@ static int set_param_str(const char *val, struct kernel_param *kp) ...@@ -226,17 +222,15 @@ static int set_param_str(const char *val, struct kernel_param *kp)
s = strstrip(valcp); s = strstrip(valcp);
down_read(&register_sem);
rv = fn(s, NULL); rv = fn(s, NULL);
if (rv) if (rv)
goto out_unlock; goto out;
check_parms(); check_parms();
if (watchdog_user) if (watchdog_user)
rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY); rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY);
out_unlock: out:
up_read(&register_sem);
return rv; return rv;
} }
...@@ -895,7 +889,6 @@ static void ipmi_register_watchdog(int ipmi_intf) ...@@ -895,7 +889,6 @@ static void ipmi_register_watchdog(int ipmi_intf)
{ {
int rv = -EBUSY; int rv = -EBUSY;
down_write(&register_sem);
if (watchdog_user) if (watchdog_user)
goto out; goto out;
...@@ -922,8 +915,6 @@ static void ipmi_register_watchdog(int ipmi_intf) ...@@ -922,8 +915,6 @@ static void ipmi_register_watchdog(int ipmi_intf)
} }
out: out:
up_write(&register_sem);
if ((start_now) && (rv == 0)) { if ((start_now) && (rv == 0)) {
/* Run from startup, so start the timer now. */ /* Run from startup, so start the timer now. */
start_now = 0; /* Disable this function after first startup. */ start_now = 0; /* Disable this function after first startup. */
...@@ -937,8 +928,6 @@ static void ipmi_unregister_watchdog(int ipmi_intf) ...@@ -937,8 +928,6 @@ static void ipmi_unregister_watchdog(int ipmi_intf)
{ {
int rv; int rv;
down_write(&register_sem);
if (!watchdog_user) if (!watchdog_user)
goto out; goto out;
...@@ -963,7 +952,7 @@ static void ipmi_unregister_watchdog(int ipmi_intf) ...@@ -963,7 +952,7 @@ static void ipmi_unregister_watchdog(int ipmi_intf)
watchdog_user = NULL; watchdog_user = NULL;
out: out:
up_write(&register_sem); return;
} }
#ifdef HAVE_NMI_HANDLER #ifdef HAVE_NMI_HANDLER
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment