linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <guangming.cao@mediatek.com>
To: <christian.koenig@amd.com>
Cc: <dri-devel@lists.freedesktop.org>, <guangming.cao@mediatek.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>, <matthias.bgg@gmail.com>,
	<sumit.semwal@linaro.org>, <wsd_upstream@mediatek.com>,
	Guangming Cao <Guangming.Cao@mediatek.com>
Subject: [PATCH v2] dma_buf: remove dmabuf sysfs teardown before release
Date: Tue, 20 Jul 2021 18:31:58 +0800	[thread overview]
Message-ID: <20210720103158.83439-1-guangming.cao@mediatek.com> (raw)
In-Reply-To: <8d7dfc78-aa85-48b5-2828-21ec6b463ac3@amd.com>

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

Dmabuf sysfs stat is used for dmabuf info track.
But these file maybe still in use after buffer released,
should clear it before buffer release.

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

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index b1a6db71c656..63d32261b63f 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -76,12 +76,12 @@ static void dma_buf_release(struct dentry *dentry)
 	 */
 	BUG_ON(dmabuf->cb_shared.active || dmabuf->cb_excl.active);
 
+	dma_buf_stats_teardown(dmabuf);
 	dmabuf->ops->release(dmabuf);
 
 	if (dmabuf->resv == (struct dma_resv *)&dmabuf[1])
 		dma_resv_fini(dmabuf->resv);
 
-	dma_buf_stats_teardown(dmabuf);
 	module_put(dmabuf->owner);
 	kfree(dmabuf->name);
 	kfree(dmabuf);
-- 
2.17.1


  parent reply	other threads:[~2021-07-20 10:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19  5:19 [PATCH] dma_buf: remove dmabuf sysfs teardown before release/detach guangming.cao
2021-07-19 11:16 ` Christian König
2021-07-20  9:31 ` Christian König
2021-07-20 10:29   ` guangming.cao
2021-07-20 10:31   ` guangming.cao [this message]
2021-07-20 11:00     ` [PATCH v2] dma_buf: remove dmabuf sysfs teardown before release Christian König

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=20210720103158.83439-1-guangming.cao@mediatek.com \
    --to=guangming.cao@mediatek.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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=matthias.bgg@gmail.com \
    --cc=sumit.semwal@linaro.org \
    --cc=wsd_upstream@mediatek.com \
    --subject='Re: [PATCH v2] dma_buf: remove dmabuf sysfs teardown before release' \
    /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

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox