lkml.org 
[lkml]   [2019]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] lib/scatterlist.c: add more commit for sg_alloc_table_from_pages
Date
The get_user_pages_fast() may mess up the page order in @pages array,
We will get the wrong DMA results in this case.

Add more commit to clarify it.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
lib/scatterlist.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 739dc9fe2c55..c170afb1a25e 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -450,6 +450,9 @@ EXPORT_SYMBOL(__sg_alloc_table_from_pages);
* specified by the page array. The returned sg table is released by
* sg_free_table.
*
+ * Note: Do not use get_user_pages_fast() to pin the pages for @pages array,
+ * it may mess up the page order, and we will get the wrong DMA results.
+
* Returns:
* 0 on success, negative error on failure
*/
--
2.17.1
\
 
 \ /
  Last update: 2019-04-08 04:39    [W:0.308 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site