Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754334Ab1EJHGu (ORCPT ); Tue, 10 May 2011 03:06:50 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:58731 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754194Ab1EJHGt (ORCPT ); Tue, 10 May 2011 03:06:49 -0400 Date: Tue, 10 May 2011 03:06:46 -0400 From: Christoph Hellwig To: "K. Y. Srinivasan" Cc: gregkh@suse.de, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, virtualization@lists.osdl.org, Haiyang Zhang , Abhishek Kane , Hank Janssen Subject: Re: [PATCH 115/206] Staging: hv: Use completion abstraction in struct netvsc_device Message-ID: <20110510070646.GB13847@infradead.org> References: <1304978242-22958-1-git-send-email-kys@microsoft.com> <1304978288-22999-1-git-send-email-kys@microsoft.com> <1304978288-22999-115-git-send-email-kys@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1304978288-22999-115-git-send-email-kys@microsoft.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1082 Lines: 28 > - 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/