net/mlx4_core: Fix deadlock when switching between polling and event fw commands
[cascardo/linux.git] / drivers / net / ethernet / mellanox / mlx4 / mlx4.h
index c9d7fc5..c128ba3 100644 (file)
@@ -46,6 +46,7 @@
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
 #include <net/devlink.h>
+#include <linux/rwsem.h>
 
 #include <linux/mlx4/device.h>
 #include <linux/mlx4/driver.h>
@@ -627,6 +628,7 @@ struct mlx4_cmd {
        struct mutex            slave_cmd_mutex;
        struct semaphore        poll_sem;
        struct semaphore        event_sem;
+       struct rw_semaphore     switch_sem;
        int                     max_cmds;
        spinlock_t              context_lock;
        int                     free_head;