Re: [PATCH] usbnet: fix kernel crash after disconnect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Kloetzke Jan <Jan.Kloetzke@xxxxxxx>
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?



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux