netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Shawn Guo <shawn.guo@linaro.org>,
	Frank Li <Frank.Li@freescale.com>,
	romieu@fr.zoreil.com, r.schwebel@pengutronix.de,
	davem@davemloft.net, l.stach@pengutronix.de,
	netdev@vger.kernel.org, lznuaa@gmail.com
Subject: Re: [PATCH v5 1/1 net] net: fec: fix kernel oops when plug/unplug cable many times
Date: Tue, 14 May 2013 16:40:32 -0300	[thread overview]
Message-ID: <CAOMZO5DK6giehS9HpmXMzRKiDvvtEPLxvyenMQaBdrWS8WWVxw@mail.gmail.com> (raw)
In-Reply-To: <1368559834.4519.23.camel@edumazet-glaptop>

Hi Eric,

On Tue, May 14, 2013 at 4:30 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:

> Thats because netif_tx_lock_bh() should be used.

Thanks for your advise.

> And btw, the order of the unlocks should probably be reversed :
>
>               netif_tx_unlock_bh(ndev);
>               netif_wake_queue(ndev);
>               napi_enable(&fep->napi);
>               netif_device_attach(ndev);

I tried the change below and do not see the original warning on mx28:

--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -451,7 +451,7 @@ fec_restart(struct net_device *ndev, int duplex)
                netif_device_detach(ndev);
                napi_disable(&fep->napi);
                netif_stop_queue(ndev);
-               netif_tx_lock(ndev);
+               netif_tx_lock_bh(ndev);
        }

        /* Whack a reset.  We should wait for this. */
@@ -616,10 +616,10 @@ fec_restart(struct net_device *ndev, int duplex)
        writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);

        if (netif_running(ndev)) {
-               netif_device_attach(ndev);
-               napi_enable(&fep->napi);
+               netif_tx_unlock_bh(ndev);
                netif_wake_queue(ndev);
-               netif_tx_unlock(ndev);
+               napi_enable(&fep->napi);
+               netif_device_attach(ndev);
        }
 }

Could someone try it on mx6, please?

If it works I can submit the patch tomorrow.

  reply	other threads:[~2013-05-14 19:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-08  0:08 [PATCH v5 1/1 net] net: fec: fix kernel oops when plug/unplug cable many times Frank Li
2013-05-08 20:15 ` David Miller
2013-05-13  4:57 ` Shawn Guo
2013-05-13  5:07   ` Shawn Guo
2013-05-14  2:29   ` Li Frank-B20596
2013-05-14 19:27   ` Fabio Estevam
2013-05-14 19:30     ` Eric Dumazet
2013-05-14 19:40       ` Fabio Estevam [this message]
2013-05-15  1:56         ` Frank Li
2013-05-15  2:42           ` Fabio Estevam

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=CAOMZO5DK6giehS9HpmXMzRKiDvvtEPLxvyenMQaBdrWS8WWVxw@mail.gmail.com \
    --to=festevam@gmail.com \
    --cc=Frank.Li@freescale.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=l.stach@pengutronix.de \
    --cc=lznuaa@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=r.schwebel@pengutronix.de \
    --cc=romieu@fr.zoreil.com \
    --cc=shawn.guo@linaro.org \
    /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).