Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252064
b: refs/heads/master
c: e2e7709
h: refs/heads/master
v: v3
  • Loading branch information
Lai Jiangshan authored and Linus Torvalds committed May 27, 2011
1 parent 963ef04 commit 6ea1741
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 56 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 26498e89e83c62cffcb8836a2ac2c5b795d84258
refs/heads/master: e2e77098764636456ba7092a8b3b3b34b2a8e8d8
12 changes: 0 additions & 12 deletions trunk/drivers/edac/edac_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,6 @@ struct mem_ctl_info {
u32 ce_count; /* Total Correctable Errors for this MC */
unsigned long start_time; /* mci load start time (in jiffies) */

/* this stuff is for safe removal of mc devices from global list while
* NMI handlers may be traversing list
*/
struct rcu_head rcu;
struct completion complete;

/* edac sysfs device control */
Expand Down Expand Up @@ -620,10 +616,6 @@ struct edac_device_ctl_info {

unsigned long start_time; /* edac_device load start time (jiffies) */

/* these are for safe removal of mc devices from global list while
* NMI handlers may be traversing list
*/
struct rcu_head rcu;
struct completion removal_complete;

/* sysfs top name under 'edac' directory
Expand Down Expand Up @@ -722,10 +714,6 @@ struct edac_pci_ctl_info {

unsigned long start_time; /* edac_pci load start time (jiffies) */

/* these are for safe removal of devices from global list while
* NMI handlers may be traversing list
*/
struct rcu_head rcu;
struct completion complete;

/* sysfs top name under 'edac' directory
Expand Down
24 changes: 6 additions & 18 deletions trunk/drivers/edac/edac_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,31 +345,19 @@ static int add_edac_dev_to_global_list(struct edac_device_ctl_info *edac_dev)
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);
}

/*
Expand Down
16 changes: 6 additions & 10 deletions trunk/drivers/edac/edac_mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,20 +447,16 @@ static int add_mc_to_global_list(struct mem_ctl_info *mci)
return 1;
}

static void complete_mc_list_del(struct rcu_head *head)
{
struct mem_ctl_info *mci;

mci = container_of(head, struct mem_ctl_info, rcu);
INIT_LIST_HEAD(&mci->link);
}

static void del_mc_from_global_list(struct mem_ctl_info *mci)
{
atomic_dec(&edac_handlers);
list_del_rcu(&mci->link);
call_rcu(&mci->rcu, complete_mc_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(&mci->link);
}

/**
Expand Down
21 changes: 6 additions & 15 deletions trunk/drivers/edac/edac_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,6 @@ static int add_edac_pci_to_global_list(struct edac_pci_ctl_info *pci)
return 1;
}

/*
* complete_edac_pci_list_del
*
* RCU completion callback to indicate item is deleted
*/
static void complete_edac_pci_list_del(struct rcu_head *head)
{
struct edac_pci_ctl_info *pci;

pci = container_of(head, struct edac_pci_ctl_info, rcu);
INIT_LIST_HEAD(&pci->link);
}

/*
* del_edac_pci_from_global_list
*
Expand All @@ -184,8 +171,12 @@ static void complete_edac_pci_list_del(struct rcu_head *head)
static void del_edac_pci_from_global_list(struct edac_pci_ctl_info *pci)
{
list_del_rcu(&pci->link);
call_rcu(&pci->rcu, complete_edac_pci_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(&pci->link);
}

#if 0
Expand Down

0 comments on commit 6ea1741

Please sign in to comment.