diff options
| author | Mark Brown <broonie@kernel.org> | 2017-01-24 16:24:18 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2017-01-24 16:24:18 +0000 |
| commit | dbbc21bbf2c640dd148903e82f752c2f269fc58a (patch) | |
| tree | e85f5b686774e2fbae6387f94bf44c4076c49046 /include/linux/netpoll.h | |
| parent | f6fa11a35c548a516a41ce1669d0dbcdaabb267f (diff) | |
| parent | 7ce7d89f48834cefece7804d38fc5d85382edf77 (diff) | |
Merge tag 'v4.10-rc1' into asoc-intel
Linux 4.10-rc1
Diffstat (limited to 'include/linux/netpoll.h')
| -rw-r--r-- | include/linux/netpoll.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index b25ee9ffdbe6..1828900c9411 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -78,8 +78,11 @@ static inline void *netpoll_poll_lock(struct napi_struct *napi) struct net_device *dev = napi->dev; if (dev && dev->npinfo) { - spin_lock(&napi->poll_lock); - napi->poll_owner = smp_processor_id(); + int owner = smp_processor_id(); + + while (cmpxchg(&napi->poll_owner, -1, owner) != -1) + cpu_relax(); + return napi; } return NULL; @@ -89,10 +92,8 @@ static inline void netpoll_poll_unlock(void *have) { struct napi_struct *napi = have; - if (napi) { - napi->poll_owner = -1; - spin_unlock(&napi->poll_lock); - } + if (napi) + smp_store_release(&napi->poll_owner, -1); } static inline bool netpoll_tx_running(struct net_device *dev) |
