Skip to content

Commit 3f0fb4e

Browse files
osctobetorvalds
authored andcommitted
Documentation/DMA-API-HOWTO.txt: fix misleading example
See: DMA-API.txt, part Id, DMA_FROM_DEVICE description. Signed-off-by: Michal Miroslaw <mirq-linux@rere.qmqm.pl> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 91f6cdf commit 3f0fb4e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Documentation/DMA-API-HOWTO.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -613,13 +613,13 @@ to use the dma_sync_*() interfaces.
613613
pass_to_upper_layers(cp->rx_buf);
614614
make_and_setup_new_rx_buf(cp);
615615
} else {
616-
/* Just sync the buffer and give it back
617-
* to the card.
616+
/* CPU should not write to
617+
* DMA_FROM_DEVICE-mapped area,
618+
* so dma_sync_single_for_device() is
619+
* not needed here. It would be required
620+
* for DMA_BIDIRECTIONAL mapping if
621+
* the memory was modified.
618622
*/
619-
dma_sync_single_for_device(&cp->dev,
620-
cp->rx_dma,
621-
cp->rx_len,
622-
DMA_FROM_DEVICE);
623623
give_rx_buf_to_card(cp);
624624
}
625625
}

0 commit comments

Comments
 (0)