All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dma_heap: use sg_table.orig_nents in sg_table release flow
@ 2021-11-25 12:46 ` guangming.cao
  0 siblings, 0 replies; 43+ messages in thread
From: guangming.cao @ 2021-11-25 12:46 UTC (permalink / raw)
  To: Sumit Semwal, Benjamin Gaignard, Liam Mark, Laura Abbott,
	Brian Starkey, John Stultz, Christian König,
	Matthias Brugger, open list:DMA-BUF HEAPS FRAMEWORK,
	open list:DMA-BUF HEAPS FRAMEWORK,
	moderated list:DMA-BUF HEAPS FRAMEWORK, open list,
	moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support
  Cc: Guangming, wsd_upstream

From: Guangming <Guangming.Cao@mediatek.com>

Use (sg_table.orig_nents) rather than (sg_table.nents) to traverse
sg_table to free sg_table.
Use (sg_table.nents) maybe will casuse some pages can't be freed.

Signed-off-by: Guangming <Guangming.Cao@mediatek.com>
---
 drivers/dma-buf/heaps/system_heap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c
index 23a7e74ef966..ce10d4eb674c 100644
--- a/drivers/dma-buf/heaps/system_heap.c
+++ b/drivers/dma-buf/heaps/system_heap.c
@@ -289,7 +289,7 @@ static void system_heap_dma_buf_release(struct dma_buf *dmabuf)
 	int i;
 
 	table = &buffer->sg_table;
-	for_each_sg(table->sgl, sg, table->nents, i) {
+	for_each_sg(table->sgl, sg, table->orig_nents, i) {
 		struct page *page = sg_page(sg);
 
 		__free_pages(page, compound_order(page));
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2021-12-01 10:11 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25 12:46 [PATCH] dma_heap: use sg_table.orig_nents in sg_table release flow guangming.cao
2021-11-25 12:46 ` guangming.cao
2021-11-25 12:46 ` guangming.cao
2021-11-25 12:46 ` guangming.cao
2021-11-25 13:28 ` Robin Murphy
2021-11-25 13:28   ` Robin Murphy
2021-11-25 13:28   ` Robin Murphy
2021-11-25 13:49   ` [PATCH v2] dma_heap: use for_each_sgtable_sg " guangming.cao
2021-11-25 13:49     ` guangming.cao
2021-11-25 13:49     ` guangming.cao
2021-11-25 13:49     ` guangming.cao
2021-11-25 14:08     ` Robin Murphy
2021-11-25 14:08       ` Robin Murphy
2021-11-25 14:08       ` Robin Murphy
2021-11-25 14:08       ` Robin Murphy
2021-11-26  3:16       ` [PATCH v3] dma-buf: system_heap: Use 'for_each_sgtable_sg' in pages free flow guangming.cao
2021-11-26  3:16         ` guangming.cao
2021-11-26  3:16         ` guangming.cao
2021-11-26  3:16         ` guangming.cao
2021-11-26  6:31         ` Greg KH
2021-11-26  6:31           ` Greg KH
2021-11-26  6:31           ` Greg KH
2021-11-26  6:31           ` Greg KH
2021-11-26  7:49           ` [PATCH v4] " guangming.cao
2021-11-26  7:49             ` guangming.cao
2021-11-26  7:49             ` guangming.cao
2021-11-26  7:49             ` guangming.cao
2021-11-26 10:05             ` Christian König
2021-11-26 10:05               ` Christian König
2021-11-26 10:05               ` Christian König
2021-11-26 10:05               ` Christian König
2021-11-29 18:05             ` John Stultz
2021-11-29 18:05               ` John Stultz
2021-11-29 18:05               ` John Stultz
2021-11-29 18:05               ` John Stultz
2021-12-01 10:09               ` Sumit Semwal
2021-12-01 10:09                 ` Sumit Semwal
2021-12-01 10:09                 ` Sumit Semwal
2021-12-01 10:09                 ` Sumit Semwal
2021-11-25 14:38     ` [PATCH v2] dma_heap: use for_each_sgtable_sg in sg_table release flow Kuan-Ying Lee
2021-11-25 14:38       ` Kuan-Ying Lee
2021-11-25 14:38       ` Kuan-Ying Lee
2021-11-25 14:38       ` Kuan-Ying Lee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.