linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sumit Semwal <sumit.semwal@linaro.org>
To: John Stultz <john.stultz@linaro.org>
Cc: guangming.cao@mediatek.com, greg@kroah.com,
	brian.starkey@arm.com, benjamin.gaignard@linaro.org,
	christian.koenig@amd.com, dri-devel@lists.freedesktop.org,
	labbott@redhat.com, linaro-mm-sig@lists.linaro.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-mediatek@lists.infradead.org, lmark@codeaurora.org,
	matthias.bgg@gmail.com, robin.murphy@arm.com,
	stable@vger.kernel.org, wsd_upstream@mediatek.com,
	kuan-ying.lee@mediatek.com
Subject: Re: [PATCH v4] dma-buf: system_heap: Use 'for_each_sgtable_sg' in pages free flow
Date: Wed, 1 Dec 2021 15:39:17 +0530	[thread overview]
Message-ID: <CAO_48GHxanR=-mN232ANwxQEiBo9zb3WjvO-6WmP6eFYWA1M5A@mail.gmail.com> (raw)
In-Reply-To: <CALAqxLVF1BPznzwjem2BcsDDoo5gMoBqjKEceZDLJan4zCtk3w@mail.gmail.com>

Hello Guangming,

On Mon, 29 Nov 2021 at 23:35, John Stultz <john.stultz@linaro.org> wrote:
>
> On Thu, Nov 25, 2021 at 11:48 PM <guangming.cao@mediatek.com> wrote:
> >
> > From: Guangming <Guangming.Cao@mediatek.com>
> >
> > For previous version, it uses 'sg_table.nent's to traverse sg_table in pages
> > free flow.
> > However, 'sg_table.nents' is reassigned in 'dma_map_sg', it means the number of
> > created entries in the DMA adderess space.
> > So, use 'sg_table.nents' in pages free flow will case some pages can't be freed.
> >
> > Here we should use sg_table.orig_nents to free pages memory, but use the
> > sgtable helper 'for each_sgtable_sg'(, instead of the previous rather common
> > helper 'for_each_sg' which maybe cause memory leak) is much better.

Thanks for catching this and the patch; applied to drm-misc-fixes.
> >
> > Fixes: d963ab0f15fb0 ("dma-buf: system_heap: Allocate higher order pages if available")
> > Signed-off-by: Guangming <Guangming.Cao@mediatek.com>
> > Reviewed-by: Robin Murphy <robin.murphy@arm.com>
> > Cc: <stable@vger.kernel.org> # 5.11.*
>
> Thanks so much for catching this and sending in all the revisions!
>
> Reviewed-by: John Stultz <john.stultz@linaro.org>


Best,
Sumit.

-- 
Thanks and regards,

Sumit Semwal (he / him)
Tech Lead - LCG, Vertical Technologies
Linaro.org │ Open source software for ARM SoCs

  reply	other threads:[~2021-12-01 10:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 12:46 [PATCH] dma_heap: use sg_table.orig_nents in sg_table release flow guangming.cao
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 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 [this message]
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='CAO_48GHxanR=-mN232ANwxQEiBo9zb3WjvO-6WmP6eFYWA1M5A@mail.gmail.com' \
    --to=sumit.semwal@linaro.org \
    --cc=benjamin.gaignard@linaro.org \
    --cc=brian.starkey@arm.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=greg@kroah.com \
    --cc=guangming.cao@mediatek.com \
    --cc=john.stultz@linaro.org \
    --cc=kuan-ying.lee@mediatek.com \
    --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=robin.murphy@arm.com \
    --cc=stable@vger.kernel.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).