pr_debug("\n");
 }
 
+enum {
+       MLX5_DRIVER_STATUS_ABORTED = 0xfe,
+};
+
 const char *mlx5_command_str(int command)
 {
        switch (command) {
        struct mlx5_core_dev *dev = container_of(cmd, struct mlx5_core_dev, cmd);
        struct mlx5_cmd_layout *lay;
        struct semaphore *sem;
+       unsigned long flags;
 
        sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem;
        down(sem);
                }
        } else {
                ent->idx = cmd->max_reg_cmds;
+               spin_lock_irqsave(&cmd->alloc_lock, flags);
+               clear_bit(ent->idx, &cmd->bitmask);
+               spin_unlock_irqrestore(&cmd->alloc_lock, flags);
        }
 
        ent->token = alloc_token(cmd);
        }
 }
 
-void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector)
+void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vec)
 {
        struct mlx5_cmd *cmd = &dev->cmd;
        struct mlx5_cmd_work_ent *ent;
        s64 ds;
        struct mlx5_cmd_stats *stats;
        unsigned long flags;
+       unsigned long vector;
 
+       /* there can be at most 32 command queues */
+       vector = vec & 0xffffffff;
        for (i = 0; i < (1 << cmd->log_sz); i++) {
                if (test_bit(i, &vector)) {
                        struct semaphore *sem;
                                        ent->ret = verify_signature(ent);
                                else
                                        ent->ret = 0;
-                               ent->status = ent->lay->status_own >> 1;
+                               if (vec & MLX5_TRIGGERED_CMD_COMP)
+                                       ent->status = MLX5_DRIVER_STATUS_ABORTED;
+                               else
+                                       ent->status = ent->lay->status_own >> 1;
+
                                mlx5_core_dbg(dev, "command completed. ret 0x%x, delivery status %s(0x%x)\n",
                                              ent->ret, deliv_status_to_str(ent->status), ent->status);
                        }
                        free_ent(cmd, ent->idx);
+
                        if (ent->callback) {
                                ds = ent->ts2 - ent->ts1;
                                if (ent->op < ARRAY_SIZE(cmd->stats)) {
 
 #endif
 void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type);
 struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn);
-void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector);
+void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vec);
 void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type);
 int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx,
                       int nent, u64 mask, const char *name, struct mlx5_uar *uar);
        return 8 * (1 << param);
 }
 
+enum {
+       MLX5_TRIGGERED_CMD_COMP = (u64)1 << 32,
+};
+
 #endif /* MLX5_DRIVER_H */