From e2e77098764636456ba7092a8b3b3b34b2a8e8d8 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Thu, 26 May 2011 16:25:58 -0700 Subject: edac,rcu: use synchronize_rcu() instead of call_rcu()+rcu_barrier() synchronize_rcu() does the stuff as needed. Signed-off-by: Lai Jiangshan Cc: Doug Thompson Cc: "Paul E. McKenney" Cc: Mauro Carvalho Chehab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/edac/edac_device.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'drivers/edac/edac_device.c') diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index a7408cf86f37..c3f67437afb6 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c @@ -345,31 +345,19 @@ fail1: return 1; } -/* - * complete_edac_device_list_del - * - * callback function when reference count is zero - */ -static void complete_edac_device_list_del(struct rcu_head *head) -{ - struct edac_device_ctl_info *edac_dev; - - edac_dev = container_of(head, struct edac_device_ctl_info, rcu); - INIT_LIST_HEAD(&edac_dev->link); -} - /* * del_edac_device_from_global_list - * - * remove the RCU, setup for a callback call, - * then wait for the callback to occur */ static void del_edac_device_from_global_list(struct edac_device_ctl_info *edac_device) { list_del_rcu(&edac_device->link); - call_rcu(&edac_device->rcu, complete_edac_device_list_del); - rcu_barrier(); + + /* these are for safe removal of devices from global list while + * NMI handlers may be traversing list + */ + synchronize_rcu(); + INIT_LIST_HEAD(&edac_device->link); } /* -- cgit v1.2.3-59-g8ed1b