From: Greg Kroah-Hartman Date: Sat, 23 Aug 2025 14:47:59 +0000 (+0200) Subject: 6.16-stable patches X-Git-Tag: v6.16.3~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0023e6df8e1fcc36c764727272ea82de88daf1ff;p=thirdparty%2Fkernel%2Fstable-queue.git 6.16-stable patches added patches: drm-amd-restore-cached-manual-clock-settings-during-resume.patch drm-dp-change-aux-dpcd-probe-address-from-dpcd_rev-to-lane0_1_status.patch iommu-remove-ops.pgsize_bitmap-from-drivers-that-don-t-use-it.patch iommu-virtio-make-instance-lookup-robust.patch --- diff --git a/queue-6.16/drm-amd-restore-cached-manual-clock-settings-during-resume.patch b/queue-6.16/drm-amd-restore-cached-manual-clock-settings-during-resume.patch new file mode 100644 index 0000000000..03203050dd --- /dev/null +++ b/queue-6.16/drm-amd-restore-cached-manual-clock-settings-during-resume.patch @@ -0,0 +1,62 @@ +From stable+bounces-172589-greg=kroah.com@vger.kernel.org Sat Aug 23 15:18:45 2025 +From: Sasha Levin +Date: Sat, 23 Aug 2025 09:16:47 -0400 +Subject: drm/amd: Restore cached manual clock settings during resume +To: stable@vger.kernel.org +Cc: Mario Limonciello , Alex Deucher , Sasha Levin +Message-ID: <20250823131647.2118519-1-sashal@kernel.org> + +From: Mario Limonciello + +[ Upstream commit 796ff8a7e01bd18738d3bb4111f9d6f963145d29 ] + +If the SCLK limits have been set before S3 they will not +be restored. The limits are however cached in the driver and so +they can be restored by running a commit sequence during resume. + +Acked-by: Alex Deucher +Link: https://lore.kernel.org/r/20250725031222.3015095-3-superm1@kernel.org +Signed-off-by: Mario Limonciello +Signed-off-by: Alex Deucher +(cherry picked from commit 4e9526924d09057a9ba854305e17eded900ced82) +Cc: stable@vger.kernel.org +[ Adjust context ] +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c ++++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +@@ -76,6 +76,9 @@ static void smu_power_profile_mode_get(s + enum PP_SMC_POWER_PROFILE profile_mode); + static void smu_power_profile_mode_put(struct smu_context *smu, + enum PP_SMC_POWER_PROFILE profile_mode); ++static int smu_od_edit_dpm_table(void *handle, ++ enum PP_OD_DPM_TABLE_COMMAND type, ++ long *input, uint32_t size); + + static int smu_sys_get_pp_feature_mask(void *handle, + char *buf) +@@ -2144,6 +2147,7 @@ static int smu_resume(struct amdgpu_ip_b + int ret; + struct amdgpu_device *adev = ip_block->adev; + struct smu_context *smu = adev->powerplay.pp_handle; ++ struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm); + + if (amdgpu_sriov_multi_vf_mode(adev)) + return 0; +@@ -2181,6 +2185,12 @@ static int smu_resume(struct amdgpu_ip_b + return ret; + } + ++ if (smu_dpm_ctx->dpm_level == AMD_DPM_FORCED_LEVEL_MANUAL) { ++ ret = smu_od_edit_dpm_table(smu, PP_OD_COMMIT_DPM_TABLE, NULL, 0); ++ if (ret) ++ return ret; ++ } ++ + dev_info(adev->dev, "SMU is resumed successfully!\n"); + + return 0; diff --git a/queue-6.16/drm-dp-change-aux-dpcd-probe-address-from-dpcd_rev-to-lane0_1_status.patch b/queue-6.16/drm-dp-change-aux-dpcd-probe-address-from-dpcd_rev-to-lane0_1_status.patch new file mode 100644 index 0000000000..14c64c4320 --- /dev/null +++ b/queue-6.16/drm-dp-change-aux-dpcd-probe-address-from-dpcd_rev-to-lane0_1_status.patch @@ -0,0 +1,50 @@ +From stable+bounces-172585-greg=kroah.com@vger.kernel.org Sat Aug 23 14:56:34 2025 +From: Sasha Levin +Date: Sat, 23 Aug 2025 08:56:25 -0400 +Subject: drm/dp: Change AUX DPCD probe address from DPCD_REV to LANE0_1_STATUS +To: stable@vger.kernel.org +Cc: "Imre Deak" , "Ville Syrjälä" , "Jani Nikula" , "Jani Nikula" , "Sasha Levin" +Message-ID: <20250823125625.2103160-1-sashal@kernel.org> + +From: Imre Deak + +[ Upstream commit a40c5d727b8111b5db424a1e43e14a1dcce1e77f ] + +Reading DPCD registers has side-effects in general. In particular +accessing registers outside of the link training register range +(0x102-0x106, 0x202-0x207, 0x200c-0x200f, 0x2216) is explicitly +forbidden by the DP v2.1 Standard, see + +3.6.5.1 DPTX AUX Transaction Handling Mandates +3.6.7.4 128b/132b DP Link Layer LTTPR Link Training Mandates + +Based on my tests, accessing the DPCD_REV register during the link +training of an UHBR TBT DP tunnel sink leads to link training failures. + +Solve the above by using the DP_LANE0_1_STATUS (0x202) register for the +DPCD register access quirk. + +Cc: +Cc: Ville Syrjälä +Cc: Jani Nikula +Acked-by: Jani Nikula +Signed-off-by: Imre Deak +Link: https://lore.kernel.org/r/20250605082850.65136-2-imre.deak@intel.com +[ DP_TRAINING_PATTERN_SET => DP_LANE0_1_STATUS ] +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/display/drm_dp_helper.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/display/drm_dp_helper.c ++++ b/drivers/gpu/drm/display/drm_dp_helper.c +@@ -725,7 +725,7 @@ ssize_t drm_dp_dpcd_read(struct drm_dp_a + * monitor doesn't power down exactly after the throw away read. + */ + if (!aux->is_remote) { +- ret = drm_dp_dpcd_probe(aux, DP_TRAINING_PATTERN_SET); ++ ret = drm_dp_dpcd_probe(aux, DP_LANE0_1_STATUS); + if (ret < 0) + return ret; + } diff --git a/queue-6.16/iommu-remove-ops.pgsize_bitmap-from-drivers-that-don-t-use-it.patch b/queue-6.16/iommu-remove-ops.pgsize_bitmap-from-drivers-that-don-t-use-it.patch new file mode 100644 index 0000000000..496b80cdc7 --- /dev/null +++ b/queue-6.16/iommu-remove-ops.pgsize_bitmap-from-drivers-that-don-t-use-it.patch @@ -0,0 +1,104 @@ +From stable+bounces-172595-greg=kroah.com@vger.kernel.org Sat Aug 23 15:43:53 2025 +From: Sasha Levin +Date: Sat, 23 Aug 2025 09:43:45 -0400 +Subject: iommu: Remove ops.pgsize_bitmap from drivers that don't use it +To: stable@vger.kernel.org +Cc: Jason Gunthorpe , Sven Peter , Lu Baolu , Kevin Tian , Tomasz Jeznach , Nicolin Chen , Joerg Roedel , Sasha Levin +Message-ID: <20250823134346.2145572-1-sashal@kernel.org> + +From: Jason Gunthorpe + +[ Upstream commit 8901812485de1356e3757958af40fe0d3a48e986 ] + +These drivers all set the domain->pgsize_bitmap in their +domain_alloc_paging() functions, so the ops value is never used. Delete +it. + +Reviewed-by: Sven Peter # for Apple DART +Reviewed-by: Lu Baolu +Reviewed-by: Kevin Tian +Reviewed-by: Tomasz Jeznach # for RISC-V +Signed-off-by: Jason Gunthorpe +Tested-by: Nicolin Chen +Link: https://lore.kernel.org/r/3-v2-68a2e1ba507c+1fb-iommu_rm_ops_pgsize_jgg@nvidia.com +Signed-off-by: Joerg Roedel +Stable-dep-of: 72b6f7cd89ce ("iommu/virtio: Make instance lookup robust") +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iommu/apple-dart.c | 1 - + drivers/iommu/intel/iommu.c | 1 - + drivers/iommu/iommufd/selftest.c | 1 - + drivers/iommu/riscv/iommu.c | 1 - + drivers/iommu/virtio-iommu.c | 6 ++---- + 5 files changed, 2 insertions(+), 8 deletions(-) + +--- a/drivers/iommu/apple-dart.c ++++ b/drivers/iommu/apple-dart.c +@@ -991,7 +991,6 @@ static const struct iommu_ops apple_dart + .of_xlate = apple_dart_of_xlate, + .def_domain_type = apple_dart_def_domain_type, + .get_resv_regions = apple_dart_get_resv_regions, +- .pgsize_bitmap = -1UL, /* Restricted during dart probe */ + .owner = THIS_MODULE, + .default_domain_ops = &(const struct iommu_domain_ops) { + .attach_dev = apple_dart_attach_dev_paging, +--- a/drivers/iommu/intel/iommu.c ++++ b/drivers/iommu/intel/iommu.c +@@ -4390,7 +4390,6 @@ const struct iommu_ops intel_iommu_ops = + .device_group = intel_iommu_device_group, + .is_attach_deferred = intel_iommu_is_attach_deferred, + .def_domain_type = device_def_domain_type, +- .pgsize_bitmap = SZ_4K, + .page_response = intel_iommu_page_response, + .default_domain_ops = &(const struct iommu_domain_ops) { + .attach_dev = intel_iommu_attach_device, +--- a/drivers/iommu/iommufd/selftest.c ++++ b/drivers/iommu/iommufd/selftest.c +@@ -801,7 +801,6 @@ static const struct iommu_ops mock_ops = + .default_domain = &mock_blocking_domain, + .blocked_domain = &mock_blocking_domain, + .owner = THIS_MODULE, +- .pgsize_bitmap = MOCK_IO_PAGE_SIZE, + .hw_info = mock_domain_hw_info, + .domain_alloc_paging_flags = mock_domain_alloc_paging_flags, + .domain_alloc_nested = mock_domain_alloc_nested, +--- a/drivers/iommu/riscv/iommu.c ++++ b/drivers/iommu/riscv/iommu.c +@@ -1533,7 +1533,6 @@ static void riscv_iommu_release_device(s + } + + static const struct iommu_ops riscv_iommu_ops = { +- .pgsize_bitmap = SZ_4K, + .of_xlate = riscv_iommu_of_xlate, + .identity_domain = &riscv_iommu_identity_domain, + .blocked_domain = &riscv_iommu_blocking_domain, +--- a/drivers/iommu/virtio-iommu.c ++++ b/drivers/iommu/virtio-iommu.c +@@ -998,7 +998,7 @@ static void viommu_get_resv_regions(stru + iommu_dma_get_resv_regions(dev, head); + } + +-static struct iommu_ops viommu_ops; ++static const struct iommu_ops viommu_ops; + static struct virtio_driver virtio_iommu_drv; + + static int viommu_match_node(struct device *dev, const void *data) +@@ -1086,7 +1086,7 @@ static bool viommu_capable(struct device + } + } + +-static struct iommu_ops viommu_ops = { ++static const struct iommu_ops viommu_ops = { + .capable = viommu_capable, + .domain_alloc_identity = viommu_domain_alloc_identity, + .domain_alloc_paging = viommu_domain_alloc_paging, +@@ -1217,8 +1217,6 @@ static int viommu_probe(struct virtio_de + viommu->first_domain++; + } + +- viommu_ops.pgsize_bitmap = viommu->pgsize_bitmap; +- + virtio_device_ready(vdev); + + /* Populate the event queue with buffers */ diff --git a/queue-6.16/iommu-virtio-make-instance-lookup-robust.patch b/queue-6.16/iommu-virtio-make-instance-lookup-robust.patch new file mode 100644 index 0000000000..2050bcc78e --- /dev/null +++ b/queue-6.16/iommu-virtio-make-instance-lookup-robust.patch @@ -0,0 +1,82 @@ +From stable+bounces-172596-greg=kroah.com@vger.kernel.org Sat Aug 23 15:43:54 2025 +From: Sasha Levin +Date: Sat, 23 Aug 2025 09:43:46 -0400 +Subject: iommu/virtio: Make instance lookup robust +To: stable@vger.kernel.org +Cc: Robin Murphy , Eric Auger , Joerg Roedel , Sasha Levin +Message-ID: <20250823134346.2145572-2-sashal@kernel.org> + +From: Robin Murphy + +[ Upstream commit 72b6f7cd89cea8251979b65528d302f9c0ed37bf ] + +Much like arm-smmu in commit 7d835134d4e1 ("iommu/arm-smmu: Make +instance lookup robust"), virtio-iommu appears to have the same issue +where iommu_device_register() makes the IOMMU instance visible to other +API callers (including itself) straight away, but internally the +instance isn't ready to recognise itself for viommu_probe_device() to +work correctly until after viommu_probe() has returned. This matters a +lot more now that bus_iommu_probe() has the DT/VIOT knowledge to probe +client devices the way that was always intended. Tweak the lookup and +initialisation in much the same way as for arm-smmu, to ensure that what +we register is functional and ready to go. + +Cc: stable@vger.kernel.org +Fixes: bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper probe path") +Signed-off-by: Robin Murphy +Tested-by: Eric Auger +Link: https://lore.kernel.org/r/308911aaa1f5be32a3a709996c7bd6cf71d30f33.1755190036.git.robin.murphy@arm.com +Signed-off-by: Joerg Roedel +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iommu/virtio-iommu.c | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +--- a/drivers/iommu/virtio-iommu.c ++++ b/drivers/iommu/virtio-iommu.c +@@ -998,8 +998,7 @@ static void viommu_get_resv_regions(stru + iommu_dma_get_resv_regions(dev, head); + } + +-static const struct iommu_ops viommu_ops; +-static struct virtio_driver virtio_iommu_drv; ++static const struct bus_type *virtio_bus_type; + + static int viommu_match_node(struct device *dev, const void *data) + { +@@ -1008,8 +1007,9 @@ static int viommu_match_node(struct devi + + static struct viommu_dev *viommu_get_by_fwnode(struct fwnode_handle *fwnode) + { +- struct device *dev = driver_find_device(&virtio_iommu_drv.driver, NULL, +- fwnode, viommu_match_node); ++ struct device *dev = bus_find_device(virtio_bus_type, NULL, fwnode, ++ viommu_match_node); ++ + put_device(dev); + + return dev ? dev_to_virtio(dev)->priv : NULL; +@@ -1160,6 +1160,9 @@ static int viommu_probe(struct virtio_de + if (!viommu) + return -ENOMEM; + ++ /* Borrow this for easy lookups later */ ++ virtio_bus_type = dev->bus; ++ + spin_lock_init(&viommu->request_lock); + ida_init(&viommu->domain_ids); + viommu->dev = dev; +@@ -1229,10 +1232,10 @@ static int viommu_probe(struct virtio_de + if (ret) + goto err_free_vqs; + +- iommu_device_register(&viommu->iommu, &viommu_ops, parent_dev); +- + vdev->priv = viommu; + ++ iommu_device_register(&viommu->iommu, &viommu_ops, parent_dev); ++ + dev_info(dev, "input address: %u bits\n", + order_base_2(viommu->geometry.aperture_end)); + dev_info(dev, "page mask: %#llx\n", viommu->pgsize_bitmap); diff --git a/queue-6.16/series b/queue-6.16/series index b8a5ae3ac7..5b9fc7ab3c 100644 --- a/queue-6.16/series +++ b/queue-6.16/series @@ -290,3 +290,7 @@ smb-server-split-ksmbd_rdma_stop_listening-out-of-ks.patch fs-buffer-fix-use-after-free-when-call-bh_read-helpe.patch signal-fix-memory-leak-for-pidfd_self-sentinels.patch use-uniform-permission-checks-for-all-mount-propagat.patch +iommu-remove-ops.pgsize_bitmap-from-drivers-that-don-t-use-it.patch +iommu-virtio-make-instance-lookup-robust.patch +drm-amd-restore-cached-manual-clock-settings-during-resume.patch +drm-dp-change-aux-dpcd-probe-address-from-dpcd_rev-to-lane0_1_status.patch