From: Greg Kroah-Hartman Date: Mon, 11 Apr 2022 09:25:04 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.9.310~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c31754d4837517f2e9de84d351855871f481743d;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: drm-amdgpu-smu10-fix-soc-fclk-units-in-auto-mode.patch drm-amdkfd-create-file-descriptor-after-client-is-added-to-smi_clients-list.patch drm-nouveau-pmu-add-missing-callbacks-for-tegra-devices.patch --- diff --git a/queue-5.10/drm-amdgpu-smu10-fix-soc-fclk-units-in-auto-mode.patch b/queue-5.10/drm-amdgpu-smu10-fix-soc-fclk-units-in-auto-mode.patch new file mode 100644 index 00000000000..0975617b349 --- /dev/null +++ b/queue-5.10/drm-amdgpu-smu10-fix-soc-fclk-units-in-auto-mode.patch @@ -0,0 +1,54 @@ +From 2f25d8ce09b7ba5d769c132ba3d4eb84a941d2cb Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Fri, 1 Apr 2022 11:08:48 -0400 +Subject: drm/amdgpu/smu10: fix SoC/fclk units in auto mode + +From: Alex Deucher + +commit 2f25d8ce09b7ba5d769c132ba3d4eb84a941d2cb upstream. + +SMU takes clock limits in Mhz units. socclk and fclk were +using 10 khz units in some cases. Switch to Mhz units. +Fixes higher than required SoC clocks. + +Fixes: 97cf32996c46d9 ("drm/amd/pm: Removed fixed clock in auto mode DPM") +Reviewed-by: Paul Menzel +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c ++++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +@@ -709,13 +709,13 @@ static int smu10_dpm_force_dpm_level(str + smum_send_msg_to_smc_with_parameter(hwmgr, + PPSMC_MSG_SetHardMinFclkByFreq, + hwmgr->display_config->num_display > 3 ? +- data->clock_vol_info.vdd_dep_on_fclk->entries[0].clk : ++ (data->clock_vol_info.vdd_dep_on_fclk->entries[0].clk / 100) : + min_mclk, + NULL); + + smum_send_msg_to_smc_with_parameter(hwmgr, + PPSMC_MSG_SetHardMinSocclkByFreq, +- data->clock_vol_info.vdd_dep_on_socclk->entries[0].clk, ++ data->clock_vol_info.vdd_dep_on_socclk->entries[0].clk / 100, + NULL); + smum_send_msg_to_smc_with_parameter(hwmgr, + PPSMC_MSG_SetHardMinVcn, +@@ -728,11 +728,11 @@ static int smu10_dpm_force_dpm_level(str + NULL); + smum_send_msg_to_smc_with_parameter(hwmgr, + PPSMC_MSG_SetSoftMaxFclkByFreq, +- data->clock_vol_info.vdd_dep_on_fclk->entries[index_fclk].clk, ++ data->clock_vol_info.vdd_dep_on_fclk->entries[index_fclk].clk / 100, + NULL); + smum_send_msg_to_smc_with_parameter(hwmgr, + PPSMC_MSG_SetSoftMaxSocclkByFreq, +- data->clock_vol_info.vdd_dep_on_socclk->entries[index_socclk].clk, ++ data->clock_vol_info.vdd_dep_on_socclk->entries[index_socclk].clk / 100, + NULL); + smum_send_msg_to_smc_with_parameter(hwmgr, + PPSMC_MSG_SetSoftMaxVcn, diff --git a/queue-5.10/drm-amdkfd-create-file-descriptor-after-client-is-added-to-smi_clients-list.patch b/queue-5.10/drm-amdkfd-create-file-descriptor-after-client-is-added-to-smi_clients-list.patch new file mode 100644 index 00000000000..886bffa954f --- /dev/null +++ b/queue-5.10/drm-amdkfd-create-file-descriptor-after-client-is-added-to-smi_clients-list.patch @@ -0,0 +1,73 @@ +From e79a2398e1b2d47060474dca291542368183bc0f Mon Sep 17 00:00:00 2001 +From: Lee Jones +Date: Thu, 31 Mar 2022 13:21:17 +0100 +Subject: drm/amdkfd: Create file descriptor after client is added to smi_clients list +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Lee Jones + +commit e79a2398e1b2d47060474dca291542368183bc0f upstream. + +This ensures userspace cannot prematurely clean-up the client before +it is fully initialised which has been proven to cause issues in the +past. + +Cc: Felix Kuehling +Cc: Alex Deucher +Cc: "Christian König" +Cc: "Pan, Xinhui" +Cc: David Airlie +Cc: Daniel Vetter +Cc: amd-gfx@lists.freedesktop.org +Cc: dri-devel@lists.freedesktop.org +Signed-off-by: Lee Jones +Reviewed-by: Felix Kuehling +Signed-off-by: Felix Kuehling +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 24 +++++++++++++++--------- + 1 file changed, 15 insertions(+), 9 deletions(-) + +--- a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c +@@ -270,15 +270,6 @@ int kfd_smi_event_open(struct kfd_dev *d + return ret; + } + +- ret = anon_inode_getfd(kfd_smi_name, &kfd_smi_ev_fops, (void *)client, +- O_RDWR); +- if (ret < 0) { +- kfifo_free(&client->fifo); +- kfree(client); +- return ret; +- } +- *fd = ret; +- + init_waitqueue_head(&client->wait_queue); + spin_lock_init(&client->lock); + client->events = 0; +@@ -288,5 +279,20 @@ int kfd_smi_event_open(struct kfd_dev *d + list_add_rcu(&client->list, &dev->smi_clients); + spin_unlock(&dev->smi_lock); + ++ ret = anon_inode_getfd(kfd_smi_name, &kfd_smi_ev_fops, (void *)client, ++ O_RDWR); ++ if (ret < 0) { ++ spin_lock(&dev->smi_lock); ++ list_del_rcu(&client->list); ++ spin_unlock(&dev->smi_lock); ++ ++ synchronize_rcu(); ++ ++ kfifo_free(&client->fifo); ++ kfree(client); ++ return ret; ++ } ++ *fd = ret; ++ + return 0; + } diff --git a/queue-5.10/drm-nouveau-pmu-add-missing-callbacks-for-tegra-devices.patch b/queue-5.10/drm-nouveau-pmu-add-missing-callbacks-for-tegra-devices.patch new file mode 100644 index 00000000000..505ad6bbb53 --- /dev/null +++ b/queue-5.10/drm-nouveau-pmu-add-missing-callbacks-for-tegra-devices.patch @@ -0,0 +1,69 @@ +From 38d4e5cf5b08798f093374e53c2f4609d5382dd5 Mon Sep 17 00:00:00 2001 +From: Karol Herbst +Date: Tue, 22 Mar 2022 13:48:00 +0100 +Subject: drm/nouveau/pmu: Add missing callbacks for Tegra devices + +From: Karol Herbst + +commit 38d4e5cf5b08798f093374e53c2f4609d5382dd5 upstream. + +Fixes a crash booting on those platforms with nouveau. + +Fixes: 4cdd2450bf73 ("drm/nouveau/pmu/gm200-: use alternate falcon reset sequence") +Cc: Ben Skeggs +Cc: Karol Herbst +Cc: dri-devel@lists.freedesktop.org +Cc: nouveau@lists.freedesktop.org +Cc: # v5.17+ +Signed-off-by: Karol Herbst +Reviewed-by: Lyude Paul +Link: https://patchwork.freedesktop.org/patch/msgid/20220322124800.2605463-1-kherbst@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c | 1 + + drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp102.c | 2 +- + drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp10b.c | 1 + + drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h | 1 + + 4 files changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c +@@ -216,6 +216,7 @@ gm20b_pmu = { + .intr = gt215_pmu_intr, + .recv = gm20b_pmu_recv, + .initmsg = gm20b_pmu_initmsg, ++ .reset = gf100_pmu_reset, + }; + + #if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC) +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp102.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp102.c +@@ -23,7 +23,7 @@ + */ + #include "priv.h" + +-static void ++void + gp102_pmu_reset(struct nvkm_pmu *pmu) + { + struct nvkm_device *device = pmu->subdev.device; +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp10b.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp10b.c +@@ -83,6 +83,7 @@ gp10b_pmu = { + .intr = gt215_pmu_intr, + .recv = gm20b_pmu_recv, + .initmsg = gm20b_pmu_initmsg, ++ .reset = gp102_pmu_reset, + }; + + #if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC) +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h +@@ -41,6 +41,7 @@ int gt215_pmu_send(struct nvkm_pmu *, u3 + + bool gf100_pmu_enabled(struct nvkm_pmu *); + void gf100_pmu_reset(struct nvkm_pmu *); ++void gp102_pmu_reset(struct nvkm_pmu *pmu); + + void gk110_pmu_pgob(struct nvkm_pmu *, bool); + diff --git a/queue-5.10/series b/queue-5.10/series index f58490f27f4..3ec785c1f96 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -149,3 +149,6 @@ gpio-restrict-usage-of-gpio-chip-irq-members-before-initialization.patch ata-sata_dwc_460ex-fix-crash-due-to-oob-write.patch perf-qcom_l2_pmu-fix-an-incorrect-null-check-on-list-iterator.patch irqchip-gic-v3-fix-gicr_ctlr.rwp-polling.patch +drm-amdgpu-smu10-fix-soc-fclk-units-in-auto-mode.patch +drm-nouveau-pmu-add-missing-callbacks-for-tegra-devices.patch +drm-amdkfd-create-file-descriptor-after-client-is-added-to-smi_clients-list.patch