diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-06-05 14:11:32 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-06 14:13:39 -0700 |
commit | 3ed77bf76624ea0892c95d7818d9b85f3cd1b472 (patch) | |
tree | e25f464299b76092dff898def04694f402772931 /drivers/net/ethernet/netronome/nfp/nfp_net.h | |
parent | 76581af254d8f64e342ca583242a6f0d4beeaefd (diff) | |
download | lwn-3ed77bf76624ea0892c95d7818d9b85f3cd1b472.tar.gz lwn-3ed77bf76624ea0892c95d7818d9b85f3cd1b472.zip |
nfp: make bar_lock a semaphore
We will need to release the bar lock from a workqueue
so move from a mutex to a semaphore. This lock should
not be too hot. Unfortunately semaphores don't have
lockdep support.
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>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfp_net.h')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net.h b/drivers/net/ethernet/netronome/nfp/nfp_net.h index df9aff2684ed..e006b3abc9f6 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net.h +++ b/drivers/net/ethernet/netronome/nfp/nfp_net.h @@ -17,6 +17,7 @@ #include <linux/netdevice.h> #include <linux/pci.h> #include <linux/io-64-nonatomic-hi-lo.h> +#include <linux/semaphore.h> #include <net/xdp.h> #include "nfp_net_ctrl.h" @@ -620,7 +621,7 @@ struct nfp_net { struct timer_list reconfig_timer; u32 reconfig_in_progress_update; - struct mutex bar_lock; + struct semaphore bar_lock; u32 rx_coalesce_usecs; u32 rx_coalesce_max_frames; @@ -848,12 +849,12 @@ static inline void nfp_ctrl_unlock(struct nfp_net *nn) static inline void nn_ctrl_bar_lock(struct nfp_net *nn) { - mutex_lock(&nn->bar_lock); + down(&nn->bar_lock); } static inline void nn_ctrl_bar_unlock(struct nfp_net *nn) { - mutex_unlock(&nn->bar_lock); + up(&nn->bar_lock); } /* Globals */ |