Re: [PATCH] earlycon: Fix compile error when SERIAL_CORE is m

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2022/10/20 13:04, Greg KH wrote:
On Thu, Oct 20, 2022 at 11:27:22AM +0800, Zhang Xiaoxu wrote:
When set CONFIG_SERIAL_EARLYCON=y and CONFIG_SERIAL_CORE=m, there is
a compile error as below:

   ld: vmlinux.o: in function `parse_options.constprop.0':
   earlycon.c:(.init.text+0xba5a3): undefined reference to `uart_parse_earlycon'

Since the SERIAL_EARLYCON use 'uart_parse_earlycon' which defined in
SERIAL_CORE, so should select rather than depends on.

No, please try to never use "select".


Fixes: 9aac5887595b ("tty/serial: add generic serial earlycon")

So this has been a problem for a very very long time and never been
seen until now?  That feels wrong, what changed to cause this to not
ever be hit before with all of the tens of thousands of random configs
that have been built since this very old kernel?

Yes, 0fb9342d06b0 ("tty: serial: earlycon dependency") already fix the
same issue with add "depends on SERIAL_CORE".

But there are some other scenarios can trigger the same issue.

Use the config file in the bugzilla can reproduce the problem.
https://bugzilla.kernel.org/show_bug.cgi?id=216611

Bisect with this config, find out the following commit introduce the issue:
  cdcc41a256efe8 ("tty: serial: Kconfig: Allow SERIAL_QCOM_GENI_CONSOLE to be enabled if SERIAL_QCOM_GENI is a module")

 config SERIAL_QCOM_GENI
        tristate "QCOM on-chip GENI based serial port support"
        depends on ARCH_QCOM || COMPILE_TEST
        depends on QCOM_GENI_SE
        select SERIAL_CORE

 config SERIAL_QCOM_GENI_CONSOLE
        bool "QCOM GENI Serial Console support"
-       depends on SERIAL_QCOM_GENI=y
+       depends on SERIAL_QCOM_GENI
        select SERIAL_CORE_CONSOLE
        select SERIAL_EARLYCON
        help
          Serial console driver for Qualcomm Technologies Inc's GENI based
          QUP hardware.

Since 73abaf87f01b ("serial: earlycon: Refactor parse_options into serial core")
use the uart_parse_earlycon() which defined in SERIAL_CORE, so if SERIAL_EARLYCON=y,
should always select SERIAL_CORE=y.

If change to "depends on SERIAL_CORE=y", just WARNING when make olddefconfig, can't
auto select the depends to Y.
thanks,

greg k-h



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux