summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-05-14 08:22:56 -0600
committerJens Axboe <axboe@fb.com>2014-05-14 08:22:56 -0600
commit9acf03cfb1fbecc058d3f223323e3ed97763f1e6 (patch)
tree391c6b64de88f7062288604d77a04b4ee4b42ab3
parenta8a642ccd2e86248ae23c5d762dac67eaea02423 (diff)
downloadop-kernel-dev-9acf03cfb1fbecc058d3f223323e3ed97763f1e6.zip
op-kernel-dev-9acf03cfb1fbecc058d3f223323e3ed97763f1e6.tar.gz
mtip32xx: stop block hardware queues before quiescing IO
We need to stop the block layer queues to prevent new "normal" IO from entering the driver, while we wait for existing commands to finish. Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--drivers/block/mtip32xx/mtip32xx.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 5979ab3..4efc676 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -1031,6 +1031,8 @@ static int mtip_quiesce_io(struct mtip_port *port, unsigned long timeout)
unsigned int n;
unsigned int active = 1;
+ blk_mq_stop_hw_queues(port->dd->queue);
+
to = jiffies + msecs_to_jiffies(timeout);
do {
if (test_bit(MTIP_PF_SVC_THD_ACTIVE_BIT, &port->flags) &&
@@ -1039,7 +1041,7 @@ static int mtip_quiesce_io(struct mtip_port *port, unsigned long timeout)
continue; /* svc thd is actively issuing commands */
}
if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &port->dd->dd_flag))
- return -EFAULT;
+ goto err_fault;
/*
* Ignore s_active bit 0 of array element 0.
* This bit will always be set
@@ -1054,7 +1056,11 @@ static int mtip_quiesce_io(struct mtip_port *port, unsigned long timeout)
msleep(20);
} while (time_before(jiffies, to));
+ blk_mq_start_stopped_hw_queues(port->dd->queue, true);
return active ? -EBUSY : 0;
+err_fault:
+ blk_mq_start_stopped_hw_queues(port->dd->queue, true);
+ return -EFAULT;
}
/*
OpenPOWER on IntegriCloud