cmd->direction);
 
        if (unlikely(cmd->unaligned))
-               up(&dd->port->cmd_slot_unal);
+               atomic_inc(&dd->port->cmd_slot_unal);
 
        blk_mq_end_request(rq, cmd->status);
 }
        else
                dd->unal_qdepth = 0;
 
-       sema_init(&dd->port->cmd_slot_unal, dd->unal_qdepth);
+       atomic_set(&dd->port->cmd_slot_unal, dd->unal_qdepth);
 
        /* Spinlock to prevent concurrent issue */
        for (i = 0; i < MTIP_MAX_SLOT_GROUPS; i++)
                        cmd->unaligned = 1;
        }
 
-       if (cmd->unaligned && down_trylock(&dd->port->cmd_slot_unal))
+       if (cmd->unaligned && atomic_dec_if_positive(&dd->port->cmd_slot_unal) >= 0)
                return true;
 
        return false;
 
         */
        unsigned long ic_pause_timer;
 
-       /* Semaphore to control queue depth of unaligned IOs */
-       struct semaphore cmd_slot_unal;
+       /* Counter to control queue depth of unaligned IOs */
+       atomic_t cmd_slot_unal;
 
        /* Spinlock for working around command-issue bug. */
        spinlock_t cmd_issue_lock[MTIP_MAX_SLOT_GROUPS];