Skip to contentSkip to conversation

linux-next: build failure after merge of the pmdomain-fixes tree

DISCUSSION Mark Brown 3 participants 6 messages Nov 10 – Nov 11

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

After merging the pmdomain-fixes tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

In file included from /tmp/next/build/include/linux/device.h:32,
from /tmp/next/build/include/linux/platform_device.h:13,
from /tmp/next/build/drivers/pmdomain/imx/gpc.c:11:
/tmp/next/build/drivers/pmdomain/imx/gpc.c: In function 'imx_gpc_remove':
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:25: error: invalid storage class for function 'imx_gpc_driver_init'
554 | builtin_platform_driver(imx_gpc_driver)

      |                         ^~~~~~~~~~~~~~
/tmp/next/build/include/linux/device/driver.h:294:19: note: in definition of macro 'builtin_driver'
  294 | static int __init __driver##_init(void) \
      |                   ^~~~~~~~
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:1: note: in expansion of macro 'builtin_platform_driver'
  554 | builtin_platform_driver(imx_gpc_driver)
      | ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/next/build/include/linux/printk.h:6,
                 from /tmp/next/build/include/asm-generic/bug.h:31,
                 from /tmp/next/build/arch/arm/include/asm/bug.h:60,
                 from /tmp/next/build/include/linux/bug.h:5,
                 from /tmp/next/build/include/linux/instrumented.h:10,
                 from /tmp/next/build/include/linux/atomic/atomic-instrumented.h:17,
                 from /tmp/next/build/include/linux/atomic.h:82,
                 from /tmp/next/build/include/asm-generic/bitops/lock.h:5,
                 from /tmp/next/build/arch/arm/include/asm/bitops.h:245,
                 from /tmp/next/build/include/linux/bitops.h:67,
                 from /tmp/next/build/include/linux/kernel.h:23,
                 from /tmp/next/build/include/linux/clk.h:13,
                 from /tmp/next/build/drivers/pmdomain/imx/gpc.c:7:
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:25: error: initializer element is not constant
  554 | builtin_platform_driver(imx_gpc_driver)
      |                         ^~~~~~~~~~~~~~

/tmp/next/build/include/linux/init.h:265:55: note: in definition of macro '____define_initcall'
265 | __attribute__((__section__(__sec))) = fn;
| ^~
/tmp/next/build/include/linux/init.h:275:9: note: in expansion of macro '__unique_initcall'

  275 |         __unique_initcall(fn, id, __sec, __initcall_id(fn))
      |         ^~~~~~~~~~~~~~~~~
/tmp/next/build/include/linux/init.h:277:35: note: in expansion of macro '___define_initcall'
  277 | #define __define_initcall(fn, id) ___define_initcall(fn, id, .initcall##id)
      |                                   ^~~~~~~~~~~~~~~~~~
/tmp/next/build/include/linux/init.h:306:41: note: in expansion of macro '__define_initcall'
  306 | #define device_initcall(fn)             __define_initcall(fn, 6)
      |                                         ^~~~~~~~~~~~~~~~~
