aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/mdesc.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-07-16 19:50:36 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-16 20:11:59 -0400
commit778feeb4757daef5d7118feab2319142367910dd (patch)
treee09a08c13bbd5a2de881dfcb04d987034564f1b3 /arch/sparc64/kernel/mdesc.c
parent3ac66e33eaf0b2313f7e3c8c023aa0420577a0c2 (diff)
[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.c20
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)
214} 214}
215EXPORT_SYMBOL(mdesc_release); 215EXPORT_SYMBOL(mdesc_release);
216 216
217static void do_mdesc_update(struct work_struct *work) 217void mdesc_update(void)
218{ 218{
219 unsigned long len, real_len, status; 219 unsigned long len, real_len, status;
220 struct mdesc_handle *hp, *orig_hp; 220 struct mdesc_handle *hp, *orig_hp;
@@ -248,13 +248,6 @@ static void do_mdesc_update(struct work_struct *work)
248 spin_unlock_irqrestore(&mdesc_lock, flags); 248 spin_unlock_irqrestore(&mdesc_lock, flags);
249} 249}
250 250
251static DECLARE_WORK(mdesc_update_work, do_mdesc_update);
252
253void mdesc_update(void)
254{
255 schedule_work(&mdesc_update_work);
256}
257
258static struct mdesc_elem *node_block(struct mdesc_hdr *mdesc) 251static struct mdesc_elem *node_block(struct mdesc_hdr *mdesc)
259{ 252{
260 return (struct mdesc_elem *) (mdesc + 1); 253 return (struct mdesc_elem *) (mdesc + 1);
@@ -278,13 +271,14 @@ u64 mdesc_node_by_name(struct mdesc_handle *hp,
278 u64 last_node = hp->mdesc.node_sz / 16; 271 u64 last_node = hp->mdesc.node_sz / 16;
279 u64 ret; 272 u64 ret;
280 273
281 if (from_node == MDESC_NODE_NULL) 274 if (from_node == MDESC_NODE_NULL) {
282 from_node = 0; 275 ret = from_node = 0;
283 276 } else if (from_node >= last_node) {
284 if (from_node >= last_node)
285 return MDESC_NODE_NULL; 277 return MDESC_NODE_NULL;
278 } else {
279 ret = ep[from_node].d.val;
280 }
286 281
287 ret = ep[from_node].d.val;
288 while (ret < last_node) { 282 while (ret < last_node) {
289 if (ep[ret].tag != MD_NODE) 283 if (ep[ret].tag != MD_NODE)
290 return MDESC_NODE_NULL; 284 return MDESC_NODE_NULL;