mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/7] IPMI: remove bogus semaphore from watchdog
Date: Fri, 12 Oct 2007 11:38:39 -0500	[thread overview]
Message-ID: <20071012163839.GB22142@minyard.local> (raw)


From: Corey Minyard <cminyard@mvista.com>

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.

Not needed for the stable kernel.

Signed-off-by: Corey Minyard <cminyard@mvista.com>

---
Index: linux-2.6.21/drivers/char/ipmi/ipmi_watchdog.c
===================================================================
--- linux-2.6.21.orig/drivers/char/ipmi/ipmi_watchdog.c
+++ linux-2.6.21/drivers/char/ipmi/ipmi_watchdog.c
@@ -164,8 +164,6 @@ static char expect_close;
 
 static int ifnum_to_use = -1;
 
-static DECLARE_RWSEM(register_sem);
-
 /* Parameters to ipmi_set_timeout */
 #define IPMI_SET_TIMEOUT_NO_HB			0
 #define IPMI_SET_TIMEOUT_HB_IF_NECESSARY	1
@@ -191,11 +189,9 @@ static int set_param_int(const char *val
 	if (endp == val)
 		return -EINVAL;
 
-	down_read(&register_sem);
 	*((int *)kp->arg) = l;
 	if (watchdog_user)
 		rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY);
-	up_read(&register_sem);
 
 	return rv;
 }
@@ -224,17 +220,15 @@ static int set_param_str(const char *val
 
 	s = strstrip(valcp);
 
-	down_read(&register_sem);
 	rv = fn(s, NULL);
 	if (rv)
-		goto out_unlock;
+		goto out;
 
 	check_parms();
 	if (watchdog_user)
 		rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY);
 
- out_unlock:
-	up_read(&register_sem);
+ out:
 	return rv;
 }
 
@@ -893,7 +887,6 @@ static void ipmi_register_watchdog(int i
 {
 	int rv = -EBUSY;
 
-	down_write(&register_sem);
 	if (watchdog_user)
 		goto out;
 
@@ -920,8 +913,6 @@ static void ipmi_register_watchdog(int i
 	}
 
  out:
-	up_write(&register_sem);
-
 	if ((start_now) && (rv == 0)) {
 		/* Run from startup, so start the timer now. */
 		start_now = 0; /* Disable this function after first startup. */
@@ -935,8 +926,6 @@ static void ipmi_unregister_watchdog(int
 {
 	int rv;
 
-	down_write(&register_sem);
-
 	if (!watchdog_user)
 		goto out;
 
@@ -961,7 +950,7 @@ static void ipmi_unregister_watchdog(int
 	watchdog_user = NULL;
 
  out:
-	up_write(&register_sem);
+	return;
 }
 
 #ifdef HAVE_NMI_HANDLER

                 reply	other threads:[~2007-10-12 16:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20071012163839.GB22142@minyard.local \
    --to=minyard@acm.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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®