[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>

authored by Christoph Hellwig and committed by Paul Mackerras 9d561ed4 e38e3458

+5 -4
+5 -4
arch/powerpc/platforms/iseries/viopath.c
··· 37 37 #include <linux/wait.h> 38 38 #include <linux/seq_file.h> 39 39 #include <linux/interrupt.h> 40 + #include <linux/completion.h> 40 41 41 42 #include <asm/system.h> 42 43 #include <asm/uaccess.h> ··· 116 115 u16 vlanMap; 117 116 dma_addr_t handle; 118 117 HvLpEvent_Rc hvrc; 119 - DECLARE_MUTEX_LOCKED(Semaphore); 118 + DECLARE_COMPLETION(done); 120 119 struct device_node *node; 121 120 const char *sysid; 122 121 ··· 133 132 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck, 134 133 viopath_sourceinst(viopath_hostLp), 135 134 viopath_targetinst(viopath_hostLp), 136 - (u64)(unsigned long)&Semaphore, VIOVERSION << 16, 135 + (u64)(unsigned long)&done, VIOVERSION << 16, 137 136 ((u64)handle) << 32, HW_PAGE_SIZE, 0, 0); 138 137 139 138 if (hvrc != HvLpEvent_Rc_Good) 140 139 printk(VIOPATH_KERN_WARN "hv error on op %d\n", (int)hvrc); 141 140 142 - down(&Semaphore); 141 + wait_for_completion(&done); 143 142 144 143 vlanMap = HvLpConfig_getVirtualLanIndexMap(); 145 144 ··· 354 353 return; 355 354 } 356 355 357 - up((struct semaphore *)event->xCorrelationToken); 356 + complete((struct completion *)event->xCorrelationToken); 358 357 } 359 358 360 359 /*