/tmp/next/build/include/linux/device/driver.h:298:1: note: in expansion of macro 'device_initcall'
  298 | device_initcall(__driver##_init);
      | ^~~~~~~~~~~~~~~
/tmp/next/build/include/linux/platform_device.h:345:9: note: in expansion of macro 'builtin_driver'
  345 |         builtin_driver(__platform_driver, platform_driver_register)
      |         ^~~~~~~~~~~~~~
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:1: note: in expansion of macro 'builtin_platform_driver'
  554 | builtin_platform_driver(imx_gpc_driver)
      | ^~~~~~~~~~~~~~~~~~~~~~~

/tmp/next/build/include/linux/init.h:176:30: error: expected declaration or statement at end of input
176 | #define THIS_MODULE ((struct module *)0)
| ^~~~~~
/tmp/next/build/include/linux/platform_device.h:304:41: note: in expansion of macro 'THIS_MODULE'
304 | __platform_driver_register(drv, THIS_MODULE, KBUILD_MODNAME)
| ^~~~~~~~~~~
/tmp/next/build/include/linux/device/driver.h:296:16: note: in expansion of macro 'platform_driver_register'

  296 |         return __register(&(__driver) , ##__VA_ARGS__); \
      |                ^~~~~~~~~~
/tmp/next/build/include/linux/platform_device.h:345:9: note: in expansion of macro 'builtin_driver'
  345 |         builtin_driver(__platform_driver, platform_driver_register)
      |         ^~~~~~~~~~~~~~
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:1: note: in expansion of macro 'builtin_platform_driver'
  554 | builtin_platform_driver(imx_gpc_driver)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/next/build/drivers/pmdomain/imx/gpc.c: At top level:
/tmp/next/build/drivers/pmdomain/imx/gpc.c:503:13: warning: 'imx_gpc_remove' defined but not used [-Wunused-function]
  503 | static void imx_gpc_remove(struct platform_device *pdev)
      |             ^~~~~~~~~~~~~~

AFAICT this is caused by commit

d7262971a2acc (pmdomain: imx: gpc: remove all initialized power domains)

though I don't really see how. I have used the tree from next-20261109 instead.

#1 lore raw
Quoted 6 lines · Mark Brown

AFAICT this is caused by commit

d7262971a2acc (pmdomain: imx: gpc: remove all initialized power domains)

though I don't really see how. I have used the tree from next-20261109 instead.

The while loop that commit adds to imx_gpc_remove() is never closed, so the function is still open at the end of the file:

		while (num_domains--) {
			ret = pm_genpd_remove(&imx_gpc_domains[num_domains].base);
			if (ret) {
				...
				return;
			}

		if (num_domains == GPC_PGC_DOMAIN_PU)
			imx_pgc_put_clocks(&imx_gpc_domains[num_domains]);
	}

The patch was posted that way [1]. gpc.c is only built with HAVE_IMX_GPC, which only SOC_IMX6 on 32-bit ARM selects, so x86 and arm64 builds do not see it.

With the brace added, gpc.o builds with imx_v6_v7_defconfig:

drivers/pmdomain/imx/gpc.c +3 -2
@@ -536,8 +536,9 @@
 				return;
 			}
 
-		if (num_domains == GPC_PGC_DOMAIN_PU)
-			imx_pgc_put_clocks(&imx_gpc_domains[num_domains]);
+			if (num_domains == GPC_PGC_DOMAIN_PU)
+				imx_pgc_put_clocks(&imx_gpc_domains[num_domains]);
+		}
 	}
 
 	of_node_put(pgc_node);

[1] https://lore.kernel.org/all/[email protected]/

Signature · 2 lines
Thanks,
Sasha
author maintainer
#2 lore raw
Quoted 10 lines · Sasha Levin
Quoted 6 lines · Mark Brown

AFAICT this is caused by commit

d7262971a2acc (pmdomain: imx: gpc: remove all initialized power domains)

though I don't really see how. I have used the tree from next-20261109 instead.

The while loop that commit adds to imx_gpc_remove() is never closed, so the function is still open at the end of the file:

Ah, that'd do it. I didn't look terribly hard.

author maintainer
#4 lore raw
In reply to Mark Brown
Quoted 4 lines · Mark Brown

Hi all,

After merging the pmdomain-fixes tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

This also affects the pmdomain tree. Also, I still had your Linaro address as a contact for all your trees - I've updated this to your kernel.org one since the Linaro one started bouncing.

Quoted 76 lines

In file included from /tmp/next/build/include/linux/device.h:32,
from /tmp/next/build/include/linux/platform_device.h:13,
from /tmp/next/build/drivers/pmdomain/imx/gpc.c:11:
/tmp/next/build/drivers/pmdomain/imx/gpc.c: In function 'imx_gpc_remove':
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:25: error: invalid storage class for function 'imx_gpc_driver_init'
554 | builtin_platform_driver(imx_gpc_driver)

      |                         ^~~~~~~~~~~~~~
/tmp/next/build/include/linux/device/driver.h:294:19: note: in definition of macro 'builtin_driver'
  294 | static int __init __driver##_init(void) \
      |                   ^~~~~~~~
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:1: note: in expansion of macro 'builtin_platform_driver'
  554 | builtin_platform_driver(imx_gpc_driver)
      | ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/next/build/include/linux/printk.h:6,
                 from /tmp/next/build/include/asm-generic/bug.h:31,
                 from /tmp/next/build/arch/arm/include/asm/bug.h:60,
                 from /tmp/next/build/include/linux/bug.h:5,
                 from /tmp/next/build/include/linux/instrumented.h:10,
                 from /tmp/next/build/include/linux/atomic/atomic-instrumented.h:17,
                 from /tmp/next/build/include/linux/atomic.h:82,
                 from /tmp/next/build/include/asm-generic/bitops/lock.h:5,
                 from /tmp/next/build/arch/arm/include/asm/bitops.h:245,
                 from /tmp/next/build/include/linux/bitops.h:67,
                 from /tmp/next/build/include/linux/kernel.h:23,
                 from /tmp/next/build/include/linux/clk.h:13,
                 from /tmp/next/build/drivers/pmdomain/imx/gpc.c:7:
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:25: error: initializer element is not constant
  554 | builtin_platform_driver(imx_gpc_driver)
      |                         ^~~~~~~~~~~~~~

/tmp/next/build/include/linux/init.h:265:55: note: in definition of macro '____define_initcall'
265 | __attribute__((__section__(__sec))) = fn;
| ^~
/tmp/next/build/include/linux/init.h:275:9: note: in expansion of macro '__unique_initcall'

  275 |         __unique_initcall(fn, id, __sec, __initcall_id(fn))
      |         ^~~~~~~~~~~~~~~~~
/tmp/next/build/include/linux/init.h:277:35: note: in expansion of macro '___define_initcall'
  277 | #define __define_initcall(fn, id) ___define_initcall(fn, id, .initcall##id)
      |                                   ^~~~~~~~~~~~~~~~~~
/tmp/next/build/include/linux/init.h:306:41: note: in expansion of macro '__define_initcall'
  306 | #define device_initcall(fn)             __define_initcall(fn, 6)
      |                                         ^~~~~~~~~~~~~~~~~
/tmp/next/build/include/linux/device/driver.h:298:1: note: in expansion of macro 'device_initcall'
  298 | device_initcall(__driver##_init);
      | ^~~~~~~~~~~~~~~
/tmp/next/build/include/linux/platform_device.h:345:9: note: in expansion of macro 'builtin_driver'
  345 |         builtin_driver(__platform_driver, platform_driver_register)
      |         ^~~~~~~~~~~~~~
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:1: note: in expansion of macro 'builtin_platform_driver'
  554 | builtin_platform_driver(imx_gpc_driver)
      | ^~~~~~~~~~~~~~~~~~~~~~~

/tmp/next/build/include/linux/init.h:176:30: error: expected declaration or statement at end of input
176 | #define THIS_MODULE ((struct module *)0)
| ^~~~~~
/tmp/next/build/include/linux/platform_device.h:304:41: note: in expansion of macro 'THIS_MODULE'
304 | __platform_driver_register(drv, THIS_MODULE, KBUILD_MODNAME)
| ^~~~~~~~~~~
/tmp/next/build/include/linux/device/driver.h:296:16: note: in expansion of macro 'platform_driver_register'

  296 |         return __register(&(__driver) , ##__VA_ARGS__); \
      |                ^~~~~~~~~~
/tmp/next/build/include/linux/platform_device.h:345:9: note: in expansion of macro 'builtin_driver'
  345 |         builtin_driver(__platform_driver, platform_driver_register)
      |         ^~~~~~~~~~~~~~
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:1: note: in expansion of macro 'builtin_platform_driver'
  554 | builtin_platform_driver(imx_gpc_driver)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/next/build/drivers/pmdomain/imx/gpc.c: At top level:
/tmp/next/build/drivers/pmdomain/imx/gpc.c:503:13: warning: 'imx_gpc_remove' defined but not used [-Wunused-function]
  503 | static void imx_gpc_remove(struct platform_device *pdev)
      |             ^~~~~~~~~~~~~~

AFAICT this is caused by commit

d7262971a2acc (pmdomain: imx: gpc: remove all initialized power domains)

though I don't really see how. I have used the tree from next-20261109 instead.

#3 lore raw
In reply to Sasha Levin
Quoted 44 lines · Sasha Levin
Quoted 6 lines · Mark Brown

AFAICT this is caused by commit

d7262971a2acc (pmdomain: imx: gpc: remove all initialized power domains)

though I don't really see how. I have used the tree from next-20261109 instead.

The while loop that commit adds to imx_gpc_remove() is never closed, so the function is still open at the end of the file:

                while (num_domains--) {
                        ret = pm_genpd_remove(&imx_gpc_domains[num_domains].base);
                        if (ret) {
                                ...
                                return;
                        }

                if (num_domains == GPC_PGC_DOMAIN_PU)
                        imx_pgc_put_clocks(&imx_gpc_domains[num_domains]);
        }

The patch was posted that way [1]. gpc.c is only built with HAVE_IMX_GPC, which only SOC_IMX6 on 32-bit ARM selects, so x86 and arm64 builds do not see it.

With the brace added, gpc.o builds with imx_v6_v7_defconfig:

drivers/pmdomain/imx/gpc.c +3 -2
@@ -536,8 +536,9 @@
                                return;
                        }
 
-               if (num_domains == GPC_PGC_DOMAIN_PU)
-                       imx_pgc_put_clocks(&imx_gpc_domains[num_domains]);
+                       if (num_domains == GPC_PGC_DOMAIN_PU)
+                               imx_pgc_put_clocks(&imx_gpc_domains[num_domains]);
+               }
        }
 
        of_node_put(pgc_node);
Quoted 5 lines

[1] https://lore.kernel.org/all/[email protected]/

--
Thanks,
Sasha

Thanks, I amended the change like that and rebased my branch.

Kind regards
Uffe

#5 lore raw
In reply to Mark Brown
Quoted 10 lines · Mark Brown
Quoted 4 lines · Mark Brown

Hi all,

After merging the pmdomain-fixes tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

This also affects the pmdomain tree. Also, I still had your Linaro address as a contact for all your trees - I've updated this to your kernel.org one since the Linaro one started bouncing.

Thanks!

The next and fixes branch should be updated now.

Kind regards
Uffe

Quoted 79 lines
Quoted 77 lines

In file included from /tmp/next/build/include/linux/device.h:32,
from /tmp/next/build/include/linux/platform_device.h:13,
from /tmp/next/build/drivers/pmdomain/imx/gpc.c:11:
/tmp/next/build/drivers/pmdomain/imx/gpc.c: In function 'imx_gpc_remove':
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:25: error: invalid storage class for function 'imx_gpc_driver_init'
554 | builtin_platform_driver(imx_gpc_driver)

      |                         ^~~~~~~~~~~~~~
