linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dexuan Cui <decui@microsoft.com>
To: Jason Wang <jasowang@redhat.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"driverdev-devel@linuxdriverproject.org" 
	<driverdev-devel@linuxdriverproject.org>,
	"olaf@aepfle.de" <olaf@aepfle.de>,
	"apw@canonical.com" <apw@canonical.com>,
	KY Srinivasan <kys@microsoft.com>,
	"vkuznets@redhat.com" <vkuznets@redhat.com>,
	Haiyang Zhang <haiyangz@microsoft.com>
Subject: RE: [PATCH v2 1/3] hv: hv_util: move vmbus_open() to a later place
Date: Mon, 2 Feb 2015 10:09:07 +0000	[thread overview]
Message-ID: <F792CF86EFE20D4AB8064279AFBA51C61F32EF4E@HKNPRD3002MB017.064d.mgd.msft.net> (raw)
In-Reply-To: <1422869774.7028.5@smtp.corp.redhat.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2653 bytes --]

> -----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 <decui@microsoft.com> 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" <kys@microsoft.com>
> > Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> > Signed-off-by: Dexuan Cui <decui@microsoft.com>
> > ---
> >
> > 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Ç+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2015-02-02 10:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02  4:35 [PATCH v2 1/3] hv: hv_util: move vmbus_open() to a later place Dexuan Cui
2015-02-02  9:36 ` Jason Wang
2015-02-02 10:09   ` Dexuan Cui [this message]
     [not found]     ` <F792CF86EFE20D4AB8064279AFBA51C61F32EF4E@HKNPRD3002MB017.064d.mgd.msft.net >
2015-02-03  3:08       ` Jason Wang
2015-02-03  3:30         ` KY Srinivasan
     [not found]           ` <BY2PR0301MB071153EA9F73C9855A4B4119A03D0@BY2PR0301MB0711.namprd03.prod.out look.com>
2015-02-03  3:38             ` Jason Wang
2015-02-03  3:40               ` KY Srinivasan
     [not found]                 ` <BY2PR0301MB07113EC0C4277FA01AE66B9DA03D0@BY2PR0301MB0711.namprd03.prod.out look.com>
2015-02-03  4:35                   ` Jason Wang
2015-02-03  4:35 ` Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F792CF86EFE20D4AB8064279AFBA51C61F32EF4E@HKNPRD3002MB017.064d.mgd.msft.net \
    --to=decui@microsoft.com \
    --cc=apw@canonical.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).