Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933162AbbBBKJg (ORCPT ); Mon, 2 Feb 2015 05:09:36 -0500 Received: from mail-by2on0102.outbound.protection.outlook.com ([207.46.100.102]:14784 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754554AbbBBKJe (ORCPT ); Mon, 2 Feb 2015 05:09:34 -0500 From: Dexuan Cui To: Jason Wang CC: "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "driverdev-devel@linuxdriverproject.org" , "olaf@aepfle.de" , "apw@canonical.com" , KY Srinivasan , "vkuznets@redhat.com" , Haiyang Zhang Subject: RE: [PATCH v2 1/3] hv: hv_util: move vmbus_open() to a later place Thread-Topic: [PATCH v2 1/3] hv: hv_util: move vmbus_open() to a later place Thread-Index: AQHQPsvIlhVU0sGUPEKQOwkK2CD1HJzdHtOg Date: Mon, 2 Feb 2015 10:09:07 +0000 Message-ID: References: <1422851718-2353-1-git-send-email-decui@microsoft.com> <1422869774.7028.5@smtp.corp.redhat.com> In-Reply-To: <1422869774.7028.5@smtp.corp.redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [141.251.55.68] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-EOPAttributedMessage: 0 Authentication-Results: spf=pass (sender IP is 206.191.230.4) smtp.mailfrom=decui@microsoft.com; redhat.com; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:206.191.230.4;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(51704005)(377454003)(24454002)(13464003)(106466001)(19580395003)(19580405001)(106116001)(92566002)(66066001)(86612001)(110136001)(6806004)(104016003)(22756005)(22746005)(86146001)(50466002)(46102003)(33656002)(47776003)(76176999)(54356999)(23676002)(50986999)(87936001)(2920100001)(2900100001)(2950100001)(102836002)(2656002)(55846006)(62966003)(77156002)(79686002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0301MB0843;H:064-smtp-out.microsoft.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0843; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004);SRVR:CY1PR0301MB0843; X-Forefront-PRVS: 0475418F50 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0843; X-OriginatorOrg: microsoft.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2015 10:09:30.3518 (UTC) X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=72f988bf-86f1-41af-91ab-2d7cd011db47;Ip=[206.191.230.4] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0843 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t12A9fIu002318 Content-Length: 2653 Lines: 85 > -----Original Message----- > From: Jason Wang [mailto:jasowang@redhat.com] > Sent: Monday, February 2, 2015 17:36 PM > To: Dexuan Cui > Cc: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org; driverdev- > devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com; KY > Srinivasan; vkuznets@redhat.com; Haiyang Zhang > Subject: Re: [PATCH v2 1/3] hv: hv_util: move vmbus_open() to a later place > > > > On Mon, Feb 2, 2015 at 12:35 PM, Dexuan Cui wrote: > > Before the line vmbus_open() returns, srv->util_cb can be already > > running > > and the variables, like util_fw_version, are needed by the > > srv->util_cb. > > A questions is why we do this for util only? Can callbacks of other > devices be called before vmbus_open() returns? The variables are used in vmbus_prep_negotiate_resp(), which is only for the util devices. I think the other devices should already handle the similar issue properly. If this is not the case, we need to fix them too. > > > > > So we have to make sure the variables are initialized before the > > vmbus_open(). > > > > CC: "K. Y. Srinivasan" > > Reviewed-by: Vitaly Kuznetsov > > Signed-off-by: Dexuan Cui > > --- > > > > v2: > > This is a RESEND. > > I just added Vitaly's Reviewed-by. > > > > drivers/hv/hv_util.c | 11 ++++++----- > > 1 file changed, 6 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c > > index 3b9c9ef..c5be773 100644 > > --- a/drivers/hv/hv_util.c > > +++ b/drivers/hv/hv_util.c > > @@ -340,12 +340,8 @@ static int util_probe(struct hv_device *dev, > > > > set_channel_read_state(dev->channel, false); > > > > - ret = vmbus_open(dev->channel, 4 * PAGE_SIZE, 4 * PAGE_SIZE, NULL, > > 0, > > - srv->util_cb, dev->channel); > > - if (ret) > > - goto error; > > - > > hv_set_drvdata(dev, srv); > > + > > This seems unnecessary. Yeah, it's an empty line, splitting the line and the below comment. I'm Ok to not have it. > > /* > > * Based on the host; initialize the framework and > > * service version numbers we will negotiate. > > @@ -365,6 +361,11 @@ static int util_probe(struct hv_device *dev, > > hb_srv_version = HB_VERSION; > > } > > > > + ret = vmbus_open(dev->channel, 4 * PAGE_SIZE, 4 * PAGE_SIZE, NULL, > > 0, > > + srv->util_cb, dev->channel); > > + if (ret) > > + goto error; > > + > > return 0; > > > > error: > > -- > > 1.9.1 > > -- Dexuan ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?