/tmp/next/build/include/linux/device/driver.h:294:19: note: in definition of macro 'builtin_driver'
  294 | static int __init __driver##_init(void) \
      |                   ^~~~~~~~
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:1: note: in expansion of macro 'builtin_platform_driver'
  554 | builtin_platform_driver(imx_gpc_driver)
      | ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/next/build/include/linux/printk.h:6,
                 from /tmp/next/build/include/asm-generic/bug.h:31,
                 from /tmp/next/build/arch/arm/include/asm/bug.h:60,
                 from /tmp/next/build/include/linux/bug.h:5,
                 from /tmp/next/build/include/linux/instrumented.h:10,
                 from /tmp/next/build/include/linux/atomic/atomic-instrumented.h:17,
                 from /tmp/next/build/include/linux/atomic.h:82,
                 from /tmp/next/build/include/asm-generic/bitops/lock.h:5,
                 from /tmp/next/build/arch/arm/include/asm/bitops.h:245,
                 from /tmp/next/build/include/linux/bitops.h:67,
                 from /tmp/next/build/include/linux/kernel.h:23,
                 from /tmp/next/build/include/linux/clk.h:13,
                 from /tmp/next/build/drivers/pmdomain/imx/gpc.c:7:
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:25: error: initializer element is not constant
  554 | builtin_platform_driver(imx_gpc_driver)
      |                         ^~~~~~~~~~~~~~

/tmp/next/build/include/linux/init.h:265:55: note: in definition of macro '____define_initcall'
265 | __attribute__((__section__(__sec))) = fn;
| ^~
/tmp/next/build/include/linux/init.h:275:9: note: in expansion of macro '__unique_initcall'

  275 |         __unique_initcall(fn, id, __sec, __initcall_id(fn))
      |         ^~~~~~~~~~~~~~~~~
/tmp/next/build/include/linux/init.h:277:35: note: in expansion of macro '___define_initcall'
  277 | #define __define_initcall(fn, id) ___define_initcall(fn, id, .initcall##id)
      |                                   ^~~~~~~~~~~~~~~~~~
/tmp/next/build/include/linux/init.h:306:41: note: in expansion of macro '__define_initcall'
  306 | #define device_initcall(fn)             __define_initcall(fn, 6)
      |                                         ^~~~~~~~~~~~~~~~~
/tmp/next/build/include/linux/device/driver.h:298:1: note: in expansion of macro 'device_initcall'
  298 | device_initcall(__driver##_init);
      | ^~~~~~~~~~~~~~~
/tmp/next/build/include/linux/platform_device.h:345:9: note: in expansion of macro 'builtin_driver'
  345 |         builtin_driver(__platform_driver, platform_driver_register)
      |         ^~~~~~~~~~~~~~
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:1: note: in expansion of macro 'builtin_platform_driver'
  554 | builtin_platform_driver(imx_gpc_driver)
      | ^~~~~~~~~~~~~~~~~~~~~~~

/tmp/next/build/include/linux/init.h:176:30: error: expected declaration or statement at end of input
176 | #define THIS_MODULE ((struct module *)0)
| ^~~~~~
/tmp/next/build/include/linux/platform_device.h:304:41: note: in expansion of macro 'THIS_MODULE'
304 | __platform_driver_register(drv, THIS_MODULE, KBUILD_MODNAME)
| ^~~~~~~~~~~
/tmp/next/build/include/linux/device/driver.h:296:16: note: in expansion of macro 'platform_driver_register'

  296 |         return __register(&(__driver) , ##__VA_ARGS__); \
      |                ^~~~~~~~~~
/tmp/next/build/include/linux/platform_device.h:345:9: note: in expansion of macro 'builtin_driver'
  345 |         builtin_driver(__platform_driver, platform_driver_register)
      |         ^~~~~~~~~~~~~~
/tmp/next/build/drivers/pmdomain/imx/gpc.c:554:1: note: in expansion of macro 'builtin_platform_driver'
  554 | builtin_platform_driver(imx_gpc_driver)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/next/build/drivers/pmdomain/imx/gpc.c: At top level:
/tmp/next/build/drivers/pmdomain/imx/gpc.c:503:13: warning: 'imx_gpc_remove' defined but not used [-Wunused-function]
  503 | static void imx_gpc_remove(struct platform_device *pdev)
      |             ^~~~~~~~~~~~~~

AFAICT this is caused by commit

d7262971a2acc (pmdomain: imx: gpc: remove all initialized power domains)

though I don't really see how. I have used the tree from next-20261109 instead.