From: <guangming.cao@mediatek.com>
To: "Sumit Semwal" <sumit.semwal@linaro.org>,
"Benjamin Gaignard" <benjamin.gaignard@linaro.org>,
"Liam Mark" <lmark@codeaurora.org>,
"Laura Abbott" <labbott@redhat.com>,
"Brian Starkey" <Brian.Starkey@arm.com>,
"John Stultz" <john.stultz@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"open list:DMA-BUF HEAPS FRAMEWORK" <linux-media@vger.kernel.org>,
"open list:DMA-BUF HEAPS FRAMEWORK"
<dri-devel@lists.freedesktop.org>,
"moderated list:DMA-BUF HEAPS FRAMEWORK"
<linaro-mm-sig@lists.linaro.org>,
"open list" <linux-kernel@vger.kernel.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-arm-kernel@lists.infradead.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>
Cc: <wsd_upstream@mediatek.com>, Guangming <Guangming.Cao@mediatek.com>
Subject: [PATCH] dma_heap: use sg_table.orig_nents in sg_table release flow
Date: Thu, 25 Nov 2021 20:46:25 +0800 [thread overview]
Message-ID: <20211125124626.60068-1-guangming.cao@mediatek.com> (raw)
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
next reply other threads:[~2021-11-25 12:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 12:46 guangming.cao [this message]
2021-11-25 13:28 ` [PATCH] dma_heap: use sg_table.orig_nents in sg_table release flow Robin Murphy
2021-11-25 13:49 ` [PATCH v2] dma_heap: use for_each_sgtable_sg " guangming.cao
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 6:31 ` Greg KH
2021-11-26 7:49 ` [PATCH v4] " guangming.cao
2021-11-26 10:05 ` Christian König
2021-11-29 18:05 ` John Stultz
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211125124626.60068-1-guangming.cao@mediatek.com \
--to=guangming.cao@mediatek.com \
--cc=Brian.Starkey@arm.com \
--cc=benjamin.gaignard@linaro.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=john.stultz@linaro.org \
--cc=labbott@redhat.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=lmark@codeaurora.org \
--cc=matthias.bgg@gmail.com \
--cc=sumit.semwal@linaro.org \
--cc=wsd_upstream@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).