Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d561ed46ea33c223def2eb8e2b09ea108a4d70b
Commit:     9d561ed46ea33c223def2eb8e2b09ea108a4d70b
Parent:     e38e3458804019c3fe9b17998e05fd1cd480806d
Author:     Christoph Hellwig <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 01:50:27 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Thu May 17 21:11:13 2007 +1000

    [POWERPC] viopath: Use completion
    
    Use a completion instead of abusing a semaphore for hypervisor event
    completion in viopath.
    
    Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]>
    Acked-by: Stephen Rothwell <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/iseries/viopath.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/iseries/viopath.c 
b/arch/powerpc/platforms/iseries/viopath.c
index 354b8dd..7f58e59 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -37,6 +37,7 @@
 #include <linux/wait.h>
 #include <linux/seq_file.h>
 #include <linux/interrupt.h>
+#include <linux/completion.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -115,7 +116,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
        u16 vlanMap;
        dma_addr_t handle;
        HvLpEvent_Rc hvrc;
-       DECLARE_MUTEX_LOCKED(Semaphore);
+       DECLARE_COMPLETION(done);
        struct device_node *node;
        const char *sysid;
 
@@ -132,13 +133,13 @@ static int proc_viopath_show(struct seq_file *m, void *v)
                        HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
                        viopath_sourceinst(viopath_hostLp),
                        viopath_targetinst(viopath_hostLp),
-                       (u64)(unsigned long)&Semaphore, VIOVERSION << 16,
+                       (u64)(unsigned long)&done, VIOVERSION << 16,
                        ((u64)handle) << 32, HW_PAGE_SIZE, 0, 0);
 
        if (hvrc != HvLpEvent_Rc_Good)
                printk(VIOPATH_KERN_WARN "hv error on op %d\n", (int)hvrc);
 
-       down(&Semaphore);
+       wait_for_completion(&done);
 
        vlanMap = HvLpConfig_getVirtualLanIndexMap();
 
@@ -353,7 +354,7 @@ static void handleConfig(struct HvLpEvent *event)
                return;
        }
 
-       up((struct semaphore *)event->xCorrelationToken);
+       complete((struct completion *)event->xCorrelationToken);
 }
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to