Skip to contentSkip to conversation

drm/amdgpu: Fix 32bit x86 compilation warning

PATCH In review Alex Xie 5 participants 5 messages Mar 28, 2017 – Mar 29, 2017 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Alex Xie

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix 32bit x86 compilation warning

drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c:187:2: warning: right shift count >= width of type [enabled by default] drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c:173:2: warning: right shift count >= width of type [enabled by default] drivers/gpu/drm/amd/amdgpu/vega10_ih.c:106:3: warning: right shift count >= width of type [enabled by default]

Reported by: [email protected]

Change-Id I0c3e52f7fd1026d07ac1042b5e8796fbdf09afff
---
 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c  | 2 +-
 drivers/gpu/drm/amd/amdgpu/vega10_ih.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +1 -1
index 5604a53..5d4d999 100644
@@ -172,7 +172,7 @@ int gfxhub_v1_0_gart_enable(struct amdgpu_device *adev)
 		(u32)(adev->dummy_page.addr >> 12));
 	WREG32(SOC15_REG_OFFSET(GC, 0,
 				mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),
-		(u32)(adev->dummy_page.addr >> 44));
+		(u32)((u64)adev->dummy_page.addr >> 44));
 
 	tmp = RREG32(SOC15_REG_OFFSET(GC, 0, mmVM_L2_PROTECTION_FAULT_CNTL2));
 	tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +1 -1
index 5903bb0..d41e765 100644
@@ -186,7 +186,7 @@ int mmhub_v1_0_gart_enable(struct amdgpu_device *adev)
 		(u32)(adev->dummy_page.addr >> 12));
 	WREG32(SOC15_REG_OFFSET(MMHUB, 0,
 				mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),
-		(u32)(adev->dummy_page.addr >> 44));
+		(u32)((u64)adev->dummy_page.addr >> 44));
 
 	tmp = RREG32(SOC15_REG_OFFSET(MMHUB, 0, mmVM_L2_PROTECTION_FAULT_CNTL2));
 	tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +1 -1
index 23371e1..041ed0b 100644
@@ -103,7 +103,7 @@ static int vega10_ih_irq_init(struct amdgpu_device *adev)
 	/* Ring Buffer base. [39:8] of 40-bit address of the beginning of the ring buffer*/
 	if (adev->irq.ih.use_bus_addr) {
 		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE), adev->irq.ih.rb_dma_addr >> 8);
-		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI), (adev->irq.ih.rb_dma_addr >> 40) &0xff);
+		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI), ((u64)adev->irq.ih.rb_dma_addr >> 40) &0xff);
 		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, MC_SPACE, 1);
 	} else {
 		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE), adev->irq.ih.gpu_addr >> 8);
Signature · 6 lines
1.9.1

_______________________________________________
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): 1490726220-29149-1-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org

Reviewed-by Alex Deucher
#2 lore raw
Quoted 13 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Alex Xie
Sent: Tuesday, March 28, 2017 2:37 PM
To: [email protected]
Cc: Xie, AlexBin
Subject: [PATCH] drm/amdgpu: Fix 32bit x86 compilation warning

drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c:187:2: warning: right shift count >= width of type [enabled by default] drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c:173:2: warning: right shift count >= width of type [enabled by default] drivers/gpu/drm/amd/amdgpu/vega10_ih.c:106:3: warning: right shift count

Quoted 6 lines
Quoted 1 line

= width of type [enabled by default]

Reported by: [email protected]

Change-Id I0c3e52f7fd1026d07ac1042b5e8796fbdf09afff
Quoted 64 lines
---
 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c  | 2 +-
 drivers/gpu/drm/amd/amdgpu/vega10_ih.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +1 -1
index 5604a53..5d4d999 100644
@@ -172,7 +172,7 @@ int gfxhub_v1_0_gart_enable(struct amdgpu_device
 *adev)
 		(u32)(adev->dummy_page.addr >> 12));
 	WREG32(SOC15_REG_OFFSET(GC, 0,
 
 	mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),
-		(u32)(adev->dummy_page.addr >> 44));
+		(u32)((u64)adev->dummy_page.addr >> 44));
 

tmp = RREG32(SOC15_REG_OFFSET(GC, 0,
mmVM_L2_PROTECTION_FAULT_CNTL2));

drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +0 -0
 	tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +1 -1
index 5903bb0..d41e765 100644
@@ -186,7 +186,7 @@ int mmhub_v1_0_gart_enable(struct amdgpu_device
 *adev)
 		(u32)(adev->dummy_page.addr >> 12));
 	WREG32(SOC15_REG_OFFSET(MMHUB, 0,
 
 	mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),
-		(u32)(adev->dummy_page.addr >> 44));
+		(u32)((u64)adev->dummy_page.addr >> 44));
 

tmp = RREG32(SOC15_REG_OFFSET(MMHUB, 0,
mmVM_L2_PROTECTION_FAULT_CNTL2));

drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +0 -0
 	tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +0 -0
index 23371e1..041ed0b 100644
@@ -103,7 +103,7 @@ static int vega10_ih_irq_init(struct amdgpu_device
 *adev)
 	/* Ring Buffer base. [39:8] of 40-bit address of the beginning of the

ring buffer*/

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +0 -0
 	if (adev->irq.ih.use_bus_addr) {
 		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE),

adev->irq.ih.rb_dma_addr >> 8);

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +0 -1
-		WREG32(SOC15_REG_OFFSET(OSSSYS, 0,

mmIH_RB_BASE_HI), (adev->irq.ih.rb_dma_addr >> 40) &0xff);

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +1 -0
+		WREG32(SOC15_REG_OFFSET(OSSSYS, 0,

mmIH_RB_BASE_HI), ((u64)adev->irq.ih.rb_dma_addr >> 40) &0xff);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
MC_SPACE, 1);

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +0 -0
 	} else {
 		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE),

adev->irq.ih.gpu_addr >> 8);
--
1.9.1

Quoted 4 lines

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

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

#3 lore raw
In reply to a message not in the archive
Quoted 45 lines · Alex Xie

drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c:187:2: warning: right shift count >= width of type [enabled by default] drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c:173:2: warning: right shift count >= width of type [enabled by default] drivers/gpu/drm/amd/amdgpu/vega10_ih.c:106:3: warning: right shift count >= width of type [enabled by default]

Reported by: [email protected]

Change-Id I0c3e52f7fd1026d07ac1042b5e8796fbdf09afff
---
  drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 2 +-
  drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c  | 2 +-
  drivers/gpu/drm/amd/amdgpu/vega10_ih.c   | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +1 -1
index 5604a53..5d4d999 100644
@@ -172,7 +172,7 @@ int gfxhub_v1_0_gart_enable(struct amdgpu_device *adev)
  		(u32)(adev->dummy_page.addr >> 12));
  	WREG32(SOC15_REG_OFFSET(GC, 0,
  				mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),
-		(u32)(adev->dummy_page.addr >> 44));
+		(u32)((u64)adev->dummy_page.addr >> 44));
 
  	tmp = RREG32(SOC15_REG_OFFSET(GC, 0, mmVM_L2_PROTECTION_FAULT_CNTL2));
  	tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +1 -1
index 5903bb0..d41e765 100644
@@ -186,7 +186,7 @@ int mmhub_v1_0_gart_enable(struct amdgpu_device *adev)
  		(u32)(adev->dummy_page.addr >> 12));
  	WREG32(SOC15_REG_OFFSET(MMHUB, 0,
  				mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),
-		(u32)(adev->dummy_page.addr >> 44));
+		(u32)((u64)adev->dummy_page.addr >> 44));
 
  	tmp = RREG32(SOC15_REG_OFFSET(MMHUB, 0, mmVM_L2_PROTECTION_FAULT_CNTL2));
  	tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +0 -0
index 23371e1..041ed0b 100644

drivers/gpu/drm/amd/amdgpu/vega10_ih.c static int vega10_ih_irq_init(struct amdgpu_device *adev) · line 106

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +1 -1
@@ -103,7 +103,7 @@ static int vega10_ih_irq_init(struct amdgpu_device *adev)
  	/* Ring Buffer base. [39:8] of 40-bit address of the beginning of the ring buffer*/
  	if (adev->irq.ih.use_bus_addr) {
  		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE), adev->irq.ih.rb_dma_addr >> 8);
-		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI), (adev->irq.ih.rb_dma_addr >> 40) &0xff);
+		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI), ((u64)adev->irq.ih.rb_dma_addr >> 40) &0xff);

Could you adding a space between "&" and "0xff" during this fix?

drivers/gpu/drm/amd/amdgpu/vega10_ih.c static int vega10_ih_irq_init(struct amdgpu_device *adev) · line 109

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/vega10_ih.c +0 -0
  		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, MC_SPACE, 1);
  	} else {
  		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE), adev->irq.ih.gpu_addr >> 8);

Maybe miss the "else" case, like below:
WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI), (adev->irq.ih.gpu_addr

Quoted 1 line
Quoted 1 line

40) & 0xff);

