From: Sasha Levin Date: Sat, 3 Feb 2024 17:24:48 +0000 (-0500) Subject: Fixes for 6.6 X-Git-Tag: v6.1.77~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78c93a82b10b37ba3b5317d1c01f8404949660be;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 6.6 Signed-off-by: Sasha Levin --- diff --git a/queue-6.6/drm-amdgpu-fix-missing-error-code-in-gmc_v6-7-8-9_0_.patch b/queue-6.6/drm-amdgpu-fix-missing-error-code-in-gmc_v6-7-8-9_0_.patch new file mode 100644 index 00000000000..b29172dda74 --- /dev/null +++ b/queue-6.6/drm-amdgpu-fix-missing-error-code-in-gmc_v6-7-8-9_0_.patch @@ -0,0 +1,97 @@ +From 8db77d212b623104f3d275a9c21f2b57c6a6e055 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 30 Jan 2024 12:10:38 +0530 +Subject: drm/amdgpu: Fix missing error code in 'gmc_v6/7/8/9_0_hw_init()' +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Srinivasan Shanmugam + +[ Upstream commit 16da399091dca3d1e48109086403587af37cc196 ] + +Return 0 for success scenairos in 'gmc_v6/7/8/9_0_hw_init()' + +Fixes the below: +drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c:920 gmc_v6_0_hw_init() warn: missing error code? 'r' +drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c:1104 gmc_v7_0_hw_init() warn: missing error code? 'r' +drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c:1224 gmc_v8_0_hw_init() warn: missing error code? 'r' +drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c:2347 gmc_v9_0_hw_init() warn: missing error code? 'r' + +Fixes: fac4ebd79fed ("drm/amdgpu: Fix with right return code '-EIO' in 'amdgpu_gmc_vram_checking()'") +Cc: Christian König +Cc: Alex Deucher +Signed-off-by: Srinivasan Shanmugam +Reviewed-by: Christian König +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 4 ++-- + drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 4 ++-- + drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 4 ++-- + drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 4 ++-- + 4 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +index 5b837a65fad2..dfee4aae8039 100644 +--- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +@@ -914,8 +914,8 @@ static int gmc_v6_0_hw_init(void *handle) + + if (amdgpu_emu_mode == 1) + return amdgpu_gmc_vram_checking(adev); +- else +- return r; ++ ++ return 0; + } + + static int gmc_v6_0_hw_fini(void *handle) +diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +index 6a6929ac2748..fd905889a4c6 100644 +--- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +@@ -1103,8 +1103,8 @@ static int gmc_v7_0_hw_init(void *handle) + + if (amdgpu_emu_mode == 1) + return amdgpu_gmc_vram_checking(adev); +- else +- return r; ++ ++ return 0; + } + + static int gmc_v7_0_hw_fini(void *handle) +diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +index 5af235202513..0bebcdbb2658 100644 +--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +@@ -1224,8 +1224,8 @@ static int gmc_v8_0_hw_init(void *handle) + + if (amdgpu_emu_mode == 1) + return amdgpu_gmc_vram_checking(adev); +- else +- return r; ++ ++ return 0; + } + + static int gmc_v8_0_hw_fini(void *handle) +diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +index f9f43742e9ce..8ace3f6210d3 100644 +--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +@@ -2373,8 +2373,8 @@ static int gmc_v9_0_hw_init(void *handle) + + if (amdgpu_emu_mode == 1) + return amdgpu_gmc_vram_checking(adev); +- else +- return r; ++ ++ return 0; + } + + /** +-- +2.43.0 + diff --git a/queue-6.6/pds_core-prevent-health-thread-from-running-during-r.patch b/queue-6.6/pds_core-prevent-health-thread-from-running-during-r.patch new file mode 100644 index 00000000000..abab8bb6482 --- /dev/null +++ b/queue-6.6/pds_core-prevent-health-thread-from-running-during-r.patch @@ -0,0 +1,86 @@ +From 6c0a83490d8019ba7eb1ba172de81b1a151f80e3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 29 Jan 2024 15:40:30 -0800 +Subject: pds_core: Prevent health thread from running during reset/remove + +From: Brett Creeley + +[ Upstream commit d9407ff11809c6812bb84fe7be9c1367d758e5c8 ] + +The PCIe reset handlers can run at the same time as the +health thread. This can cause the health thread to +stomp on the PCIe reset. Fix this by preventing the +health thread from running while a PCIe reset is happening. + +As part of this use timer_shutdown_sync() during reset and +remove to make sure the timer doesn't ever get rearmed. + +Fixes: ffa55858330f ("pds_core: implement pci reset handlers") +Signed-off-by: Brett Creeley +Reviewed-by: Shannon Nelson +Reviewed-by: Przemek Kitszel +Link: https://lore.kernel.org/r/20240129234035.69802-2-brett.creeley@amd.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/amd/pds_core/main.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/amd/pds_core/main.c b/drivers/net/ethernet/amd/pds_core/main.c +index 7cc5a6b94939..6d589ac532a3 100644 +--- a/drivers/net/ethernet/amd/pds_core/main.c ++++ b/drivers/net/ethernet/amd/pds_core/main.c +@@ -298,7 +298,7 @@ static int pdsc_init_pf(struct pdsc *pdsc) + err_out_teardown: + pdsc_teardown(pdsc, PDSC_TEARDOWN_REMOVING); + err_out_unmap_bars: +- del_timer_sync(&pdsc->wdtimer); ++ timer_shutdown_sync(&pdsc->wdtimer); + if (pdsc->wq) + destroy_workqueue(pdsc->wq); + mutex_destroy(&pdsc->config_lock); +@@ -425,7 +425,7 @@ static void pdsc_remove(struct pci_dev *pdev) + */ + pdsc_sriov_configure(pdev, 0); + +- del_timer_sync(&pdsc->wdtimer); ++ timer_shutdown_sync(&pdsc->wdtimer); + if (pdsc->wq) + destroy_workqueue(pdsc->wq); + +@@ -449,10 +449,24 @@ static void pdsc_remove(struct pci_dev *pdev) + devlink_free(dl); + } + ++static void pdsc_stop_health_thread(struct pdsc *pdsc) ++{ ++ timer_shutdown_sync(&pdsc->wdtimer); ++ if (pdsc->health_work.func) ++ cancel_work_sync(&pdsc->health_work); ++} ++ ++static void pdsc_restart_health_thread(struct pdsc *pdsc) ++{ ++ timer_setup(&pdsc->wdtimer, pdsc_wdtimer_cb, 0); ++ mod_timer(&pdsc->wdtimer, jiffies + 1); ++} ++ + static void pdsc_reset_prepare(struct pci_dev *pdev) + { + struct pdsc *pdsc = pci_get_drvdata(pdev); + ++ pdsc_stop_health_thread(pdsc); + pdsc_fw_down(pdsc); + + pdsc_unmap_bars(pdsc); +@@ -489,6 +503,7 @@ static void pdsc_reset_done(struct pci_dev *pdev) + } + + pdsc_fw_up(pdsc); ++ pdsc_restart_health_thread(pdsc); + } + + static const struct pci_error_handlers pdsc_err_handler = { +-- +2.43.0 + diff --git a/queue-6.6/series b/queue-6.6/series index f6dd4660344..767fac34810 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -322,3 +322,5 @@ asoc-qcom-sc8280xp-limit-speaker-volumes.patch asoc-codecs-wcd938x-fix-headphones-volume-controls.patch asoc-codecs-lpass-wsa-macro-fix-compander-volume-hack.patch asoc-codecs-wsa883x-fix-pa-volume-control.patch +drm-amdgpu-fix-missing-error-code-in-gmc_v6-7-8-9_0_.patch +pds_core-prevent-health-thread-from-running-during-r.patch