[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1390818121.2735.130.camel@deadeye.wl.decadent.org.uk>
Date: Mon, 27 Jan 2014 10:22:01 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: Jason Wang <jasowang@...hat.com>
Cc: David Miller <davem@...emloft.net>, kys@...rosoft.com,
haiyangz@...rosoft.com, devel@...uxdriverproject.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net: hyperv: initialize link status correctly
On Mon, 2014-01-27 at 17:40 +0800, Jason Wang wrote:
> On 01/27/2014 04:35 PM, David Miller wrote:
> > From: Jason Wang <jasowang@...hat.com>
> > Date: Mon, 27 Jan 2014 15:30:54 +0800
> >
> >> Call netif_carrier_on() after register_device(). Otherwise it won't work since
> >> the device was still in NETREG_UNINITIALIZED state.
> >>
> >> Fixes a68f9614614749727286f675d15f1e09d13cb54a
> >> (hyperv: Fix race between probe and open calls)
> >>
> >> Cc: Haiyang Zhang <haiyangz@...rosoft.com>
> >> Cc: K. Y. Srinivasan <kys@...rosoft.com>
> >> Reported-by: Di Nie <dnie@...hat.com>
> >> Tested-by: Di Nie <dnie@...hat.com>
> >> Signed-off-by: Jason Wang <jasowang@...hat.com>
> > A device up can occur at the moment you call register_netdevice(),
> > therefore that up call can see the carrier as down and fail or
> > similar. So you really cannot resolve the carrier to be on in this
> > way.
>
> True, we need a workqueue to synchronize them.
Whatever for? All you need to do is:
rtnl_lock();
register_netdevice();
netif_carrier_on();
rtnl_unlock();
It would be nice if we could make the current code work with a change in
the core, though.
Ben.
--
Ben Hutchings
If at first you don't succeed, you're doing about average.
Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)
Powered by blists - more mailing lists