Jerry

Quoted 1 line

_______________________________________________
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]

#5 lore raw

Am 29.03.2017 um 03:50 schrieb Zhang, Jerry (Junwei):

Quoted 5 lines · Alex Xie
Quoted 3 lines

drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c:187:2: warning: right shift count >= width of type [enabled by default] drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c:173:2: warning: right shift count >= width of type [enabled by default] drivers/gpu/drm/amd/amdgpu/vega10_ih.c:106:3: warning: right shift count >= width of type [enabled by default]

Usually we try to use upper_32_bits() for this:

Quoted 5 lines
164 <http://lxr.free-electrons.com/source/include/linux/kernel.h#L164>  */* A basic shift-right of a 64- or 32-bit quantity. Use this to suppress/*
165 <http://lxr.free-electrons.com/source/include/linux/kernel.h#L165>  */* the "right shift count >= width of type" warning when that quantity is/*
166 <http://lxr.free-electrons.com/source/include/linux/kernel.h#L166>  */* 32-bits./*
167 <http://lxr.free-electrons.com/source/include/linux/kernel.h#L167>  */*//*
168 <http://lxr.free-electrons.com/source/include/linux/kernel.h#L168>  #defineupper_32_bits <http://lxr.free-electrons.com/ident?i=upper_32_bits>(n <http://lxr.free-electrons.com/ident?i=n>) ((u32 <http://lxr.free-electrons.com/ident?i=u32>)(((n <http://lxr.free-electrons.com/ident?i=n>) >> 16) >> 16))

But since the we don't shift by 32 here it's probably ok to code this manually.

Quoted 49 lines
Quoted 49 lines

Reported by: [email protected]

Change-Id I0c3e52f7fd1026d07ac1042b5e8796fbdf09afff
---
  drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 2 +-
  drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c  | 2 +-
  drivers/gpu/drm/amd/amdgpu/vega10_ih.c   | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +1 -1
index 5604a53..5d4d999 100644
@@ -172,7 +172,7 @@ int gfxhub_v1_0_gart_enable(struct amdgpu_device 
 *adev)
          (u32)(adev->dummy_page.addr >> 12));
      WREG32(SOC15_REG_OFFSET(GC, 0,
                  mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),
-        (u32)(adev->dummy_page.addr >> 44));
+        (u32)((u64)adev->dummy_page.addr >> 44));
 
      tmp = RREG32(SOC15_REG_OFFSET(GC, 0, 

mmVM_L2_PROTECTION_FAULT_CNTL2));
tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,

drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +1 -1
index 5903bb0..d41e765 100644
@@ -186,7 +186,7 @@ int mmhub_v1_0_gart_enable(struct amdgpu_device 
 *adev)
          (u32)(adev->dummy_page.addr >> 12));
      WREG32(SOC15_REG_OFFSET(MMHUB, 0,
                  mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),
-        (u32)(adev->dummy_page.addr >> 44));
+        (u32)((u64)adev->dummy_page.addr >> 44));
 
      tmp = RREG32(SOC15_REG_OFFSET(MMHUB, 0, 

mmVM_L2_PROTECTION_FAULT_CNTL2));
tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +0 -0
index 23371e1..041ed0b 100644
@@ -103,7 +103,7 @@ static int vega10_ih_irq_init(struct 
 amdgpu_device *adev)
      /* Ring Buffer base. [39:8] of 40-bit address of the beginning 

of the ring buffer*/

Quoted 8 lines
Quoted 7 lines
      if (adev->irq.ih.use_bus_addr) {
          WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE), 

adev->irq.ih.rb_dma_addr >> 8);
- WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI),
(adev->irq.ih.rb_dma_addr >> 40) &0xff);
+ WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI),
((u64)adev->irq.ih.rb_dma_addr >> 40) &0xff);

Could you adding a space between "&" and "0xff" during this fix?

With that fixed the patch is Reviewed-by: Christian König <[email protected]>.

Quoted 10 lines
Quoted 6 lines

ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,

MC_SPACE, 1);
      } else {
          WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE), 

adev->irq.ih.gpu_addr >> 8);

Maybe miss the "else" case, like below:
WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI),
(adev->irq.ih.gpu_addr >> 40) & 0xff);

The gpu_addr should be 64bit anyway.

Regards,
Christian.

Quoted 8 lines

Jerry

Quoted 1 line

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

_______________________________________________
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): ba3e5a96-e36b-c807-e0fb-84651359a974-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#7 lore raw
Quoted 30 lines · Christian König

