android_kernel_oneplus_msm8998/drivers/net/xen-netback
David Vrabel 3e55f8b306 xen-netback: cancel the credit timer when taking the vif down
If the credit timer is left armed after calling
xen_netbk_remove_xenvif(), then it may fire and attempt to schedule
the vif which will then oops as vif->netbk == NULL.

This may happen both in the fatal error path and during normal
disconnection from the front end.

The sequencing during shutdown is critical to ensure that: a)
vif->netbk doesn't become unexpectedly NULL; and b) the net device/vif
is not freed.

1. Mark as unschedulable (netif_carrier_off()).
2. Synchronously cancel the timer.
3. Remove the vif from the schedule list.
4. Remove it from it netback thread group.
5. Wait for vif->refcnt to become 0.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Christopher S. Aker <caker@theshore.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-02-14 13:16:49 -05:00
..
common.h xen/netback: shutdown the ring if it contains garbage. 2013-02-07 23:29:28 -05:00
interface.c xen-netback: cancel the credit timer when taking the vif down 2013-02-14 13:16:49 -05:00
Makefile
netback.c xen-netback: correctly return errors from netbk_count_requests() 2013-02-14 13:16:49 -05:00
xenbus.c Xen: consolidate and simplify struct xenbus_driver instantiation 2012-01-04 17:01:17 -05:00