From 59e997d5ea64eeb51eea93f99e2290e2a836645b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 17 Sep 2014 14:32:04 -0700 Subject: [PATCH] 3.10-stable patches added patches: drm-radeon-load-the-lm63-driver-for-an-lm64-thermal-chip.patch drm-ttm-choose-a-pool-to-shrink-correctly-in-ttm_dma_pool_shrink_scan.patch drm-ttm-fix-possible-division-by-0-in-ttm_dma_pool_shrink_scan.patch --- ...lm63-driver-for-an-lm64-thermal-chip.patch | 38 ++++++++++++++++ ...orrectly-in-ttm_dma_pool_shrink_scan.patch | 45 +++++++++++++++++++ ...ion-by-0-in-ttm_dma_pool_shrink_scan.patch | 40 +++++++++++++++++ queue-3.10/series | 3 ++ 4 files changed, 126 insertions(+) create mode 100644 queue-3.10/drm-radeon-load-the-lm63-driver-for-an-lm64-thermal-chip.patch create mode 100644 queue-3.10/drm-ttm-choose-a-pool-to-shrink-correctly-in-ttm_dma_pool_shrink_scan.patch create mode 100644 queue-3.10/drm-ttm-fix-possible-division-by-0-in-ttm_dma_pool_shrink_scan.patch diff --git a/queue-3.10/drm-radeon-load-the-lm63-driver-for-an-lm64-thermal-chip.patch b/queue-3.10/drm-radeon-load-the-lm63-driver-for-an-lm64-thermal-chip.patch new file mode 100644 index 00000000000..215dccb3ca9 --- /dev/null +++ b/queue-3.10/drm-radeon-load-the-lm63-driver-for-an-lm64-thermal-chip.patch @@ -0,0 +1,38 @@ +From 5dc355325b648dc9b4cf3bea4d968de46fd59215 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Sun, 27 Jul 2014 23:21:50 -0400 +Subject: drm/radeon: load the lm63 driver for an lm64 thermal chip. + +From: Alex Deucher + +commit 5dc355325b648dc9b4cf3bea4d968de46fd59215 upstream. + +Looks like the lm63 driver supports the lm64 as well. + +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/radeon_atombios.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/radeon/radeon_atombios.c ++++ b/drivers/gpu/drm/radeon/radeon_atombios.c +@@ -1908,7 +1908,7 @@ static const char *thermal_controller_na + "adm1032", + "adm1030", + "max6649", +- "lm64", ++ "lm63", /* lm64 */ + "f75375", + "asc7xxx", + }; +@@ -1919,7 +1919,7 @@ static const char *pp_lib_thermal_contro + "adm1032", + "adm1030", + "max6649", +- "lm64", ++ "lm63", /* lm64 */ + "f75375", + "RV6xx", + "RV770", diff --git a/queue-3.10/drm-ttm-choose-a-pool-to-shrink-correctly-in-ttm_dma_pool_shrink_scan.patch b/queue-3.10/drm-ttm-choose-a-pool-to-shrink-correctly-in-ttm_dma_pool_shrink_scan.patch new file mode 100644 index 00000000000..04f4d9ce21a --- /dev/null +++ b/queue-3.10/drm-ttm-choose-a-pool-to-shrink-correctly-in-ttm_dma_pool_shrink_scan.patch @@ -0,0 +1,45 @@ +From 46c2df68f03a236b30808bba361f10900c88d95e Mon Sep 17 00:00:00 2001 +From: Tetsuo Handa +Date: Sun, 3 Aug 2014 20:00:40 +0900 +Subject: drm/ttm: Choose a pool to shrink correctly in ttm_dma_pool_shrink_scan(). + +From: Tetsuo Handa + +commit 46c2df68f03a236b30808bba361f10900c88d95e upstream. + +We can use "unsigned int" instead of "atomic_t" by updating start_pool +variable under _manager->lock. This patch will make it possible to avoid +skipping when choosing a pool to shrink in round-robin style, after next +patch changes mutex_lock(_manager->lock) to !mutex_trylock(_manager->lork). + +Signed-off-by: Tetsuo Handa +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c ++++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +@@ -1006,9 +1006,9 @@ EXPORT_SYMBOL_GPL(ttm_dma_unpopulate); + static int ttm_dma_pool_mm_shrink(struct shrinker *shrink, + struct shrink_control *sc) + { +- static atomic_t start_pool = ATOMIC_INIT(0); ++ static unsigned start_pool; + unsigned idx = 0; +- unsigned pool_offset = atomic_add_return(1, &start_pool); ++ unsigned pool_offset; + unsigned shrink_pages = sc->nr_to_scan; + struct device_pools *p; + +@@ -1018,7 +1018,7 @@ static int ttm_dma_pool_mm_shrink(struct + mutex_lock(&_manager->lock); + if (!_manager->npools) + goto out; +- pool_offset = pool_offset % _manager->npools; ++ pool_offset = ++start_pool % _manager->npools; + list_for_each_entry(p, &_manager->pools, pools) { + unsigned nr_free; + diff --git a/queue-3.10/drm-ttm-fix-possible-division-by-0-in-ttm_dma_pool_shrink_scan.patch b/queue-3.10/drm-ttm-fix-possible-division-by-0-in-ttm_dma_pool_shrink_scan.patch new file mode 100644 index 00000000000..d46a766cfff --- /dev/null +++ b/queue-3.10/drm-ttm-fix-possible-division-by-0-in-ttm_dma_pool_shrink_scan.patch @@ -0,0 +1,40 @@ +From 11e504cc705e8ccb06ac93a276e11b5e8fee4d40 Mon Sep 17 00:00:00 2001 +From: Tetsuo Handa +Date: Sun, 3 Aug 2014 19:59:35 +0900 +Subject: drm/ttm: Fix possible division by 0 in ttm_dma_pool_shrink_scan(). + +From: Tetsuo Handa + +commit 11e504cc705e8ccb06ac93a276e11b5e8fee4d40 upstream. + +list_empty(&_manager->pools) being false before taking _manager->lock +does not guarantee that _manager->npools != 0 after taking _manager->lock +because _manager->npools is updated under _manager->lock. + +Signed-off-by: Tetsuo Handa +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c ++++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +@@ -1016,6 +1016,8 @@ static int ttm_dma_pool_mm_shrink(struct + return 0; + + mutex_lock(&_manager->lock); ++ if (!_manager->npools) ++ goto out; + pool_offset = pool_offset % _manager->npools; + list_for_each_entry(p, &_manager->pools, pools) { + unsigned nr_free; +@@ -1033,6 +1035,7 @@ static int ttm_dma_pool_mm_shrink(struct + p->pool->dev_name, p->pool->name, current->pid, + nr_free, shrink_pages); + } ++out: + mutex_unlock(&_manager->lock); + /* return estimated number of unused pages in pool */ + return ttm_dma_pool_get_num_unused_pages(); diff --git a/queue-3.10/series b/queue-3.10/series index 0c550aeefaa..750efe287ad 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -5,3 +5,6 @@ drm-tilcdc-tfp410-fix-dangling-sysfs-connector-node.patch drm-tilcdc-panel-fix-leak-when-unloading-the-module.patch drm-tilcdc-fix-release-order-on-exit.patch drm-tilcdc-fix-double-kfree.patch +drm-ttm-fix-possible-division-by-0-in-ttm_dma_pool_shrink_scan.patch +drm-ttm-choose-a-pool-to-shrink-correctly-in-ttm_dma_pool_shrink_scan.patch +drm-radeon-load-the-lm63-driver-for-an-lm64-thermal-chip.patch -- 2.47.3