Am 29.03.2017 um 03:50 schrieb Zhang, Jerry (Junwei):

Quoted 10 lines · Alex Xie
Quoted 7 lines

drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c:187:2: warning: right shift count

Quoted 1 line

= width of type [enabled by default]

drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c:173:2: warning: right shift count >= width of type [enabled by default] drivers/gpu/drm/amd/amdgpu/vega10_ih.c:106:3: warning: right shift count

Quoted 1 line

= width of type [enabled by default]

Usually we try to use upper_32_bits() for this:

Quoted 14 lines

164 <http://lxr.free-electrons.com/source/include/linux/kernel.h#L164>
*/* A basic shift-right of a 64- or 32-bit quantity. Use this to suppress/* 165 <http://lxr.free-electrons.com/source/include/linux/kernel.h#L165>
*/* the "right shift count >= width of type" warning when that quantity is/* 166 <http://lxr.free-electrons.com/source/include/linux/kernel.h#L166>
*/* 32-bits./*
167 <http://lxr.free-electrons.com/source/include/linux/kernel.h#L167>
*/*//*
168 <http://lxr.free-electrons.com/source/include/linux/kernel.h#L168>
#defineupper_32_bits <http://lxr.free-electrons.com/ident?i=upper_32_bits>(n
<http://lxr.free-electrons.com/ident?i=n>) ((u32
<http://lxr.free-electrons.com/ident?i=u32>)(((n
<http://lxr.free-electrons.com/ident?i=n>) >> 16) >> 16))

Quoted 2 lines

But since the we don't shift by 32 here it's probably ok to code this manually.

The problem is these are dma_addr_t not 64 bit addresses.

Alex

Quoted 98 lines
Quoted 55 lines
Quoted 55 lines

Reported by: [email protected]

Change-Id I0c3e52f7fd1026d07ac1042b5e8796fbdf09afff
---
  drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 2 +-
  drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c  | 2 +-
  drivers/gpu/drm/amd/amdgpu/vega10_ih.c   | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +1 -1
index 5604a53..5d4d999 100644
@@ -172,7 +172,7 @@ int gfxhub_v1_0_gart_enable(struct amdgpu_device
 *adev)
          (u32)(adev->dummy_page.addr >> 12));
      WREG32(SOC15_REG_OFFSET(GC, 0,
                  mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),
-        (u32)(adev->dummy_page.addr >> 44));
+        (u32)((u64)adev->dummy_page.addr >> 44));
 
      tmp = RREG32(SOC15_REG_OFFSET(GC, 0,

mmVM_L2_PROTECTION_FAULT_CNTL2));
tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,

drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +1 -1
index 5903bb0..d41e765 100644
@@ -186,7 +186,7 @@ int mmhub_v1_0_gart_enable(struct amdgpu_device
 *adev)
          (u32)(adev->dummy_page.addr >> 12));
      WREG32(SOC15_REG_OFFSET(MMHUB, 0,
                  mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),
-        (u32)(adev->dummy_page.addr >> 44));
+        (u32)((u64)adev->dummy_page.addr >> 44));
 
      tmp = RREG32(SOC15_REG_OFFSET(MMHUB, 0,

mmVM_L2_PROTECTION_FAULT_CNTL2));
tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,

drivers/gpu/drm/amd/amdgpu/vega10_ih.c +0 -0
index 23371e1..041ed0b 100644
@@ -103,7 +103,7 @@ static int vega10_ih_irq_init(struct amdgpu_device
 *adev)
      /* Ring Buffer base. [39:8] of 40-bit address of the beginning of

the ring buffer*/

      if (adev->irq.ih.use_bus_addr) {
Quoted 8 lines
Quoted 6 lines
          WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE),

adev->irq.ih.rb_dma_addr >> 8);
- WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI),
(adev->irq.ih.rb_dma_addr >> 40) &0xff);
+ WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI),
((u64)adev->irq.ih.rb_dma_addr >> 40) &0xff);

Could you adding a space between "&" and "0xff" during this fix?

With that fixed the patch is Reviewed-by: Christian König <[email protected]>.

Quoted 11 lines
Quoted 6 lines

ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, MC_SPACE,

1);
      } else {
          WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE),

adev->irq.ih.gpu_addr >> 8);

Maybe miss the "else" case, like below:
WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI),
(adev->irq.ih.gpu_addr >> 40) & 0xff);

The gpu_addr should be 64bit anyway.

Regards,
Christian.

Quoted 8 lines

Jerry

Quoted 1 line

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

Quoted 4 lines

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

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