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