]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 6.6
authorSasha Levin <sashal@kernel.org>
Sat, 3 Feb 2024 17:24:48 +0000 (12:24 -0500)
committerSasha Levin <sashal@kernel.org>
Sat, 3 Feb 2024 17:24:48 +0000 (12:24 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-6.6/drm-amdgpu-fix-missing-error-code-in-gmc_v6-7-8-9_0_.patch [new file with mode: 0644]
queue-6.6/pds_core-prevent-health-thread-from-running-during-r.patch [new file with mode: 0644]
queue-6.6/series

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 (file)
index 0000000..b29172d
--- /dev/null
@@ -0,0 +1,97 @@
+From 8db77d212b623104f3d275a9c21f2b57c6a6e055 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+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 <srinivasan.shanmugam@amd.com>
+
+[ 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 <christian.koenig@amd.com>
+Cc: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 (file)
index 0000000..abab8bb
--- /dev/null
@@ -0,0 +1,86 @@
+From 6c0a83490d8019ba7eb1ba172de81b1a151f80e3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 29 Jan 2024 15:40:30 -0800
+Subject: pds_core: Prevent health thread from running during reset/remove
+
+From: Brett Creeley <brett.creeley@amd.com>
+
+[ 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 <brett.creeley@amd.com>
+Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
+Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
+Link: https://lore.kernel.org/r/20240129234035.69802-2-brett.creeley@amd.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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
+
index f6dd46603445793ac463d8c0f0c991005a12c67e..767fac348108640f29a347af88c14f5000ee5eb4 100644 (file)
@@ -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