mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brian Yip <itsbriany@gmail.com>
To: christian.koenig@amd.com
Cc: ray.huang@amd.com, Jerry.Zhang@amd.com, airlied@linux.ie,
	daniel@ffwll.ch, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Brian Yip <itsbriany@gmail.com>
Subject: [PATCH 3/3] drm/ttm: Fix ttm_bo_glob.kobj state on cleanup
Date: Sun, 14 Apr 2019 23:37:29 +0000	[thread overview]
Message-ID: <20190414233729.17956-4-itsbriany@gmail.com> (raw)
In-Reply-To: <20190414233729.17956-1-itsbriany@gmail.com>

Cleanup ttm_bo_glob.kobj when its reference count hits 0
so that it can be re-initialized by future ttm_bo_global_init calls
without dumping a stack trace.

Signed-off-by: Brian Yip <itsbriany@gmail.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 988416fb8a0b..1e1844f4a4fa 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1535,6 +1535,10 @@ static void ttm_bo_global_release(void)
 	kobject_del(&glob->kobj);
 	kobject_put(&glob->kobj);
 	ttm_mem_global_release(&ttm_mem_glob);
+
+	if (!kref_read(&glob->kobj.kref))
+		glob->kobj.state_initialized = 0;
+
 out:
 	mutex_unlock(&ttm_global_mutex);
 }
-- 
2.20.1


      parent reply	other threads:[~2019-04-14 23:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-14 23:37 [PATCH 0/3] drm/ttm: Cleanup state in global ttm structures Brian Yip
2019-04-14 23:37 ` [PATCH 1/3] drm/ttm: Reset num_zones on ttm_mem_global cleanup Brian Yip
2019-04-15  6:25   ` Koenig, Christian
2019-04-14 23:37 ` [PATCH 2/3] drm/ttm: Fix ttm_mem_glob.kobj state on cleanup Brian Yip
2019-04-14 23:37 ` Brian Yip [this message]

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=20190414233729.17956-4-itsbriany@gmail.com \
    --to=itsbriany@gmail.com \
    --cc=Jerry.Zhang@amd.com \
    --cc=airlied@linux.ie \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ray.huang@amd.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

all inboxes | Powered by JetHome®