[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87fuiyv50n.fsf@vitty.brq.redhat.com>
Date: Tue, 28 Feb 2017 14:06:32 +0100
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: Dexuan Cui <decui@...rosoft.com>
Cc: Stephen Hemminger <sthemmin@...rosoft.com>,
"gregkh\@linuxfoundation.org" <gregkh@...uxfoundation.org>,
Haiyang Zhang <haiyangz@...rosoft.com>,
"driverdev-devel\@linuxdriverproject.org"
<driverdev-devel@...uxdriverproject.org>,
"Alex Ng \(LIS\)" <alexng@...rosoft.com>,
"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Drivers: hv: util: on deinit, don't wait the release event, if we shouldn't
Dexuan Cui <decui@...rosoft.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
Powered by blists - more mailing lists