lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHrpEqT=yD085tPPpvxG9heL1nHjZM0e7aHdA_2RdQrNWShRdw@mail.gmail.com>
Date:	Wed, 15 May 2013 09:56:47 +0800
From:	Frank Li <lznuaa@...il.com>
To:	Fabio Estevam <festevam@...il.com>
Cc:	Eric Dumazet <eric.dumazet@...il.com>,
	Shawn Guo <shawn.guo@...aro.org>,
	Frank Li <Frank.Li@...escale.com>,
	Francois Romieu <romieu@...zoreil.com>,
	Robert Schwebel <r.schwebel@...gutronix.de>,
	David Miller <davem@...emloft.net>,
	Lucas Stach <l.stach@...gutronix.de>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH v5 1/1 net] net: fec: fix kernel oops when plug/unplug
 cable many times

2013/5/15 Fabio Estevam <festevam@...il.com>:
> Hi Eric,
>
> On Tue, May 14, 2013 at 4:30 PM, Eric Dumazet <eric.dumazet@...il.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.

I also find the same solution yesterdays. I tested on MX6. Shawn
tested on MX6 and MX28.
You can submit patch.

best regards
Frank Li
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