mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Dexuan Cui <decui@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>,
	"gregkh\@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"driverdev-devel\@linuxdriverproject.org" 
	<driverdev-devel@linuxdriverproject.org>,
	"Alex Ng \(LIS\)" <alexng@microsoft.com>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Drivers: hv: util: on deinit, don't wait the release event, if we shouldn't
Date: Tue, 28 Feb 2017 14:06:32 +0100	[thread overview]
Message-ID: <87fuiyv50n.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <MWHPR03MB26697C13F39571FC2D163560BF560@MWHPR03MB2669.namprd03.prod.outlook.com> (Dexuan Cui's message of "Tue, 28 Feb 2017 13:01:00 +0000")

Dexuan Cui <decui@microsoft.com> writes:

>> From: devel [...] On Behalf Of Dexuan Cui
>> > > --- a/drivers/hv/hv_utils_transport.h
>> > > +++ b/drivers/hv/hv_utils_transport.h
>> > > @@ -32,6 +32,7 @@ struct hvutil_transport {
>> > >     int mode;                           /* hvutil_transport_mode */
>> > >     struct file_operations fops;        /* file operations */
>> > >     struct miscdevice mdev;             /* misc device */
>> > > +   bool   dev_opened;                  /* Is the device opened? */
>> > >     struct cb_id cn_id;                 /* CN_*_IDX/CN_*_VAL */
>> > >     struct list_head list;              /* hvt_list */
>> > >     int (*on_msg)(void *, int);         /* callback on new user message */
>> >
>> > I think we can get away without introducing this new flag, e.g. if we
>> > replace release_event with an atomic which will hold the state
>> > (open/closed). This will also elimenate possible races above. I can try
>> > prototyping a patch if you want me to.
>> > --
>> >   Vitaly
>> 
>> Thanks for offering the help! Please do. :-)
>
> BTW, IMO I found another potential issue:
> In hvt_op_open -> hvt_reset -> kvp_on_reset(), I think we should call
> init_completion() instead of complete()?
>

To me it looks like we can do better with something different from
struct completion, I'll take a look later today.

-- 
  Vitaly

  reply	other threads:[~2017-02-28 13:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27 11:26 Dexuan Cui
2017-02-27 17:02 ` Stephen Hemminger
2017-02-28  2:37   ` Dexuan Cui
2017-02-28 12:31 ` Vitaly Kuznetsov
2017-02-28 12:42   ` Dexuan Cui
2017-02-28 13:01     ` Dexuan Cui
2017-02-28 13:06       ` Vitaly Kuznetsov [this message]
2017-02-28 14:21         ` Vitaly Kuznetsov
2017-03-01 14:34           ` Dexuan Cui

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=87fuiyv50n.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=alexng@microsoft.com \
    --cc=decui@microsoft.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sthemmin@microsoft.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

Powered by JetHome