Skip to contentSkip to conversation

linux-next: build failure after merge of the amdgpu tree

PATCH Stephen Rothwell 3 participants 4 messages May 5, 2022 – May 6, 2022

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

Hi all,

After merging the amdgpu tree, today's linux-next build (powerpc allyesconfig) failed like this:

In file included from drivers/gpu/drm/amd/amdgpu/mes_v11_0.c:26:
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c: In function 'mes_v11_0_mqd_init':
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c:697:34: error: 'CP_HQD_PQ_CONTROL__ENDIAN_SWAP_MASK' undeclared (first use in this function); did you mean 'CP_HQD_PQ_CONTROL__PRIV_STATE_MASK'?

  697 |         tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, ENDIAN_SWAP, 1);
      |                                  ^~~~~~~~~~~~~~~~~

drivers/gpu/drm/amd/amdgpu/amdgpu.h:1177:36: note: in definition of macro 'REG_FIELD_MASK'
1177 | #define REG_FIELD_MASK(reg, field) reg##__##field##_MASK
| ^~~
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c:697:15: note: in expansion of macro 'REG_SET_FIELD'

  697 |         tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, ENDIAN_SWAP, 1);
      |               ^~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c:697:34: note: each undeclared identifier is reported only once for each function it appears in
  697 |         tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, ENDIAN_SWAP, 1);
      |                                  ^~~~~~~~~~~~~~~~~

drivers/gpu/drm/amd/amdgpu/amdgpu.h:1177:36: note: in definition of macro 'REG_FIELD_MASK'
1177 | #define REG_FIELD_MASK(reg, field) reg##__##field##_MASK
| ^~~
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c:697:15: note: in expansion of macro 'REG_SET_FIELD'

  697 |         tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, ENDIAN_SWAP, 1);
      |               ^~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c:697:34: error: 'CP_HQD_PQ_CONTROL__ENDIAN_SWAP__SHIFT' undeclared (first use in this function); did you mean 'CP_HQD_PQ_CONTROL__PRIV_STATE__SHIFT'?
  697 |         tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, ENDIAN_SWAP, 1);
      |                                  ^~~~~~~~~~~~~~~~~

drivers/gpu/drm/amd/amdgpu/amdgpu.h:1176:37: note: in definition of macro 'REG_FIELD_SHIFT'
1176 | #define REG_FIELD_SHIFT(reg, field) reg##__##field##__SHIFT
| ^~~
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c:697:15: note: in expansion of macro 'REG_SET_FIELD'

  697 |         tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, ENDIAN_SWAP, 1);
      |               ^~~~~~~~~~~~~
In file included from drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:28:
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c: In function 'gfx_v11_0_cp_gfx_resume':
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:3413:34: error: 'CP_RB0_CNTL__BUF_SWAP_MASK' undeclared (first use in this function); did you mean 'CP_RB0_CNTL__TMZ_STATE_MASK'?
 3413 |         tmp = REG_SET_FIELD(tmp, CP_RB0_CNTL, BUF_SWAP, 1);
      |                                  ^~~~~~~~~~~

drivers/gpu/drm/amd/amdgpu/amdgpu.h:1177:36: note: in definition of macro 'REG_FIELD_MASK'
1177 | #define REG_FIELD_MASK(reg, field) reg##__##field##_MASK
| ^~~
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:3413:15: note: in expansion of macro 'REG_SET_FIELD'

 3413 |         tmp = REG_SET_FIELD(tmp, CP_RB0_CNTL, BUF_SWAP, 1);
      |               ^~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:3413:34: note: each undeclared identifier is reported only once for each function it appears in
 3413 |         tmp = REG_SET_FIELD(tmp, CP_RB0_CNTL, BUF_SWAP, 1);
      |                                  ^~~~~~~~~~~

drivers/gpu/drm/amd/amdgpu/amdgpu.h:1177:36: note: in definition of macro 'REG_FIELD_MASK'
1177 | #define REG_FIELD_MASK(reg, field) reg##__##field##_MASK
| ^~~
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:3413:15: note: in expansion of macro 'REG_SET_FIELD'

 3413 |         tmp = REG_SET_FIELD(tmp, CP_RB0_CNTL, BUF_SWAP, 1);
      |               ^~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:3413:34: error: 'CP_RB0_CNTL__BUF_SWAP__SHIFT' undeclared (first use in this function); did you mean 'CP_RB0_CNTL__TMZ_STATE__SHIFT'?
 3413 |         tmp = REG_SET_FIELD(tmp, CP_RB0_CNTL, BUF_SWAP, 1);
      |                                  ^~~~~~~~~~~

