[SPARC64]: Fix race between MD update and dr-cpu add.

We need to make sure the MD update occurs before we try to
process dr-cpu configure requests.  MD update and dr-cpu
were being processed by seperate threads so that did not
happen occaisionally.

Fix this by executing all domain services data packets from
a single thread, in order.

This will help simplify some other things as well.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller
2007-07-16 16:50:36 -07:00
parent 3ac66e33ea
commit 778feeb475
2 changed files with 151 additions and 147 deletions

View File

@@ -214,7 +214,7 @@ void mdesc_release(struct mdesc_handle *hp)
}
EXPORT_SYMBOL(mdesc_release);
static void do_mdesc_update(struct work_struct *work)
void mdesc_update(void)
{
unsigned long len, real_len, status;
struct mdesc_handle *hp, *orig_hp;
@@ -248,13 +248,6 @@ static void do_mdesc_update(struct work_struct *work)
spin_unlock_irqrestore(&mdesc_lock, flags);
}
static DECLARE_WORK(mdesc_update_work, do_mdesc_update);
void mdesc_update(void)
{
schedule_work(&mdesc_update_work);
}
static struct mdesc_elem *node_block(struct mdesc_hdr *mdesc)
{
return (struct mdesc_elem *) (mdesc + 1);
@@ -278,13 +271,14 @@ u64 mdesc_node_by_name(struct mdesc_handle *hp,
u64 last_node = hp->mdesc.node_sz / 16;
u64 ret;
if (from_node == MDESC_NODE_NULL)
from_node = 0;
if (from_node >= last_node)
if (from_node == MDESC_NODE_NULL) {
ret = from_node = 0;
} else if (from_node >= last_node) {
return MDESC_NODE_NULL;
} else {
ret = ep[from_node].d.val;
}
ret = ep[from_node].d.val;
while (ret < last_node) {
if (ep[ret].tag != MD_NODE)
return MDESC_NODE_NULL;