Skip to contentSkip to conversation

arm-linux-gnueabi-ld: arch/arm/mach-pxa/devices.o:undefined reference to `gpio_set_wake'

PATCH kernel test robot 4 participants 6 messages Jul 11, 2024 – Jul 15, 2024

Subsystems (4)
lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f477dd6eede3ecedc8963478571d99ec3bf3f762
commit: 917195d6f8293c35fcf9ed4bfe18f52cc1c9d2e6 [11606/12643] ARM: pxa: consolidate GPIO chip platform data
config: arm-pxa3xx_defconfig (https://download.01.org/0day-ci/archive/20240711/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240711/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> arm-linux-gnueabi-ld: arch/arm/mach-pxa/devices.o:(.data+0x167c): undefined reference to `gpio_set_wake'
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw

Hi Arnd,

Quoted 7 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f477dd6eede3ecedc8963478571d99ec3bf3f762
commit: 917195d6f8293c35fcf9ed4bfe18f52cc1c9d2e6 [11606/12643] ARM: pxa: consolidate GPIO chip platform data
config: arm-pxa3xx_defconfig (https://download.01.org/0day-ci/archive/20240711/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240711/[email protected]/reproduce)
Quoted 8 lines

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

arm-linux-gnueabi-ld: arch/arm/mach-pxa/devices.o:(.data+0x167c): undefined reference to `gpio_set_wake'

Sorry about this. I think the easiest way of fixing this is:

arch/arm/mach-pxa/devices.c +2 -0
index d050a4c78f97..7695cfce01a1 100644
@@ -633,6 +633,7 @@ struct platform_device pxa27x_device_pwm1 = {
 };
 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
 
+#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
 const struct software_node pxa2xx_gpiochip_node = {
 	.name	= "gpio-pxa",
 };
@@ -684,6 +685,7 @@ struct platform_device pxa27x_device_gpio = {
 		.platform_data	= &pxa2xx_gpio_info,
 	},
 };
+#endif /* CONFIG_PXA25x || CONFIG_PXA27x */
 
 static struct resource pxa_dma_resource[] = {
 	[0] = {

If you are OK with this I'll submit proper patch.

Thanks!

Signature · 1 line
Dmitry
#2 lore raw
Quoted 10 lines · Dmitry Torokhov
(quoted diff) +1 -0
@@ -684,6 +685,7 @@ struct platform_device pxa27x_device_gpio = {
 		.platform_data	= &pxa2xx_gpio_info,
 	},
 };
+#endif /* CONFIG_PXA25x || CONFIG_PXA27x */
 
 static struct resource pxa_dma_resource[] = {
 	[0] = {

If you are OK with this I'll submit proper patch.

Right, that's probably the easiest way. I was trying a more elaborate change (see below), but there is a good chance I introduce another regression in that, so let's go with your patch. Please send it directly to [email protected] Cc:linux-arm-kernel and I'll pick it up.

One more thing I noticed: if you are doing more patches to convert devices in board files to use software nodes, we should probably try to move them away from static platform_device definitions towards a dynamic platform_device_register_simple() or similar interface at the same time.

Arnd

arch/arm/mach-pxa/devices.c +0 -52
index d050a4c78f97..8813a5d179ed 100644
@@ -633,58 +633,6 @@ struct platform_device pxa27x_device_pwm1 = {
 };
 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
 
-const struct software_node pxa2xx_gpiochip_node = {
-	.name	= "gpio-pxa",
-};
-
-struct resource pxa_resource_gpio[] = {
-	{
-		.start	= 0x40e00000,
-		.end	= 0x40e0ffff,
-		.flags	= IORESOURCE_MEM,
-	}, {
-		.start	= IRQ_GPIO0,
-		.end	= IRQ_GPIO0,
-		.name	= "gpio0",
-		.flags	= IORESOURCE_IRQ,
-	}, {
-		.start	= IRQ_GPIO1,
-		.end	= IRQ_GPIO1,
-		.name	= "gpio1",
-		.flags	= IORESOURCE_IRQ,
-	}, {
-		.start	= IRQ_GPIO_2_x,
-		.end	= IRQ_GPIO_2_x,
-		.name	= "gpio_mux",
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct pxa_gpio_platform_data pxa2xx_gpio_info = {
-	.irq_base	= PXA_GPIO_TO_IRQ(0),
-	.gpio_set_wake	= gpio_set_wake,
-};
-
-struct platform_device pxa25x_device_gpio = {
-	.name		= "pxa25x-gpio",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(pxa_resource_gpio),
-	.resource	= pxa_resource_gpio,
-	.dev		= {
-		.platform_data	= &pxa2xx_gpio_info,
-	},
-};
-
-struct platform_device pxa27x_device_gpio = {
-	.name		= "pxa27x-gpio",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(pxa_resource_gpio),
-	.resource	= pxa_resource_gpio,
-	.dev		= {
-		.platform_data	= &pxa2xx_gpio_info,
-	},
-};
-
 static struct resource pxa_dma_resource[] = {
 	[0] = {
 		.start	= 0x40000000,
arch/arm/mach-pxa/mfp-pxa2xx.c +56 -18

105 lines not on this page · raw message

#3 lore raw
Quoted 10 lines · Arnd Bergmann
Quoted 9 lines · Dmitry Torokhov
arch/arm/mach-pxa/devices.c +1 -0
@@ -684,6 +685,7 @@ struct platform_device pxa27x_device_gpio = {
 		.platform_data	= &pxa2xx_gpio_info,
 	},
 };
+#endif /* CONFIG_PXA25x || CONFIG_PXA27x */
 
 static struct resource pxa_dma_resource[] = {
 	[0] = {
Quoted 7 lines
Quoted 1 line

If you are OK with this I'll submit proper patch.

Right, that's probably the easiest way. I was trying a more elaborate change (see below), but there is a good chance I introduce another regression in that, so let's go with your patch. Please send it directly to [email protected] Cc:linux-arm-kernel and I'll pick it up.

Done.

Quoted 7 lines

One more thing I noticed: if you are doing more patches to convert devices in board files to use software nodes, we should probably try to move them away from static platform_device definitions towards a dynamic platform_device_register_simple() or similar interface at the same time.

Sometimes platform_device_register_full() which operates on platform_device_info structure is very handy, but in general what is the issue with statically defined devices (when they are never unregistered)?

Thanks.

Signature · 1 line
Dmitry
#4 lore raw
Quoted 19 lines · Dmitry Torokhov
Quoted 10 lines · Arnd Bergmann
Quoted 9 lines · Dmitry Torokhov
arch/arm/mach-pxa/devices.c +1 -0
@@ -684,6 +685,7 @@ struct platform_device pxa27x_device_gpio = {
 		.platform_data	= &pxa2xx_gpio_info,
 	},
 };
+#endif /* CONFIG_PXA25x || CONFIG_PXA27x */
 
 static struct resource pxa_dma_resource[] = {
 	[0] = {
Quoted 7 lines
Quoted 1 line

If you are OK with this I'll submit proper patch.

Right, that's probably the easiest way. I was trying a more elaborate change (see below), but there is a good chance I introduce another regression in that, so let's go with your patch. Please send it directly to [email protected] Cc:linux-arm-kernel and I'll pick it up.

Quoted 1 line

Done.

Merged now in preparation for my pull requests, thanks!

Quoted 11 lines
Quoted 6 lines

One more thing I noticed: if you are doing more patches to convert devices in board files to use software nodes, we should probably try to move them away from static platform_device definitions towards a dynamic platform_device_register_simple() or similar interface at the same time.

Sometimes platform_device_register_full() which operates on platform_device_info structure is very handy, but in general what is the issue with statically defined devices (when they are never unregistered)?

Greg has been asking for this for many years, but it has been unrealistic in the past because of the large number of board files using static platform devices. As far as I understand it, having static platform devices prevents us from better enforcing lifetime management rules on device objects. Adding Greg to Cc in case he has something to add.

The other point of course is static memory usage: a platform device structure in .data is much larger than a platform_device_info, and this adds up in a kernel that tries to support lots of boards.

Arnd

#5 lore raw
Quoted 13 lines · Arnd Bergmann
Quoted 11 lines · Dmitry Torokhov
Quoted 6 lines

One more thing I noticed: if you are doing more patches to convert devices in board files to use software nodes, we should probably try to move them away from static platform_device definitions towards a dynamic platform_device_register_simple() or similar interface at the same time.

Sometimes platform_device_register_full() which operates on platform_device_info structure is very handy, but in general what is the issue with statically defined devices (when they are never unregistered)?

Quoted 6 lines

Greg has been asking for this for many years, but it has been unrealistic in the past because of the large number of board files using static platform devices. As far as I understand it, having static platform devices prevents us from better enforcing lifetime management rules on device objects. Adding Greg to Cc in case he has something to add.

Not much more to add other than "please don't do that."

thanks,

greg k-h