[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1FB5E1D5CA062146B38059374562DF7266B894B0@TK5EX14MBXC128.redmond.corp.microsoft.com>
Date: Wed, 19 May 2010 20:30:25 +0000
From: Haiyang Zhang <haiyangz@...rosoft.com>
To: Greg KH <gregkh@...e.de>
CC: "'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>,
"'devel@...verdev.osuosl.org'" <devel@...verdev.osuosl.org>,
"'virtualization@...ts.osdl.org'" <virtualization@...ts.osdl.org>,
"Hank Janssen" <hjanssen@...rosoft.com>
Subject: RE: [PATCH 1/2] staging: hv: Fix race condition in hv_utils module
initialization.
> > + /* Wait until all IC channels are initialized */
> > + while (atomic_read(&hv_utils_initcnt) < MAX_MSG_TYPES)
> > + msleep(100);
>
> No, don't do this here, do something in your hv_vmbus core to handle
> registering sub-drivers properly. Perhaps you need to sleep there
> before you can succeed on a initialization.
Thanks for the recommendation. I will put the sleep into vmbus_init to
ensure all channels are ready before the vmbus_init function exits.
> > hv_cb_utils[HV_SHUTDOWN_MSG].channel->OnChannelCallback =
> > &shutdown_onchannelcallback;
>
> The problem is that you just have a bunch of callbacks you are setting
> up, it's not a "real" function call. Please change it over to a
> function call, like all other subsystems have. Then, you can handle
> any
> "sleep until we are set up properly" issues in the vmbus code, not in
> each and every individual bus driver.
Actually, we already assign a default callback function, chn_cb_negotiate(),
when the channels are opened in vmbus module. It's a real function and can
handle common negotiation messages.
I will move the sleep into vmbus module as well.
Thanks,
- Haiyang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists