Commit f21492d3 authored by Dave Airlie's avatar Dave Airlie

Merge branch 'drm-fixes-5.1' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

- ttm regression fix
- sched documentation fix
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190424230120.3423-1-alexander.deucher@amd.com
parents b3a39c79 f5d35632
...@@ -366,10 +366,9 @@ void drm_sched_increase_karma(struct drm_sched_job *bad) ...@@ -366,10 +366,9 @@ void drm_sched_increase_karma(struct drm_sched_job *bad)
EXPORT_SYMBOL(drm_sched_increase_karma); EXPORT_SYMBOL(drm_sched_increase_karma);
/** /**
* drm_sched_hw_job_reset - stop the scheduler if it contains the bad job * drm_sched_stop - stop the scheduler
* *
* @sched: scheduler instance * @sched: scheduler instance
* @bad: bad scheduler job
* *
*/ */
void drm_sched_stop(struct drm_gpu_scheduler *sched) void drm_sched_stop(struct drm_gpu_scheduler *sched)
......
...@@ -49,9 +49,8 @@ static void ttm_bo_global_kobj_release(struct kobject *kobj); ...@@ -49,9 +49,8 @@ static void ttm_bo_global_kobj_release(struct kobject *kobj);
* ttm_global_mutex - protecting the global BO state * ttm_global_mutex - protecting the global BO state
*/ */
DEFINE_MUTEX(ttm_global_mutex); DEFINE_MUTEX(ttm_global_mutex);
struct ttm_bo_global ttm_bo_glob = { unsigned ttm_bo_glob_use_count;
.use_count = 0 struct ttm_bo_global ttm_bo_glob;
};
static struct attribute ttm_bo_count = { static struct attribute ttm_bo_count = {
.name = "bo_count", .name = "bo_count",
...@@ -1531,12 +1530,13 @@ static void ttm_bo_global_release(void) ...@@ -1531,12 +1530,13 @@ static void ttm_bo_global_release(void)
struct ttm_bo_global *glob = &ttm_bo_glob; struct ttm_bo_global *glob = &ttm_bo_glob;
mutex_lock(&ttm_global_mutex); mutex_lock(&ttm_global_mutex);
if (--glob->use_count > 0) if (--ttm_bo_glob_use_count > 0)
goto out; goto out;
kobject_del(&glob->kobj); kobject_del(&glob->kobj);
kobject_put(&glob->kobj); kobject_put(&glob->kobj);
ttm_mem_global_release(&ttm_mem_glob); ttm_mem_global_release(&ttm_mem_glob);
memset(glob, 0, sizeof(*glob));
out: out:
mutex_unlock(&ttm_global_mutex); mutex_unlock(&ttm_global_mutex);
} }
...@@ -1548,7 +1548,7 @@ static int ttm_bo_global_init(void) ...@@ -1548,7 +1548,7 @@ static int ttm_bo_global_init(void)
unsigned i; unsigned i;
mutex_lock(&ttm_global_mutex); mutex_lock(&ttm_global_mutex);
if (++glob->use_count > 1) if (++ttm_bo_glob_use_count > 1)
goto out; goto out;
ret = ttm_mem_global_init(&ttm_mem_glob); ret = ttm_mem_global_init(&ttm_mem_glob);
......
...@@ -461,8 +461,8 @@ int ttm_mem_global_init(struct ttm_mem_global *glob) ...@@ -461,8 +461,8 @@ int ttm_mem_global_init(struct ttm_mem_global *glob)
void ttm_mem_global_release(struct ttm_mem_global *glob) void ttm_mem_global_release(struct ttm_mem_global *glob)
{ {
unsigned int i;
struct ttm_mem_zone *zone; struct ttm_mem_zone *zone;
unsigned int i;
/* let the page allocator first stop the shrink work. */ /* let the page allocator first stop the shrink work. */
ttm_page_alloc_fini(); ttm_page_alloc_fini();
...@@ -475,9 +475,10 @@ void ttm_mem_global_release(struct ttm_mem_global *glob) ...@@ -475,9 +475,10 @@ void ttm_mem_global_release(struct ttm_mem_global *glob)
zone = glob->zones[i]; zone = glob->zones[i];
kobject_del(&zone->kobj); kobject_del(&zone->kobj);
kobject_put(&zone->kobj); kobject_put(&zone->kobj);
} }
kobject_del(&glob->kobj); kobject_del(&glob->kobj);
kobject_put(&glob->kobj); kobject_put(&glob->kobj);
memset(glob, 0, sizeof(*glob));
} }
static void ttm_check_swapping(struct ttm_mem_global *glob) static void ttm_check_swapping(struct ttm_mem_global *glob)
......
...@@ -420,7 +420,6 @@ extern struct ttm_bo_global { ...@@ -420,7 +420,6 @@ extern struct ttm_bo_global {
/** /**
* Protected by ttm_global_mutex. * Protected by ttm_global_mutex.
*/ */
unsigned int use_count;
struct list_head device_list; struct list_head device_list;
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment