nfp: wait for posted reconfigs when disabling the device
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 29 Aug 2018 19:46:08 +0000 (12:46 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 1 Sep 2018 06:01:30 +0000 (23:01 -0700)
commit9ad716b95fd6c6be46a4f2d5936e514b5bcd744d
treefa1892e0f5434647c80e829f98cb11ac68159c93
parent3a7ad0634f0986d807772ba74f66f7c3a73612e5
nfp: wait for posted reconfigs when disabling the device

To avoid leaking a running timer we need to wait for the
posted reconfigs after netdev is unregistered.  In common
case the process of deinitializing the device will perform
synchronous reconfigs which wait for posted requests, but
especially with VXLAN ports being actively added and removed
there can be a race condition leaving a timer running after
adapter structure is freed leading to a crash.

Add an explicit flush after deregistering and for a good
measure a warning to check if timer is running just before
structures are freed.

Fixes: 3d780b926a12 ("nfp: add async reconfiguration mechanism")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c