Re: [PATCH 115/206] Staging: hv: Use completion abstraction in struct netvsc_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -	net_device->wait_condition = 0;
>  	ret = vmbus_sendpacket(device->channel, init_packet,
>  			       sizeof(struct nvsp_message),
>  			       (unsigned long)init_packet,
> @@ -272,10 +272,8 @@ static int netvsc_init_recv_buf(struct hv_device *device)
>  		goto cleanup;
>  	}
>  
> -	wait_event_timeout(net_device->channel_init_wait,
> -			net_device->wait_condition,
> -			msecs_to_jiffies(1000));
> -	BUG_ON(net_device->wait_condition == 0);
> +	t = wait_for_completion_timeout(&net_device->channel_init_wait, HZ);
> +	BUG_ON(t == 0);

I don't think you want a BUG_ON here, but rather fail the
initialization.

Also I think you really should add synchronous versions of
vmbus_sendpacket*, to the vmbus core so that all the synchronous waiting
can be consolidated into a few helpers instead of needing to opencode
it everywhere.

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization


[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux