+1
-14
Documentation/block/biodoc.txt
+1
-14
Documentation/block/biodoc.txt
···
752
752
operations before calling end_that_request_last()! For an example of a user
753
753
of these helpers, see the IDE tagged command queueing support.
754
754
755
-
Certain hardware conditions may dictate a need to invalidate the block tag
756
-
queue. For instance, on IDE any tagged request error needs to clear both
757
-
the hardware and software block queue and enable the driver to sanely restart
758
-
all the outstanding requests. There's a third helper to do that:
759
-
760
-
blk_queue_invalidate_tags(struct request_queue *q)
761
-
762
-
Clear the internal block tag queue and re-add all the pending requests
763
-
to the request queue. The driver will receive them again on the
764
-
next request_fn run, just like it did the first time it encountered
765
-
them.
766
-
767
755
3.2.5.2 Tag info
768
756
769
757
Some block functions exist to query current tag status or to go from a
···
793
805
Most of the above is simple and straight forward, however busy_list may need
794
806
a bit of explaining. Normally we don't care too much about request ordering,
795
807
but in the event of any barrier requests in the tag queue we need to ensure
796
-
that requests are restarted in the order they were queue. This may happen
797
-
if the driver needs to use blk_queue_invalidate_tags().
808
+
that requests are restarted in the order they were queue.
798
809
799
810
3.3 I/O Submission
800
811
-22
block/blk-tag.c
-22
block/blk-tag.c
···
188
188
*/
189
189
q->queue_tags = tags;
190
190
queue_flag_set_unlocked(QUEUE_FLAG_QUEUED, q);
191
-
INIT_LIST_HEAD(&q->tag_busy_list);
192
191
return 0;
193
192
}
194
193
EXPORT_SYMBOL(blk_queue_init_tags);
···
373
374
rq->tag = tag;
374
375
bqt->tag_index[tag] = rq;
375
376
blk_start_request(rq);
376
-
list_add(&rq->queuelist, &q->tag_busy_list);
377
377
return 0;
378
378
}
379
379
EXPORT_SYMBOL(blk_queue_start_tag);
380
-
381
-
/**
382
-
* blk_queue_invalidate_tags - invalidate all pending tags
383
-
* @q: the request queue for the device
384
-
*
385
-
* Description:
386
-
* Hardware conditions may dictate a need to stop all pending requests.
387
-
* In this case, we will safely clear the block side of the tag queue and
388
-
* readd all requests to the request queue in the right order.
389
-
**/
390
-
void blk_queue_invalidate_tags(struct request_queue *q)
391
-
{
392
-
struct list_head *tmp, *n;
393
-
394
-
lockdep_assert_held(q->queue_lock);
395
-
396
-
list_for_each_safe(tmp, n, &q->tag_busy_list)
397
-
blk_requeue_request(q, list_entry_rq(tmp));
398
-
}
399
-
EXPORT_SYMBOL(blk_queue_invalidate_tags);
-2
include/linux/blkdev.h
-2
include/linux/blkdev.h
···
562
562
unsigned int dma_alignment;
563
563
564
564
struct blk_queue_tag *queue_tags;
565
-
struct list_head tag_busy_list;
566
565
567
566
unsigned int nr_sorted;
568
567
unsigned int in_flight[2];
···
1374
1375
extern int blk_queue_init_tags(struct request_queue *, int, struct blk_queue_tag *, int);
1375
1376
extern void blk_queue_free_tags(struct request_queue *);
1376
1377
extern int blk_queue_resize_tags(struct request_queue *, int);
1377
-
extern void blk_queue_invalidate_tags(struct request_queue *);
1378
1378
extern struct blk_queue_tag *blk_init_tags(int, int);
1379
1379
extern void blk_free_tags(struct blk_queue_tag *);
1380
1380