drivers/gpu/drm/amd/amdgpu/amdgpu.h:1176:37: note: in definition of macro 'REG_FIELD_SHIFT'
1176 | #define REG_FIELD_SHIFT(reg, field) reg##__##field##__SHIFT
| ^~~
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:3413:15: note: in expansion of macro 'REG_SET_FIELD'

 3413 |         tmp = REG_SET_FIELD(tmp, CP_RB0_CNTL, BUF_SWAP, 1);
      |               ^~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c: In function 'gfx_v11_0_compute_mqd_init':
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:4063:34: error: 'CP_HQD_PQ_CONTROL__ENDIAN_SWAP_MASK' undeclared (first use in this function); did you mean 'CP_HQD_PQ_CONTROL__PRIV_STATE_MASK'?
 4063 |         tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, ENDIAN_SWAP, 1);
      |                                  ^~~~~~~~~~~~~~~~~

drivers/gpu/drm/amd/amdgpu/amdgpu.h:1177:36: note: in definition of macro 'REG_FIELD_MASK'
1177 | #define REG_FIELD_MASK(reg, field) reg##__##field##_MASK
| ^~~
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:4063:15: note: in expansion of macro 'REG_SET_FIELD'

 4063 |         tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, ENDIAN_SWAP, 1);
      |               ^~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:4063:34: error: 'CP_HQD_PQ_CONTROL__ENDIAN_SWAP__SHIFT' undeclared (first use in this function); did you mean 'CP_HQD_PQ_CONTROL__PRIV_STATE__SHIFT'?
 4063 |         tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, ENDIAN_SWAP, 1);
      |                                  ^~~~~~~~~~~~~~~~~

drivers/gpu/drm/amd/amdgpu/amdgpu.h:1176:37: note: in definition of macro 'REG_FIELD_SHIFT'
1176 | #define REG_FIELD_SHIFT(reg, field) reg##__##field##__SHIFT
| ^~~
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:4063:15: note: in expansion of macro 'REG_SET_FIELD'

 4063 |         tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, ENDIAN_SWAP, 1);
      |               ^~~~~~~~~~~~~

Caused by commit

028c3fb37e70 ("drm/amdgpu/mes11: initiate mes v11 support")

This build has __BIG_ENDIAN set.

I have applied the following patch for today.

From: Stephen Rothwell <[email protected]>
Date: Thu, 5 May 2022 19:14:25 +1000
Subject: [PATCH] mark CONFIG_DRM_AMDGPU as depending on CONFIG_CPU_LITTLE_ENDIAN

---
 drivers/gpu/drm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/Kconfig +1 -0
index e88c497fa010..2aaa9ef1168d 100644
@@ -244,6 +244,7 @@ source "drivers/gpu/drm/radeon/Kconfig"
 config DRM_AMDGPU
 	tristate "AMD GPU"
 	depends on DRM && PCI && MMU
+	depends on CPU_LITTLE_ENDIAN
 	select FW_LOADER
 	select DRM_DISPLAY_DP_HELPER
 	select DRM_DISPLAY_HDMI_HELPER
Signature · 5 lines
2.35.1

-- 
Cheers,
Stephen Rothwell
#1 lore raw

Hi Stephen,

Quoted 5 lines · Stephen Rothwell

Hi all,

After merging the amdgpu tree, today's linux-next build (powerpc allyesconfig) failed like this:

<snip long error message>

Quoted 32 lines

Caused by commit

028c3fb37e70 ("drm/amdgpu/mes11: initiate mes v11 support")

This build has __BIG_ENDIAN set.

I have applied the following patch for today.

From: Stephen Rothwell <[email protected]>
Date: Thu, 5 May 2022 19:14:25 +1000
Subject: [PATCH] mark CONFIG_DRM_AMDGPU as depending on CONFIG_CPU_LITTLE_ENDIAN

---
 drivers/gpu/drm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/Kconfig +1 -0
index e88c497fa010..2aaa9ef1168d 100644
@@ -244,6 +244,7 @@ source "drivers/gpu/drm/radeon/Kconfig"
 config DRM_AMDGPU
 	tristate "AMD GPU"
 	depends on DRM && PCI && MMU
+	depends on CPU_LITTLE_ENDIAN
 	select FW_LOADER
 	select DRM_DISPLAY_DP_HELPER
 	select DRM_DISPLAY_HDMI_HELPER
Signature · 1 line
2.35.1

This fixup makes CONFIG_DRM_AMDGPU unselectable on any architecture that does not have CONFIG_CPU_LITTLE_ENDIAN, such as x86_64. I was rather surprised when my AMD test system did not reach the login screen and there were no error messages in dmesg, only to find that CONFIG_DRM_AMDGPU had disappeared from my build.

If this is not fixed by the time you do next-20220506, would you consider swapping the logic like so? This should allow all implicitly little endian architectures to work (at least, I tested it with x86_64), while preventing errors for CONFIG_CPU_BIG_ENDIAN configurations.

Cheers,
Nathan

