1BLK_QUEUE_DMA_DRAIN(9)           Block Devices          BLK_QUEUE_DMA_DRAIN(9)
2
3
4

NAME

6       blk_queue_dma_drain - Set up a drain buffer for excess dma.
7

SYNOPSIS

9       int blk_queue_dma_drain(struct request_queue * q,
10                               dma_drain_needed_fn * dma_drain_needed,
11                               void * buf, unsigned int size);
12

ARGUMENTS

14       q
15           the request queue for the device
16
17       dma_drain_needed
18           fn which returns non-zero if drain is necessary
19
20       buf
21           physically contiguous buffer
22
23       size
24           size of the buffer in bytes
25

DESCRIPTION

27       Some devices have excess DMA problems and can't simply discard (or zero
28       fill) the unwanted piece of the transfer. They have to have a real area
29       of memory to transfer it into. The use case for this is ATAPI devices
30       in DMA mode. If the packet command causes a transfer bigger than the
31       transfer size some HBAs will lock up if there aren't DMA elements to
32       contain the excess transfer. What this API does is adjust the queue so
33       that the buf is always appended silently to the scatterlist.
34

NOTE

36       This routine adjusts max_hw_segments to make room for appending the
37       drain buffer. If you call blk_queue_max_segments after calling this
38       routine, you must set the limit to one fewer than your device can
39       support otherwise there won't be room for the drain buffer.
40
42Kernel Hackers Manual 3.10         June 2019            BLK_QUEUE_DMA_DRAIN(9)
Impressum