summaryrefslogtreecommitdiff
path: root/drivers/block/mtip32xx/mtip32xx.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-12-10 22:34:39 +0100
committerJens Axboe <axboe@kernel.dk>2018-12-10 14:44:56 -0700
commite4025e46f093d4549d3043c2c54d444cec480d2b (patch)
treed96d7141ef0bdcc4147fb55530b2d9857f7a93a7 /drivers/block/mtip32xx/mtip32xx.h
parent6f75723190d88e1319bea623bfe0292bf3917965 (diff)
mtip32xx: avoid using semaphores
The "cmd_slot_unal" semaphore is never used in a blocking way but only as an atomic counter. Change the code to using atomic_dec_if_positive() as a better API. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/mtip32xx/mtip32xx.h')
-rw-r--r--drivers/block/mtip32xx/mtip32xx.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h
index c33f8c3d9fb4..abce25f27f57 100644
--- a/drivers/block/mtip32xx/mtip32xx.h
+++ b/drivers/block/mtip32xx/mtip32xx.h
@@ -433,8 +433,8 @@ struct mtip_port {
*/
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];