Skip to contentSkip to conversation

drm/amd/amdgpu: Fix debugfs reg read/write address width

PATCH In review Tom St Denis 2 participants 2 messages Mar 15, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/amdgpu: Fix debugfs reg read/write address width

The MMIO space is wider now so we mask the lower 22 bits instead of 18.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
index 47d1dcc85b18..89504a883791 100644
@@ -2944,7 +2944,7 @@ static ssize_t amdgpu_debugfs_regs_read(struct file *f, char __user *buf,
 		use_bank = 0;
 	}
 
-	*pos &= 0x3FFFF;
+	*pos &= (1UL << 22) - 1;
 
 	if (use_bank) {
 		if ((sh_bank != 0xFFFFFFFF && sh_bank >= adev->gfx.config.max_sh_per_se) ||
@@ -3020,7 +3020,7 @@ static ssize_t amdgpu_debugfs_regs_write(struct file *f, const char __user *buf,
 		use_bank = 0;
 	}
 
-	*pos &= 0x3FFFF;
+	*pos &= (1UL << 22) - 1;
 
 	if (use_bank) {
 		if ((sh_bank != 0xFFFFFFFF && sh_bank >= adev->gfx.config.max_sh_per_se) ||
Signature · 6 lines
2.12.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#2 lore raw

Am 15.03.2017 um 10:35 schrieb Tom St Denis:

Quoted 4 lines

The MMIO space is wider now so we mask the lower 22 bits instead of 18.

Quoted 18 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
index 47d1dcc85b18..89504a883791 100644
@@ -2944,7 +2944,7 @@ static ssize_t amdgpu_debugfs_regs_read(struct file *f, char __user *buf,
  		use_bank = 0;
  	}
 
-	*pos &= 0x3FFFF;
+	*pos &= (1UL << 22) - 1;
 
  	if (use_bank) {
  		if ((sh_bank != 0xFFFFFFFF && sh_bank >= adev->gfx.config.max_sh_per_se) ||

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static ssize_t amdgpu_debugfs_regs_write(struct file *f, const char __user *buf, · line 3026

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
@@ -3020,7 +3020,7 @@ static ssize_t amdgpu_debugfs_regs_write(struct file *f, const char __user *buf,
  		use_bank = 0;
  	}
 
-	*pos &= 0x3FFFF;
+	*pos &= (1UL << 22) - 1;
 
  	if (use_bank) {
  		if ((sh_bank != 0xFFFFFFFF && sh_bank >= adev->gfx.config.max_sh_per_se) ||

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx