[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190418.163544.2153438649838575906.davem@davemloft.net>
Date: Thu, 18 Apr 2019 16:35:44 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: Jan.Kloetzke@...h.de
Cc: oneukum@...e.com, netdev@...r.kernel.org, jan@...etzke.net,
linux-usb@...r.kernel.org
Subject: Re: [PATCH] usbnet: fix kernel crash after disconnect
From: Kloetzke Jan <Jan.Kloetzke@...h.de>
Date: Thu, 18 Apr 2019 08:02:59 +0000
> I think this assumption is not correct. As far as I understand the
> networking code it is still possible that the ndo_start_xmit callback
> is called while ndo_stop is running and even after ndo_stop has
> returned. You can only be sure after unregister_netdev() has returned.
> Maybe some networking folks can comment on that.
The kernel loops over the devices being unregistered, and first it clears
the __LINK_STATE_START on all of them, then it invokes ->ndo_stop() on
all of them.
__LINK_STATE_START controls what netif_running() returns.
All calls to ->ndo_start_xmit() are guarded by netif_running() checks.
So when ndo_stop is invoked you should get no more ndo_start_xmit
invocations on that device. Otherwise how could you shut down DMA
resources and turn off the TX engine properly?
Powered by blists - more mailing lists