drivers/gpu/drm/Kconfig +1 -1
index 2aaa9ef1168d..a57843733a96 100644
@@ -244,7 +244,7 @@ source "drivers/gpu/drm/radeon/Kconfig"
 config DRM_AMDGPU
 	tristate "AMD GPU"
 	depends on DRM && PCI && MMU
-	depends on CPU_LITTLE_ENDIAN
+	depends on !CPU_BIG_ENDIAN
 	select FW_LOADER
 	select DRM_DISPLAY_DP_HELPER
 	select DRM_DISPLAY_HDMI_HELPER
#2 lore raw
Quoted 51 lines · Nathan Chancellor

Hi Stephen,

Quoted 5 lines · Stephen Rothwell

Hi all,

After merging the amdgpu tree, today's linux-next build (powerpc allyesconfig) failed like this:

<snip long error message>

Quoted 31 lines

Caused by commit

028c3fb37e70 ("drm/amdgpu/mes11: initiate mes v11 support")

This build has __BIG_ENDIAN set.

I have applied the following patch for today.

From: Stephen Rothwell <[email protected]>
Date: Thu, 5 May 2022 19:14:25 +1000
Subject: [PATCH] mark CONFIG_DRM_AMDGPU as depending on CONFIG_CPU_LITTLE_ENDIAN

---
 drivers/gpu/drm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/Kconfig +1 -1
index e88c497fa010..2aaa9ef1168d 100644
@@ -244,6 +244,7 @@ source "drivers/gpu/drm/radeon/Kconfig"
 config DRM_AMDGPU
      tristate "AMD GPU"
      depends on DRM && PCI && MMU
+     depends on CPU_LITTLE_ENDIAN
      select FW_LOADER
      select DRM_DISPLAY_DP_HELPER
      select DRM_DISPLAY_HDMI_HELPER
--
Quoted 1 line

2.35.1

This fixup makes CONFIG_DRM_AMDGPU unselectable on any architecture that does not have CONFIG_CPU_LITTLE_ENDIAN, such as x86_64. I was rather surprised when my AMD test system did not reach the login screen and there were no error messages in dmesg, only to find that CONFIG_DRM_AMDGPU had disappeared from my build.

Quoted 4 lines

If this is not fixed by the time you do next-20220506, would you consider swapping the logic like so? This should allow all implicitly little endian architectures to work (at least, I tested it with x86_64), while preventing errors for CONFIG_CPU_BIG_ENDIAN configurations.

This is fixed. Will push out a new branch shortly.

Alex

Quoted 17 lines

Cheers,
Nathan

drivers/gpu/drm/Kconfig +1 -1
index 2aaa9ef1168d..a57843733a96 100644
@@ -244,7 +244,7 @@ source "drivers/gpu/drm/radeon/Kconfig"
 config DRM_AMDGPU
        tristate "AMD GPU"
        depends on DRM && PCI && MMU
-       depends on CPU_LITTLE_ENDIAN
+       depends on !CPU_BIG_ENDIAN
        select FW_LOADER
        select DRM_DISPLAY_DP_HELPER
        select DRM_DISPLAY_HDMI_HELPER
#3 lore raw

Hi all,

Quoted 17 lines · On Thu, 5 May 2022 14:46:25 -0400 Alex Deucher <[email protected]> wrote:
Quoted 11 lines · Nathan Chancellor

This fixup makes CONFIG_DRM_AMDGPU unselectable on any architecture that does not have CONFIG_CPU_LITTLE_ENDIAN, such as x86_64. I was rather surprised when my AMD test system did not reach the login screen and there were no error messages in dmesg, only to find that CONFIG_DRM_AMDGPU had disappeared from my build.

If this is not fixed by the time you do next-20220506, would you consider swapping the logic like so? This should allow all implicitly little endian architectures to work (at least, I tested it with x86_64), while preventing errors for CONFIG_CPU_BIG_ENDIAN configurations.

This is fixed. Will push out a new branch shortly.

Quoted 1 line
Quoted 13 lines

drivers/gpu/drm/Kconfig source "drivers/gpu/drm/radeon/Kconfig" · line 250

Quoted 13 lines
drivers/gpu/drm/Kconfig +1 -1
index 2aaa9ef1168d..a57843733a96 100644
@@ -244,7 +244,7 @@ source "drivers/gpu/drm/radeon/Kconfig"
 config DRM_AMDGPU
        tristate "AMD GPU"
        depends on DRM && PCI && MMU
-       depends on CPU_LITTLE_ENDIAN
+       depends on !CPU_BIG_ENDIAN
        select FW_LOADER
        select DRM_DISPLAY_DP_HELPER
        select DRM_DISPLAY_HDMI_HELPER  

Since today's amdgpu tree is broken, I have used the above with yesterday's tree.

Signature · 2 lines
Cheers,
Stephen Rothwell