* [PATCH] ARM: at91: fix at91_suspend_entering_slow_clock link error
@ 2017-06-09 10:18 Arnd Bergmann
2017-06-09 11:44 ` Alexandre Belloni
2017-06-13 9:52 ` Alexandre Belloni
0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2017-06-09 10:18 UTC (permalink / raw)
To: linux-arm-kernel
When CONFIG_ARCH_AT91 is enabled, but none of the specific SoC support
is in use, some at91 specific drivers fail to link:
drivers/tty/serial/atmel_serial.o: In function `atmel_serial_suspend':
atmel_serial.c:(.text.atmel_serial_suspend+0x1e): undefined reference to `at91_suspend_entering_slow_clock'
drivers/usb/host/ohci-at91.o: In function `ohci_hcd_at91_drv_suspend':
ohci-at91.c:(.text.ohci_hcd_at91_drv_suspend+0x12): undefined reference to `at91_suspend_entering_slow_clock'
drivers/usb/gadget/udc/at91_udc.o: In function `at91udc_suspend':
at91_udc.c:(.text.at91udc_suspend+0x26): undefined reference to `at91_suspend_entering_slow_clock'
This changes the at91_suspend_entering_slow_clock hack once more, adding
an alternative inline implementation that is used exactly in those cases
that don't provide the normal implementation.
Fixes: c1892c2379d2 ("ARM: at91: handle CONFIG_PM for armv7m configurations")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-at91/samv7.c | 9 ---------
include/linux/platform_data/atmel.h | 7 +++++++
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-at91/samv7.c b/arch/arm/mach-at91/samv7.c
index 910f0c68db62..11386f190c83 100644
--- a/arch/arm/mach-at91/samv7.c
+++ b/arch/arm/mach-at91/samv7.c
@@ -15,15 +15,6 @@
#include <asm/system_misc.h>
#include "generic.h"
-#ifdef CONFIG_PM
-/* This function has to be defined for various drivers that are using it */
-int at91_suspend_entering_slow_clock(void)
-{
- return 0;
-}
-EXPORT_SYMBOL(at91_suspend_entering_slow_clock);
-#endif
-
static const char *const samv7_dt_board_compat[] __initconst = {
"atmel,samv7",
NULL
diff --git a/include/linux/platform_data/atmel.h b/include/linux/platform_data/atmel.h
index 3c8825b67298..7b6dce7d6d33 100644
--- a/include/linux/platform_data/atmel.h
+++ b/include/linux/platform_data/atmel.h
@@ -52,6 +52,13 @@ struct atmel_uart_data {
};
/* FIXME: this needs a better location, but gets stuff building again */
+#ifdef CONFIG_ATMEL_PM
extern int at91_suspend_entering_slow_clock(void);
+#else
+static inline int at91_suspend_entering_slow_clock(void)
+{
+ return 0;
+}
+#endif
#endif /* __ATMEL_H__ */
--
2.9.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] ARM: at91: fix at91_suspend_entering_slow_clock link error
2017-06-09 10:18 [PATCH] ARM: at91: fix at91_suspend_entering_slow_clock link error Arnd Bergmann
@ 2017-06-09 11:44 ` Alexandre Belloni
2017-06-09 18:55 ` Arnd Bergmann
2017-06-13 9:52 ` Alexandre Belloni
1 sibling, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2017-06-09 11:44 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On 09/06/2017 at 12:18:02 +0200, Arnd Bergmann wrote:
> When CONFIG_ARCH_AT91 is enabled, but none of the specific SoC support
> is in use, some at91 specific drivers fail to link:
>
> drivers/tty/serial/atmel_serial.o: In function `atmel_serial_suspend':
> atmel_serial.c:(.text.atmel_serial_suspend+0x1e): undefined reference to `at91_suspend_entering_slow_clock'
> drivers/usb/host/ohci-at91.o: In function `ohci_hcd_at91_drv_suspend':
> ohci-at91.c:(.text.ohci_hcd_at91_drv_suspend+0x12): undefined reference to `at91_suspend_entering_slow_clock'
> drivers/usb/gadget/udc/at91_udc.o: In function `at91udc_suspend':
> at91_udc.c:(.text.at91udc_suspend+0x26): undefined reference to `at91_suspend_entering_slow_clock'
>
How you present it makes me think, that this was present for a while,
even before samv7 support was added. Am I wrong?
> This changes the at91_suspend_entering_slow_clock hack once more, adding
> an alternative inline implementation that is used exactly in those cases
> that don't provide the normal implementation.
>
> Fixes: c1892c2379d2 ("ARM: at91: handle CONFIG_PM for armv7m configurations")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/arm/mach-at91/samv7.c | 9 ---------
> include/linux/platform_data/atmel.h | 7 +++++++
> 2 files changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm/mach-at91/samv7.c b/arch/arm/mach-at91/samv7.c
> index 910f0c68db62..11386f190c83 100644
> --- a/arch/arm/mach-at91/samv7.c
> +++ b/arch/arm/mach-at91/samv7.c
> @@ -15,15 +15,6 @@
> #include <asm/system_misc.h>
> #include "generic.h"
>
> -#ifdef CONFIG_PM
> -/* This function has to be defined for various drivers that are using it */
> -int at91_suspend_entering_slow_clock(void)
> -{
> - return 0;
> -}
> -EXPORT_SYMBOL(at91_suspend_entering_slow_clock);
> -#endif
> -
> static const char *const samv7_dt_board_compat[] __initconst = {
> "atmel,samv7",
> NULL
> diff --git a/include/linux/platform_data/atmel.h b/include/linux/platform_data/atmel.h
> index 3c8825b67298..7b6dce7d6d33 100644
> --- a/include/linux/platform_data/atmel.h
> +++ b/include/linux/platform_data/atmel.h
> @@ -52,6 +52,13 @@ struct atmel_uart_data {
> };
>
> /* FIXME: this needs a better location, but gets stuff building again */
> +#ifdef CONFIG_ATMEL_PM
> extern int at91_suspend_entering_slow_clock(void);
> +#else
> +static inline int at91_suspend_entering_slow_clock(void)
> +{
> + return 0;
> +}
> +#endif
>
> #endif /* __ATMEL_H__ */
> --
> 2.9.0
>
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH] ARM: at91: fix at91_suspend_entering_slow_clock link error
2017-06-09 11:44 ` Alexandre Belloni
@ 2017-06-09 18:55 ` Arnd Bergmann
0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2017-06-09 18:55 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jun 9, 2017 at 1:44 PM, Alexandre Belloni
<alexandre.belloni@free-electrons.com> wrote:
> Hi,
>
> On 09/06/2017 at 12:18:02 +0200, Arnd Bergmann wrote:
>> When CONFIG_ARCH_AT91 is enabled, but none of the specific SoC support
>> is in use, some at91 specific drivers fail to link:
>>
>> drivers/tty/serial/atmel_serial.o: In function `atmel_serial_suspend':
>> atmel_serial.c:(.text.atmel_serial_suspend+0x1e): undefined reference to `at91_suspend_entering_slow_clock'
>> drivers/usb/host/ohci-at91.o: In function `ohci_hcd_at91_drv_suspend':
>> ohci-at91.c:(.text.ohci_hcd_at91_drv_suspend+0x12): undefined reference to `at91_suspend_entering_slow_clock'
>> drivers/usb/gadget/udc/at91_udc.o: In function `at91udc_suspend':
>> at91_udc.c:(.text.at91udc_suspend+0x26): undefined reference to `at91_suspend_entering_slow_clock'
>>
>
> How you present it makes me think, that this was present for a while,
> even before samv7 support was added. Am I wrong?
I only ran into the problem after samv7 support was added. Before that,
pm.o was always built-in when CONFIG_AT91 was set, even when none
of the specific platforms got enabled.
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: at91: fix at91_suspend_entering_slow_clock link error
2017-06-09 10:18 [PATCH] ARM: at91: fix at91_suspend_entering_slow_clock link error Arnd Bergmann
2017-06-09 11:44 ` Alexandre Belloni
@ 2017-06-13 9:52 ` Alexandre Belloni
1 sibling, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2017-06-13 9:52 UTC (permalink / raw)
To: linux-arm-kernel
On 09/06/2017 at 12:18:02 +0200, Arnd Bergmann wrote:
> When CONFIG_ARCH_AT91 is enabled, but none of the specific SoC support
> is in use, some at91 specific drivers fail to link:
>
> drivers/tty/serial/atmel_serial.o: In function `atmel_serial_suspend':
> atmel_serial.c:(.text.atmel_serial_suspend+0x1e): undefined reference to `at91_suspend_entering_slow_clock'
> drivers/usb/host/ohci-at91.o: In function `ohci_hcd_at91_drv_suspend':
> ohci-at91.c:(.text.ohci_hcd_at91_drv_suspend+0x12): undefined reference to `at91_suspend_entering_slow_clock'
> drivers/usb/gadget/udc/at91_udc.o: In function `at91udc_suspend':
> at91_udc.c:(.text.at91udc_suspend+0x26): undefined reference to `at91_suspend_entering_slow_clock'
>
> This changes the at91_suspend_entering_slow_clock hack once more, adding
> an alternative inline implementation that is used exactly in those cases
> that don't provide the normal implementation.
>
> Fixes: c1892c2379d2 ("ARM: at91: handle CONFIG_PM for armv7m configurations")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/arm/mach-at91/samv7.c | 9 ---------
> include/linux/platform_data/atmel.h | 7 +++++++
> 2 files changed, 7 insertions(+), 9 deletions(-)
>
Applied, thanks.
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-06-13 9:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-09 10:18 [PATCH] ARM: at91: fix at91_suspend_entering_slow_clock link error Arnd Bergmann
2017-06-09 11:44 ` Alexandre Belloni
2017-06-09 18:55 ` Arnd Bergmann
2017-06-13 9:52 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).