aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-05-13 11:50:27 -0400
committerPaul Mackerras <paulus@samba.org>2007-05-17 07:11:13 -0400
commit9d561ed46ea33c223def2eb8e2b09ea108a4d70b (patch)
tree02a4d1ada9fbaa0e8bef7aae98f2e22f820cd160 /arch
parente38e3458804019c3fe9b17998e05fd1cd480806d (diff)
[POWERPC] viopath: Use completion
Use a completion instead of abusing a semaphore for hypervisor event completion in viopath. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/iseries/viopath.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index 354b8dd2a2c1..7f58e5929a2c 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -37,6 +37,7 @@
37#include <linux/wait.h> 37#include <linux/wait.h>
38#include <linux/seq_file.h> 38#include <linux/seq_file.h>
39#include <linux/interrupt.h> 39#include <linux/interrupt.h>
40#include <linux/completion.h>
40 41
41#include <asm/system.h> 42#include <asm/system.h>
42#include <asm/uaccess.h> 43#include <asm/uaccess.h>
@@ -115,7 +116,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
115 u16 vlanMap; 116 u16 vlanMap;
116 dma_addr_t handle; 117 dma_addr_t handle;
117 HvLpEvent_Rc hvrc; 118 HvLpEvent_Rc hvrc;
118 DECLARE_MUTEX_LOCKED(Semaphore); 119 DECLARE_COMPLETION(done);
119 struct device_node *node; 120 struct device_node *node;
120 const char *sysid; 121 const char *sysid;
121 122
@@ -132,13 +133,13 @@ static int proc_viopath_show(struct seq_file *m, void *v)
132 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck, 133 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
133 viopath_sourceinst(viopath_hostLp), 134 viopath_sourceinst(viopath_hostLp),
134 viopath_targetinst(viopath_hostLp), 135 viopath_targetinst(viopath_hostLp),
135 (u64)(unsigned long)&Semaphore, VIOVERSION << 16, 136 (u64)(unsigned long)&done, VIOVERSION << 16,
136 ((u64)handle) << 32, HW_PAGE_SIZE, 0, 0); 137 ((u64)handle) << 32, HW_PAGE_SIZE, 0, 0);
137 138
138 if (hvrc != HvLpEvent_Rc_Good) 139 if (hvrc != HvLpEvent_Rc_Good)
139 printk(VIOPATH_KERN_WARN "hv error on op %d\n", (int)hvrc); 140 printk(VIOPATH_KERN_WARN "hv error on op %d\n", (int)hvrc);
140 141
141 down(&Semaphore); 142 wait_for_completion(&done);
142 143
143 vlanMap = HvLpConfig_getVirtualLanIndexMap(); 144 vlanMap = HvLpConfig_getVirtualLanIndexMap();
144 145
@@ -353,7 +354,7 @@ static void handleConfig(struct HvLpEvent *event)
353 return; 354 return;
354 } 355 }
355 356
356 up((struct semaphore *)event->xCorrelationToken); 357 complete((struct completion *)event->xCorrelationToken);
357} 358}
358 359
359/* 360/*