]> git.baikalelectronics.ru Git - kernel.git/commit
drm/ttm: Initialize debugfs from ttm_global_init()
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 21 Jul 2021 15:23:57 +0000 (10:23 -0500)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 22 Jul 2021 10:09:12 +0000 (12:09 +0200)
commit2be5737c722222a0127d57d9f1ad68eddfa4771d
tree5dfe71db4d7e26e856dd5ae628f65b686ac61025
parent0cdfef8b626a30cb25e23acffa852fa5f7991df7
drm/ttm: Initialize debugfs from ttm_global_init()

We create a bunch of debugfs entries as a side-effect of
ttm_global_init() and then never clean them up.  This isn't usually a
problem because we free the whole debugfs directory on module unload.
However, if the global reference count ever goes to zero and then
ttm_global_init() is called again, we'll re-create those debugfs entries
and debugfs will complain in dmesg that we're creating entries that
already exist.  This patch fixes this problem by changing the lifetime
of the whole TTM debugfs directory to match that of the TTM global
state.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210721152358.2893314-6-jason@jlekstrand.net
drivers/gpu/drm/ttm/ttm_device.c
drivers/gpu/drm/ttm/ttm_module.c