diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-07-17 01:50:36 +0200 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-17 02:11:59 +0200 |
commit | 778feeb4757daef5d7118feab2319142367910dd (patch) | |
tree | e09a08c13bbd5a2de881dfcb04d987034564f1b3 /arch/sparc64/kernel/mdesc.c | |
parent | [SPARC64]: SMP build fix. (diff) | |
download | linux-778feeb4757daef5d7118feab2319142367910dd.tar.xz linux-778feeb4757daef5d7118feab2319142367910dd.zip |
[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>
Diffstat (limited to 'arch/sparc64/kernel/mdesc.c')
-rw-r--r-- | arch/sparc64/kernel/mdesc.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/arch/sparc64/kernel/mdesc.c b/arch/sparc64/kernel/mdesc.c index 62a389793949..de5310ffdb48 100644 --- a/arch/sparc64/kernel/mdesc.c +++ b/arch/sparc64/kernel/mdesc.c @@ -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; |