From: "Koenig, Christian" <Christian.Koenig@amd.com>
To: Fuqian Huang <huangfq.daxian@gmail.com>
Cc: "Huang, Ray" <Ray.Huang@amd.com>,
Junwei Zhang <Jerry.Zhang@amd.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] drm/ttm: use the same attributes when freeing d_page->vaddr
Date: Tue, 16 Jul 2019 13:38:43 +0000 [thread overview]
Message-ID: <6f28e750-02e4-438a-3680-a4697014689d@amd.com> (raw)
In-Reply-To: <20190711031021.23512-1-huangfq.daxian@gmail.com>
Am 11.07.19 um 05:10 schrieb Fuqian Huang:
> In function __ttm_dma_alloc_page(), d_page->addr is allocated
> by dma_alloc_attrs() but freed with use dma_free_coherent() in
> __ttm_dma_free_page().
> Use the correct dma_free_attrs() to free d_page->vaddr.
>
> Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
How do you want to upstream that? Should I pull it into our tree?
Thanks,
Christian.
> ---
> drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> index d594f7520b7b..7d78e6deac89 100644
> --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> @@ -285,9 +285,13 @@ static int ttm_set_pages_caching(struct dma_pool *pool,
>
> static void __ttm_dma_free_page(struct dma_pool *pool, struct dma_page *d_page)
> {
> + unsigned long attrs = 0;
> dma_addr_t dma = d_page->dma;
> d_page->vaddr &= ~VADDR_FLAG_HUGE_POOL;
> - dma_free_coherent(pool->dev, pool->size, (void *)d_page->vaddr, dma);
> + if (pool->type & IS_HUGE)
> + attrs = DMA_ATTR_NO_WARN;
> +
> + dma_free_attrs(pool->dev, pool->size, (void *)d_page->vaddr, dma, attrs);
>
> kfree(d_page);
> d_page = NULL;
next prev parent reply other threads:[~2019-07-16 13:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-11 3:10 Fuqian Huang
2019-07-16 13:38 ` Koenig, Christian [this message]
2019-07-18 7:21 ` Fuqian Huang
2019-07-18 7:56 ` Koenig, Christian
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=6f28e750-02e4-438a-3680-a4697014689d@amd.com \
--to=christian.koenig@amd.com \
--cc=Jerry.Zhang@amd.com \
--cc=Ray.Huang@amd.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=huangfq.daxian@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome