]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: fix invadate operation for pg_flags
authorJesse Zhang <jesse.zhang@amd.com>
Tue, 21 May 2024 07:02:54 +0000 (15:02 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 23 May 2024 19:09:50 +0000 (15:09 -0400)
Since the type of pg_flags is u32, adev->pg_flags >> 16 >> 16 is 0
regardless of the values of its operands.

So removing the operations upper_32_bits and lower_32_bits.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Suggested-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Tim Huang <Tim.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c

index ac0ba8b8c1aa0ea1af06c0c5454a796b139227ca..0e1a11b6b989d735b0fc7ff59956cf73929a4bb6 100644 (file)
@@ -918,7 +918,7 @@ static ssize_t amdgpu_debugfs_gca_config_read(struct file *f, char __user *buf,
 
        /* rev==1 */
        config[no_regs++] = adev->rev_id;
-       config[no_regs++] = lower_32_bits(adev->pg_flags);
+       config[no_regs++] = adev->pg_flags;
        config[no_regs++] = lower_32_bits(adev->cg_flags);
 
        /* rev==2 */
@@ -935,7 +935,7 @@ static ssize_t amdgpu_debugfs_gca_config_read(struct file *f, char __user *buf,
        config[no_regs++] = adev->flags & AMD_IS_APU ? 1 : 0;
 
        /* rev==5 PG/CG flag upper 32bit */
-       config[no_regs++] = upper_32_bits(adev->pg_flags);
+       config[no_regs++] = 0;
        config[no_regs++] = upper_32_bits(adev->cg_flags);
 
        while (size && (*pos < no_regs * 4)) {