lkml.org 
[lkml]   [2021]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.13 122/223] drm/ttm: Force re-init if ttm_global_init() fails
    Date
    From: Jason Ekstrand <jason@jlekstrand.net>

    [ Upstream commit 235c3610d5f02ee91244239b43cd9ae8b4859dff ]

    If we have a failure, decrement the reference count so that the next
    call to ttm_global_init() will actually do something instead of assume
    everything is all set up.

    Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
    Fixes: 62b53b37e4b1 ("drm/ttm: use a static ttm_bo_global instance")
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20210720181357.2760720-5-jason@jlekstrand.net
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/gpu/drm/ttm/ttm_device.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
    index 3d9c62b93e29..ef6e0c042bb1 100644
    --- a/drivers/gpu/drm/ttm/ttm_device.c
    +++ b/drivers/gpu/drm/ttm/ttm_device.c
    @@ -100,6 +100,8 @@ static int ttm_global_init(void)
    debugfs_create_atomic_t("buffer_objects", 0444, ttm_debugfs_root,
    &glob->bo_count);
    out:
    + if (ret)
    + --ttm_glob_use_count;
    mutex_unlock(&ttm_global_mutex);
    return ret;
    }
    --
    2.30.2


    \
     
     \ /
      Last update: 2021-07-26 18:34    [W:4.079 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site