diff options
author | Corey Minyard <cminyard@mvista.com> | 2007-10-18 06:07:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 17:37:32 -0400 |
commit | f8fbcd3b9da5830fded133dbeb7066b1b92ee736 (patch) | |
tree | 7967280913d05d2d506a7929d6467dc7c0ceb4b2 /drivers/char/ipmi/ipmi_watchdog.c | |
parent | c45adc39156dfb0a296df218d62ba8b68cadf12e (diff) |
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: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/ipmi/ipmi_watchdog.c')
-rw-r--r-- | drivers/char/ipmi/ipmi_watchdog.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 41f78e2c158f..806106b8c980 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c | |||
@@ -166,8 +166,6 @@ static char expect_close; | |||
166 | 166 | ||
167 | static int ifnum_to_use = -1; | 167 | static int ifnum_to_use = -1; |
168 | 168 | ||
169 | static DECLARE_RWSEM(register_sem); | ||
170 | |||
171 | /* Parameters to ipmi_set_timeout */ | 169 | /* Parameters to ipmi_set_timeout */ |
172 | #define IPMI_SET_TIMEOUT_NO_HB 0 | 170 | #define IPMI_SET_TIMEOUT_NO_HB 0 |
173 | #define IPMI_SET_TIMEOUT_HB_IF_NECESSARY 1 | 171 | #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 | if (endp == val) | 191 | if (endp == val) |
194 | return -EINVAL; | 192 | return -EINVAL; |
195 | 193 | ||
196 | down_read(®ister_sem); | ||
197 | *((int *)kp->arg) = l; | 194 | *((int *)kp->arg) = l; |
198 | if (watchdog_user) | 195 | if (watchdog_user) |
199 | rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY); | 196 | rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY); |
200 | up_read(®ister_sem); | ||
201 | 197 | ||
202 | return rv; | 198 | return rv; |
203 | } | 199 | } |
@@ -226,17 +222,15 @@ static int set_param_str(const char *val, struct kernel_param *kp) | |||
226 | 222 | ||
227 | s = strstrip(valcp); | 223 | s = strstrip(valcp); |
228 | 224 | ||
229 | down_read(®ister_sem); | ||
230 | rv = fn(s, NULL); | 225 | rv = fn(s, NULL); |
231 | if (rv) | 226 | if (rv) |
232 | goto out_unlock; | 227 | goto out; |
233 | 228 | ||
234 | check_parms(); | 229 | check_parms(); |
235 | if (watchdog_user) | 230 | if (watchdog_user) |
236 | rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY); | 231 | rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY); |
237 | 232 | ||
238 | out_unlock: | 233 | out: |
239 | up_read(®ister_sem); | ||
240 | return rv; | 234 | return rv; |
241 | } | 235 | } |
242 | 236 | ||
@@ -895,7 +889,6 @@ static void ipmi_register_watchdog(int ipmi_intf) | |||
895 | { | 889 | { |
896 | int rv = -EBUSY; | 890 | int rv = -EBUSY; |
897 | 891 | ||
898 | down_write(®ister_sem); | ||
899 | if (watchdog_user) | 892 | if (watchdog_user) |
900 | goto out; | 893 | goto out; |
901 | 894 | ||
@@ -922,8 +915,6 @@ static void ipmi_register_watchdog(int ipmi_intf) | |||
922 | } | 915 | } |
923 | 916 | ||
924 | out: | 917 | out: |
925 | up_write(®ister_sem); | ||
926 | |||
927 | if ((start_now) && (rv == 0)) { | 918 | if ((start_now) && (rv == 0)) { |
928 | /* Run from startup, so start the timer now. */ | 919 | /* Run from startup, so start the timer now. */ |
929 | start_now = 0; /* Disable this function after first startup. */ | 920 | start_now = 0; /* Disable this function after first startup. */ |
@@ -937,8 +928,6 @@ static void ipmi_unregister_watchdog(int ipmi_intf) | |||
937 | { | 928 | { |
938 | int rv; | 929 | int rv; |
939 | 930 | ||
940 | down_write(®ister_sem); | ||
941 | |||
942 | if (!watchdog_user) | 931 | if (!watchdog_user) |
943 | goto out; | 932 | goto out; |
944 | 933 | ||
@@ -963,7 +952,7 @@ static void ipmi_unregister_watchdog(int ipmi_intf) | |||
963 | watchdog_user = NULL; | 952 | watchdog_user = NULL; |
964 | 953 | ||
965 | out: | 954 | out: |
966 | up_write(®ister_sem); | 955 | return; |
967 | } | 956 | } |
968 | 957 | ||
969 | #ifdef HAVE_NMI_HANDLER | 958 | #ifdef HAVE_NMI_HANDLER |