Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1547493

Re: [PATCH] net: stmmac: synchronize stmmac_open and stmmac_dvr_probe

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH] net: stmmac: synchronize stmmac_open and stmmac_dvr_probe
Date 2016-12-27 06:00 +0100
Message-ID <sSS1H-5Se-3@gated-at.bofh.it> (permalink)
References <sSQVX-5fn-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: "Kweh, Hock Leong"	<hock.leong.kweh@intel.com>
Date: Tue, 27 Dec 2016 19:44:59 +0800

> From: "Kweh, Hock Leong" <hock.leong.kweh@intel.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@intel.com>

The proper thing to do is to make sure register_netdevice() is not
invoked until it is %100 safe to call stmmac_open().

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] net: stmmac: synchronize stmmac_open and stmmac_dvr_probe "Kweh, Hock Leong" <hock.leong.kweh@intel.com> - 2016-12-27 04:50 +0100
  Re: [PATCH] net: stmmac: synchronize stmmac_open and  stmmac_dvr_probe David Miller <davem@davemloft.net> - 2016-12-27 06:00 +0100
    RE: [PATCH] net: stmmac: synchronize stmmac_open and  stmmac_dvr_probe "Kweh, Hock Leong" <hock.leong.kweh@intel.com> - 2016-12-27 06:30 +0100
  Re: [PATCH] net: stmmac: synchronize stmmac_open and stmmac_dvr_probe Florian Fainelli <f.fainelli@gmail.com> - 2016-12-27 06:20 +0100
    RE: [PATCH] net: stmmac: synchronize stmmac_open and  stmmac_dvr_probe "Kweh, Hock Leong" <hock.leong.kweh@intel.com> - 2016-12-27 06:30 +0100
  Re: [PATCH] net: stmmac: synchronize stmmac_open and stmmac_dvr_probe Florian Fainelli <f.fainelli@gmail.com> - 2016-12-27 06:20 +0100

csiph-web