All of lore.kernel.org
 help / color / mirror / Atom feed
* - ipmi-fix-some-rcu-problems-update.patch removed from -mm tree
@ 2007-02-10  8:17 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2007-02-10  8:17 UTC (permalink / raw)
  To: minyard, mm-commits


The patch titled
     IPMI: Fix some RCU problems (update)
has been removed from the -mm tree.  Its filename was
     ipmi-fix-some-rcu-problems-update.patch

This patch was dropped because it was folded into ipmi-fix-some-rcu-problems.patch

------------------------------------------------------
Subject: IPMI: Fix some RCU problems (update)
From: Corey Minyard <minyard@acm.org>

Andrew asked that the open-coded barriers be commented, so here it
is.  I also realized that one of the read barriers was in an area
where the protecting mutex was held, so no read barrier was needed.

Signed-off-by: Corey Minyard <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/char/ipmi/ipmi_msghandler.c |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff -puN drivers/char/ipmi/ipmi_msghandler.c~ipmi-fix-some-rcu-problems-update drivers/char/ipmi/ipmi_msghandler.c
--- a/drivers/char/ipmi/ipmi_msghandler.c~ipmi-fix-some-rcu-problems-update
+++ a/drivers/char/ipmi/ipmi_msghandler.c
@@ -839,7 +839,6 @@ int ipmi_create_user(unsigned int       
 	goto out_kfree;
 
  found:
-	smp_rmb();
 	/* Note that each existing user holds a refcount to the interface. */
 	kref_get(&intf->refcount);
 
@@ -2762,10 +2761,15 @@ int ipmi_register_smi(struct ipmi_smi_ha
 		synchronize_rcu();
 		kref_put(&intf->refcount, intf_free);
 	} else {
-		/* After this point the interface is legal to use. */
-		smp_wmb(); /* Keep memory order straight for RCU readers. */
+		/*
+		 * Keep memory order straight for RCU readers.  Make
+		 * sure everything else is committed to memory before
+		 * setting intf_num to mark the interface valid.
+		 */
+		smp_wmb();
 		intf->intf_num = i;
 		mutex_unlock(&ipmi_interfaces_mutex);
+		/* After this point the interface is legal to use. */
 		call_smi_watchers(i, intf->si_dev);
 		mutex_unlock(&smi_watchers_mutex);
 	}
@@ -3926,6 +3930,12 @@ static void send_panic_events(char *str)
 			/* Interface was not ready yet. */
 			continue;
 
+		/*
+		 * intf_num is used as an marker to tell if the
+		 * interface is valid.  Thus we need a read barrier to
+		 * make sure data fetched before checking intf_num
+		 * won't be used.
+		 */
 		smp_rmb();
 
 		/* First job here is to figure out where to send the
_

Patches currently in -mm which might be from minyard@acm.org are

add-an-rcu-version-of-list-splicing.patch
ipmi-fix-some-rcu-problems.patch
ipmi-fix-some-rcu-problems-update.patch
proc-remove-useless-and-buggy-nlink-settings.patch
sysctl-ipmi-remove-unnecessary-insert_at_head-flag.patch
sysctl-remove-insert_at_head-from-register_sysctl.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-10  8:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-10  8:17 - ipmi-fix-some-rcu-problems-update.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.