diff options
-rw-r--r-- | block/blk-mq.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index b6888ff556cf..d394cdd8d8c6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -1075,6 +1075,9 @@ static bool blk_mq_mark_tag_wait(struct blk_mq_hw_ctx **hctx, | |||
1075 | 1075 | ||
1076 | #define BLK_MQ_RESOURCE_DELAY 3 /* ms units */ | 1076 | #define BLK_MQ_RESOURCE_DELAY 3 /* ms units */ |
1077 | 1077 | ||
1078 | /* | ||
1079 | * Returns true if we did some work AND can potentially do more. | ||
1080 | */ | ||
1078 | bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, | 1081 | bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, |
1079 | bool got_budget) | 1082 | bool got_budget) |
1080 | { | 1083 | { |
@@ -1205,8 +1208,17 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, | |||
1205 | blk_mq_run_hw_queue(hctx, true); | 1208 | blk_mq_run_hw_queue(hctx, true); |
1206 | else if (needs_restart && (ret == BLK_STS_RESOURCE)) | 1209 | else if (needs_restart && (ret == BLK_STS_RESOURCE)) |
1207 | blk_mq_delay_run_hw_queue(hctx, BLK_MQ_RESOURCE_DELAY); | 1210 | blk_mq_delay_run_hw_queue(hctx, BLK_MQ_RESOURCE_DELAY); |
1211 | |||
1212 | return false; | ||
1208 | } | 1213 | } |
1209 | 1214 | ||
1215 | /* | ||
1216 | * If the host/device is unable to accept more work, inform the | ||
1217 | * caller of that. | ||
1218 | */ | ||
1219 | if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE) | ||
1220 | return false; | ||
1221 | |||
1210 | return (queued + errors) != 0; | 1222 | return (queued + errors) != 0; |
1211 | } | 1223 | } |
1212 | 1224 | ||