From f334be9bf1bffaa0e734fc7a922a002784cd2f3a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 21 Aug 2023 15:00:09 +0200 Subject: [PATCH] 6.1-stable patches added patches: asoc-amd-vangogh-select-config_snd_amd_acp_config.patch drm-amd-display-disable-rco-for-dcn314.patch zsmalloc-allow-only-one-active-pool-compaction-context.patch --- ...ogh-select-config_snd_amd_acp_config.patch | 34 ++++++++ ...m-amd-display-disable-rco-for-dcn314.patch | 50 +++++++++++ queue-6.1/series | 3 + ...y-one-active-pool-compaction-context.patch | 87 +++++++++++++++++++ 4 files changed, 174 insertions(+) create mode 100644 queue-6.1/asoc-amd-vangogh-select-config_snd_amd_acp_config.patch create mode 100644 queue-6.1/drm-amd-display-disable-rco-for-dcn314.patch create mode 100644 queue-6.1/zsmalloc-allow-only-one-active-pool-compaction-context.patch diff --git a/queue-6.1/asoc-amd-vangogh-select-config_snd_amd_acp_config.patch b/queue-6.1/asoc-amd-vangogh-select-config_snd_amd_acp_config.patch new file mode 100644 index 00000000000..b7211922d44 --- /dev/null +++ b/queue-6.1/asoc-amd-vangogh-select-config_snd_amd_acp_config.patch @@ -0,0 +1,34 @@ +From 812a05256d673b2b9c5db906775d1e6625ba4787 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 2 Jun 2023 14:44:39 +0200 +Subject: ASoC: amd: vangogh: select CONFIG_SND_AMD_ACP_CONFIG + +From: Arnd Bergmann + +commit 812a05256d673b2b9c5db906775d1e6625ba4787 upstream. + +The vangogh driver just gained a link time dependency that now causes +randconfig builds to fail: + +x86_64-linux-ld: sound/soc/amd/vangogh/pci-acp5x.o: in function `snd_acp5x_probe': +pci-acp5x.c:(.text+0xbb): undefined reference to `snd_amd_acp_find_config' + +Fixes: e89f45edb747e ("ASoC: amd: vangogh: Add check for acp config flags in vangogh platform") +Signed-off-by: Arnd Bergmann +Link: https://lore.kernel.org/r/20230602124447.863476-1-arnd@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/amd/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/soc/amd/Kconfig ++++ b/sound/soc/amd/Kconfig +@@ -81,6 +81,7 @@ config SND_SOC_AMD_VANGOGH_MACH + tristate "AMD Vangogh support for NAU8821 CS35L41" + select SND_SOC_NAU8821 + select SND_SOC_CS35L41_SPI ++ select SND_AMD_ACP_CONFIG + depends on SND_SOC_AMD_ACP5x && I2C && SPI_MASTER + help + This option enables machine driver for Vangogh platform diff --git a/queue-6.1/drm-amd-display-disable-rco-for-dcn314.patch b/queue-6.1/drm-amd-display-disable-rco-for-dcn314.patch new file mode 100644 index 00000000000..26f5a1a11f0 --- /dev/null +++ b/queue-6.1/drm-amd-display-disable-rco-for-dcn314.patch @@ -0,0 +1,50 @@ +From 85e41f1ed5d94a26fe4e57003c399936d291ed70 Mon Sep 17 00:00:00 2001 +From: Daniel Miess +Date: Wed, 7 Jun 2023 11:11:44 -0400 +Subject: drm/amd/display: disable RCO for DCN314 + +From: Daniel Miess + +commit 85e41f1ed5d94a26fe4e57003c399936d291ed70 upstream. + +[Why] +RCO is causing error messages on some DCN314 systems + +[How] +Force disable RCO for DCN314 + +Fixes: 17fbdbda9cc8 ("drm/amd/display: Enable dcn314 DPP RCO") +Reviewed-by: Nicholas Kazlauskas +Acked-by: Hamza Mahfooz +Signed-off-by: Daniel Miess +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c | 2 +- + drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 4 ++++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c +@@ -296,7 +296,7 @@ static void dccg314_dpp_root_clock_contr + { + struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg); + +- if (dccg->dpp_clock_gated[dpp_inst] == clock_on) ++ if (dccg->dpp_clock_gated[dpp_inst] != clock_on) + return; + + if (clock_on) { +--- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +@@ -1933,6 +1933,10 @@ static bool dcn314_resource_construct( + dc->debug = debug_defaults_drv; + else + dc->debug = debug_defaults_diags; ++ ++ /* Disable root clock optimization */ ++ dc->debug.root_clock_optimization.u32All = 0; ++ + // Init the vm_helper + if (dc->vm_helper) + vm_helper_init(dc->vm_helper, 16); diff --git a/queue-6.1/series b/queue-6.1/series index ba3264dc16b..89b96f87c9a 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -168,3 +168,6 @@ drm-i915-sdvo-fix-panel_type-initialization.patch drm-amd-flush-any-delayed-gfxoff-on-suspend-entry.patch drm-amdgpu-skip-fence-gfx-interrupts-disable-enable-for-s0ix.patch drm-amdgpu-pm-fix-throttle_status-for-other-than-mp1-11.0.7.patch +asoc-amd-vangogh-select-config_snd_amd_acp_config.patch +drm-amd-display-disable-rco-for-dcn314.patch +zsmalloc-allow-only-one-active-pool-compaction-context.patch diff --git a/queue-6.1/zsmalloc-allow-only-one-active-pool-compaction-context.patch b/queue-6.1/zsmalloc-allow-only-one-active-pool-compaction-context.patch new file mode 100644 index 00000000000..54b2abfe2c9 --- /dev/null +++ b/queue-6.1/zsmalloc-allow-only-one-active-pool-compaction-context.patch @@ -0,0 +1,87 @@ +From d2658f2052c7db6ec0a79977205f8cf1cb9effc2 Mon Sep 17 00:00:00 2001 +From: Sergey Senozhatsky +Date: Tue, 18 Apr 2023 16:46:39 +0900 +Subject: zsmalloc: allow only one active pool compaction context + +From: Sergey Senozhatsky + +commit d2658f2052c7db6ec0a79977205f8cf1cb9effc2 upstream. + +zsmalloc pool can be compacted concurrently by many contexts, +e.g. + + cc1 handle_mm_fault() + do_anonymous_page() + __alloc_pages_slowpath() + try_to_free_pages() + do_try_to_free_pages( + lru_gen_shrink_node() + shrink_slab() + do_shrink_slab() + zs_shrinker_scan() + zs_compact() + +Pool compaction is currently (basically) single-threaded as +it is performed under pool->lock. Having multiple compaction +threads results in unnecessary contention, as each thread +competes for pool->lock. This, in turn, affects all zsmalloc +operations such as zs_malloc(), zs_map_object(), zs_free(), etc. + +Introduce the pool->compaction_in_progress atomic variable, +which ensures that only one compaction context can run at a +time. This reduces overall pool->lock contention in (corner) +cases when many contexts attempt to shrink zspool simultaneously. + +Link: https://lkml.kernel.org/r/20230418074639.1903197-1-senozhatsky@chromium.org +Fixes: c0547d0b6a4b ("zsmalloc: consolidate zs_pool's migrate_lock and size_class's locks") +Signed-off-by: Sergey Senozhatsky +Reviewed-by: Yosry Ahmed +Cc: Minchan Kim +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + mm/zsmalloc.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/mm/zsmalloc.c ++++ b/mm/zsmalloc.c +@@ -246,6 +246,7 @@ struct zs_pool { + struct work_struct free_work; + #endif + spinlock_t lock; ++ atomic_t compaction_in_progress; + }; + + struct zspage { +@@ -2100,6 +2101,15 @@ unsigned long zs_compact(struct zs_pool + struct size_class *class; + unsigned long pages_freed = 0; + ++ /* ++ * Pool compaction is performed under pool->lock so it is basically ++ * single-threaded. Having more than one thread in __zs_compact() ++ * will increase pool->lock contention, which will impact other ++ * zsmalloc operations that need pool->lock. ++ */ ++ if (atomic_xchg(&pool->compaction_in_progress, 1)) ++ return 0; ++ + for (i = ZS_SIZE_CLASSES - 1; i >= 0; i--) { + class = pool->size_class[i]; + if (class->index != i) +@@ -2107,6 +2117,7 @@ unsigned long zs_compact(struct zs_pool + pages_freed += __zs_compact(pool, class); + } + atomic_long_add(pages_freed, &pool->stats.pages_compacted); ++ atomic_set(&pool->compaction_in_progress, 0); + + return pages_freed; + } +@@ -2193,6 +2204,7 @@ struct zs_pool *zs_create_pool(const cha + + init_deferred_free(pool); + spin_lock_init(&pool->lock); ++ atomic_set(&pool->compaction_in_progress, 0); + + pool->name = kstrdup(name, GFP_KERNEL); + if (!pool->name) -- 2.47.3