netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peppe CAVALLARO <peppe.cavallaro@st.com>
To: Vlad Lungu <vlad.lungu@windriver.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCH] stmmac: priv->lock can be used uninitialized
Date: Tue, 30 Nov 2010 15:12:08 +0100	[thread overview]
Message-ID: <4CF50638.7000203@st.com> (raw)
In-Reply-To: <9345448e435110e2bdff65bb4322060a6f1f6b63.1291106902.git.vlad.lungu@windriver.com>

Hi Vlad.

On 11/30/2010 9:52 AM, Vlad Lungu wrote:
>
> To reproduce: if connman (http://connman.net/) is started,
> inserting the stmmac module triggers a "BUG: spinlock bad magic on CPU#0".
>
> Registering the device in stmmac_probe() sends a notification to connman
> which brings the interface up before the lock is initialized.
>

I've never tested connman on our ST platforms.
I've never seen this problems too.
I've no concerns on it so it could be applied.

Regards
Peppe

> Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
> ---
>  drivers/net/stmmac/stmmac_main.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/stmmac/stmmac_main.c
> b/drivers/net/stmmac/stmmac_main.c
> index 730a6fd..e960501 100644
> --- a/drivers/net/stmmac/stmmac_main.c
> +++ b/drivers/net/stmmac/stmmac_main.c
> @@ -1516,6 +1516,8 @@ static int stmmac_probe(struct net_device *dev)
>                 pr_warning("\tno valid MAC address;"
>                         "please, use ifconfig or nwhwconfig!\n");
>
> +       spin_lock_init(&priv->lock);
> +
>         ret = register_netdev(dev);
>         if (ret) {
>                 pr_err("%s: ERROR %i registering the device\n",
> @@ -1527,8 +1529,6 @@ static int stmmac_probe(struct net_device *dev)
>             dev->name, (dev->features & NETIF_F_SG) ? "on" : "off",
>             (dev->features & NETIF_F_HW_CSUM) ? "on" : "off");
>
> -       spin_lock_init(&priv->lock);
> -
>         return ret;
>  }
>
> --
> 1.6.0.2
>

  reply	other threads:[~2010-11-30 14:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30  8:52 [PATCH] stmmac: priv->lock can be used uninitialized Vlad Lungu
2010-11-30 14:12 ` Peppe CAVALLARO [this message]
2010-12-02 21:19 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CF50638.7000203@st.com \
    --to=peppe.cavallaro@st.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=vlad.lungu@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).