[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <F54AEECA5E2B9541821D670476DAE19C5A91691E@PGSMSX102.gar.corp.intel.com>
Date: Tue, 27 Dec 2016 05:26:43 +0000
From: "Kweh, Hock Leong" <hock.leong.kweh@...el.com>
To: David Miller <davem@...emloft.net>
CC: "Joao.Pinto@...opsys.com" <Joao.Pinto@...opsys.com>,
"peppe.cavallaro@...com" <peppe.cavallaro@...com>,
"seraphin.bonnaffe@...com" <seraphin.bonnaffe@...com>,
"alexandre.torgue@...il.com" <alexandre.torgue@...il.com>,
"manabian@...il.com" <manabian@...il.com>,
"niklas.cassel@...s.com" <niklas.cassel@...s.com>,
"johan@...nel.org" <johan@...nel.org>,
"pavel@....cz" <pavel@....cz>,
"Ong, Boon Leong" <boon.leong.ong@...el.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Voon, Weifeng" <weifeng.voon@...el.com>,
"lars.persson@...s.com" <lars.persson@...s.com>
Subject: RE: [PATCH] net: stmmac: synchronize stmmac_open and
stmmac_dvr_probe
> -----Original Message-----
> From: David Miller [mailto:davem@...emloft.net]
> Sent: Tuesday, December 27, 2016 12:55 PM
> To: Kweh, Hock Leong <hock.leong.kweh@...el.com>
> Cc: Joao.Pinto@...opsys.com; peppe.cavallaro@...com;
> seraphin.bonnaffe@...com; alexandre.torgue@...il.com;
> manabian@...il.com; niklas.cassel@...s.com; johan@...nel.org;
> pavel@....cz; Ong, Boon Leong <boon.leong.ong@...el.com>;
> netdev@...r.kernel.org; linux-kernel@...r.kernel.org; Voon, Weifeng
> <weifeng.voon@...el.com>; lars.persson@...s.com
> Subject: Re: [PATCH] net: stmmac: synchronize stmmac_open and
> stmmac_dvr_probe
>
> From: "Kweh, Hock Leong" <hock.leong.kweh@...el.com>
> Date: Tue, 27 Dec 2016 19:44:59 +0800
>
> > From: "Kweh, Hock Leong" <hock.leong.kweh@...el.com>
> >
> > If kernel module stmmac driver being loaded after OS booted, there is a
> > race condition between stmmac_open() and stmmac_mdio_register(), which is
> > invoked inside stmmac_dvr_probe(), and the error is showed in dmesg log as
> > PHY not found and stmmac_open() failed:
> ...
> > The resolution used wait_for_completion_interruptible() to synchronize
> > stmmac_open() and stmmac_dvr_probe() to prevent the race condition
> > happening.
> >
> > Signed-off-by: Kweh, Hock Leong <hock.leong.kweh@...el.com>
>
> The proper thing to do is to make sure register_netdevice() is not
> invoked until it is %100 safe to call stmmac_open().
Noted & thanks. Will look into it.
Regards,
Wilson
Powered by blists - more mailing lists