diff options
author | Christoph Hellwig <hch@lst.de> | 2007-05-15 09:10:34 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-05-17 07:11:13 -0400 |
commit | 39d207036c76ff16650772b83fb1a12ab788ca26 (patch) | |
tree | 4c9c5207b53b634fc14cf854cc6e069850bf2ddb | |
parent | 9d561ed46ea33c223def2eb8e2b09ea108a4d70b (diff) |
[POWERPC] viopath: Use a completion in some more places
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/platforms/iseries/viopath.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c index 7f58e5929a2c..6a0060a5f2ec 100644 --- a/arch/powerpc/platforms/iseries/viopath.c +++ b/arch/powerpc/platforms/iseries/viopath.c | |||
@@ -82,7 +82,7 @@ static void handleMonitorEvent(struct HvLpEvent *event); | |||
82 | * if system_state is not SYSTEM_RUNNING, then wait_atomic is used ... | 82 | * if system_state is not SYSTEM_RUNNING, then wait_atomic is used ... |
83 | */ | 83 | */ |
84 | struct alloc_parms { | 84 | struct alloc_parms { |
85 | struct semaphore sem; | 85 | struct completion done; |
86 | int number; | 86 | int number; |
87 | atomic_t wait_atomic; | 87 | atomic_t wait_atomic; |
88 | int used_wait_atomic; | 88 | int used_wait_atomic; |
@@ -465,7 +465,7 @@ static void viopath_donealloc(void *parm, int number) | |||
465 | if (parmsp->used_wait_atomic) | 465 | if (parmsp->used_wait_atomic) |
466 | atomic_set(&parmsp->wait_atomic, 0); | 466 | atomic_set(&parmsp->wait_atomic, 0); |
467 | else | 467 | else |
468 | up(&parmsp->sem); | 468 | complete(&parmsp->done); |
469 | } | 469 | } |
470 | 470 | ||
471 | static int allocateEvents(HvLpIndex remoteLp, int numEvents) | 471 | static int allocateEvents(HvLpIndex remoteLp, int numEvents) |
@@ -477,7 +477,7 @@ static int allocateEvents(HvLpIndex remoteLp, int numEvents) | |||
477 | atomic_set(&parms.wait_atomic, 1); | 477 | atomic_set(&parms.wait_atomic, 1); |
478 | } else { | 478 | } else { |
479 | parms.used_wait_atomic = 0; | 479 | parms.used_wait_atomic = 0; |
480 | init_MUTEX_LOCKED(&parms.sem); | 480 | init_completion(&parms.done); |
481 | } | 481 | } |
482 | mf_allocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo, 250, /* It would be nice to put a real number here! */ | 482 | mf_allocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo, 250, /* It would be nice to put a real number here! */ |
483 | numEvents, &viopath_donealloc, &parms); | 483 | numEvents, &viopath_donealloc, &parms); |
@@ -485,7 +485,7 @@ static int allocateEvents(HvLpIndex remoteLp, int numEvents) | |||
485 | while (atomic_read(&parms.wait_atomic)) | 485 | while (atomic_read(&parms.wait_atomic)) |
486 | mb(); | 486 | mb(); |
487 | } else | 487 | } else |
488 | down(&parms.sem); | 488 | wait_for_completion(&parms.done); |
489 | return parms.number; | 489 | return parms.number; |
490 | } | 490 | } |
491 | 491 | ||
@@ -586,10 +586,10 @@ int viopath_close(HvLpIndex remoteLp, int subtype, int numReq) | |||
586 | spin_unlock_irqrestore(&statuslock, flags); | 586 | spin_unlock_irqrestore(&statuslock, flags); |
587 | 587 | ||
588 | parms.used_wait_atomic = 0; | 588 | parms.used_wait_atomic = 0; |
589 | init_MUTEX_LOCKED(&parms.sem); | 589 | init_completion(&parms.done); |
590 | mf_deallocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo, | 590 | mf_deallocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo, |
591 | numReq, &viopath_donealloc, &parms); | 591 | numReq, &viopath_donealloc, &parms); |
592 | down(&parms.sem); | 592 | wait_for_completion(&parms.done); |
593 | 593 | ||
594 | spin_lock_irqsave(&statuslock, flags); | 594 | spin_lock_irqsave(&statuslock, flags); |
595 | for (i = 0, numOpen = 0; i < VIO_MAX_SUBTYPES; i++) | 595 | for (i = 0, numOpen = 0; i < VIO_MAX_SUBTYPES; i++) |