This is a note to let you know that I've just added the patch titled drm/amdgpu: Show vram vendor only if available to the 6.7-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-amdgpu-show-vram-vendor-only-if-available.patch and it can be found in the queue-6.7 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 89a7c0bd74918f723c94c10452265e25063cba9b Mon Sep 17 00:00:00 2001 From: Lijo Lazar <lijo.lazar@xxxxxxx> Date: Sat, 20 Jan 2024 13:48:09 +0530 Subject: drm/amdgpu: Show vram vendor only if available From: Lijo Lazar <lijo.lazar@xxxxxxx> commit 89a7c0bd74918f723c94c10452265e25063cba9b upstream. Ony if vram vendor info is available, show in sysfs. Signed-off-by: Lijo Lazar <lijo.lazar@xxxxxxx> Reviewed-by: Hawking Zhang <Hawking.Zhang@xxxxxxx> Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> Cc: stable@xxxxxxxxxxxxxxx # 6.7.x Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index 08916538a615..8db880244324 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c @@ -221,8 +221,23 @@ static struct attribute *amdgpu_vram_mgr_attributes[] = { NULL }; +static umode_t amdgpu_vram_attrs_is_visible(struct kobject *kobj, + struct attribute *attr, int i) +{ + struct device *dev = kobj_to_dev(kobj); + struct drm_device *ddev = dev_get_drvdata(dev); + struct amdgpu_device *adev = drm_to_adev(ddev); + + if (attr == &dev_attr_mem_info_vram_vendor.attr && + !adev->gmc.vram_vendor) + return 0; + + return attr->mode; +} + const struct attribute_group amdgpu_vram_mgr_attr_group = { - .attrs = amdgpu_vram_mgr_attributes + .attrs = amdgpu_vram_mgr_attributes, + .is_visible = amdgpu_vram_attrs_is_visible }; /** -- 2.43.0 Patches currently in stable-queue which might be from lijo.lazar@xxxxxxx are queue-6.7/drm-amdgpu-show-vram-vendor-only-if-available.patch queue-6.7/drm-amd-pm-add-error-log-for-smu-v13.0.6-reset.patch queue-6.7/drm-amdgpu-pm-fix-the-power-source-flag-error.patch queue-6.7/drm-amd-pm-fix-smuv13.0.6-current-clock-reporting.patch queue-6.7/drm-amd-pm-fetch-current-power-limit-from-fw.patch queue-6.7/drm-amdgpu-avoid-fetching-vram-vendor-information.patch