Hi Greg,
This is a resend of my last week's 8250 series, with a couple of
issues fixed as pointed out by Paul Gortmaker.
Masahiro Yamada had an idea for a nicer solution to the problem of
a modular build, but after some back and forth, the conclusion was
that this does not work any more after the rework done by
Peter Hurley, so we are back to my original approach.
I've done many compile tests over the last week and found another
corner case in the Ingenic driver patch, which is now also fixed,
and I'm no longer getting any invalid symbol references here or
in other drivers.
Arnd
This reverts commit cafe1ac64023 ("drivers/tty: make serial
8250_ingenic.c explicitly non-modular"), which attempted to remove dead
code but did not have the desired effect when the main 8250 driver was
a loadable module itself.
This would normally result in a link error, but as the entire
drivers/tty/serial/8250/ directory is only entered when CONFIG_SERIAL_8250
is set, we never notice that the driver does not get built in this
configuration.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/tty/serial/8250/8250_ingenic.c | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
This reverts commit d72d391c126e ("drivers/tty/serial: make
8250/8250_mtk.c explicitly non-modular"), which intended to remove dead
code but did not have the desired effect when the main 8250 driver was
a module itself.
This would normally result in a link error, but as the entire
drivers/tty/serial/8250/ directory is only entered when CONFIG_SERIAL_8250
is set, we never notice that the driver does not get built in this
configuration.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/tty/serial/8250/8250_mtk.c | 35 ++++++++++++++++++++++++++++-------
1 file changed, 28 insertions(+), 7 deletions(-)
@@ -300,3 +317,7 @@ static int __init early_mtk8250_setup(struct earlycon_device *device,OF_EARLYCON_DECLARE(mtk8250,"mediatek,mt6577-uart",early_mtk8250_setup);#endif++MODULE_AUTHOR("Matthias Brugger");+MODULE_LICENSE("GPL");+MODULE_DESCRIPTION("Mediatek 8250 serial port driver");
This reverts commit d72d391c126e ("drivers/tty/serial: make
8250/8250_mtk.c explicitly non-modular"), which intended to remove dead
code but did not have the desired effect when the main 8250 driver was
a module itself.
This would normally result in a link error, but as the entire
drivers/tty/serial/8250/ directory is only entered when CONFIG_SERIAL_8250
is set, we never notice that the driver does not get built in this
configuration.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
@@ -300,3 +317,7 @@ static int __init early_mtk8250_setup(struct earlycon_device *device,OF_EARLYCON_DECLARE(mtk8250,"mediatek,mt6577-uart",early_mtk8250_setup);#endif++MODULE_AUTHOR("Matthias Brugger");+MODULE_LICENSE("GPL");+MODULE_DESCRIPTION("Mediatek 8250 serial port driver");
The newly added uniphier serial port driver fails to build as
a loadable module when the base 8250 driver is built-in and
its console support enabled:
ERROR: "early_serial8250_setup" [drivers/tty/serial/8250/8250_uniphier.ko] undefined!
This changes the driver to only provide the early console support
if it is built-in itself as well.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/tty/serial/8250/8250_uniphier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
The Ingenic 8250 driver has a 'bool' Kconfig symbol, but that
breaks when SERIAL_8250 is a loadable module:
drivers/tty/built-in.o: In function `ingenic_uart_probe':
8250_ingenic.c:(.text+0x1c1a0): undefined reference to `serial8250_register_8250_port'
This changes the symbol to a 'tristate', plus a dependency on
SERIAL_8250, which makes it work again. Unlike the other
soc-specific backends, this one has no dependency on an
architecture or a platform. I'm adding a dependency on
MIPS || COMPILE_TEST as well here, to avoid showing the driver
on architectures that are not interested in it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/tty/serial/8250/8250_ingenic.c | 2 +-
drivers/tty/serial/8250/Kconfig | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
@@ -384,9 +384,10 @@ config SERIAL_8250_UNIPHIERserialports,sayYtothisoption.Ifunsure,sayN.configSERIAL_8250_INGENIC-bool"Support for Ingenic SoC serial ports"-depends onOF_FLATTREE-selectLIBFDT+tristate"Support for Ingenic SoC serial ports"+depends onSERIAL_8250+depends on(OF_FLATTREE&&SERIAL_8250_CONSOLE)||!SERIAL_EARLYCON+depends onMIPS||COMPILE_TESThelpIfyouhaveasystemusinganIngenicSoCandwishtomakeuseofitsUARTs,sayYtothisoption.Ifunsure,sayN.
The Mediatek 8250 driver has a 'bool' Kconfig symbol, but that
breaks when SERIAL_8250 is a loadable module:
drivers/tty/built-in.o: In function `mtk8250_set_termios':
:(.text+0x1bee8): undefined reference to `serial8250_do_set_termios'
:(.text+0x1bf10): undefined reference to `uart_get_baud_rate'
:(.text+0x1c09c): undefined reference to `uart_get_divisor'
drivers/tty/built-in.o: In function `mtk8250_do_pm':
:(.text+0x1c0d0): undefined reference to `serial8250_do_pm'
drivers/tty/built-in.o: In function `mtk8250_probe':
:(.text+0x1c2e4): undefined reference to `serial8250_register_8250_port'
serial/8250/8250_mtk.c:287:242: error: data definition has no type or storage class [-Werror]
serial/8250/8250_mtk.c:287:122: error: 'mtk8250_platform_driver_init' defined but not used [-Werror=unused-function]
This changes the symbol to a 'tristate', so the dependency on
SERIAL_8250 also works when that is set to 'm'.
To actually build the driver, we also need to include <linux/module.h>.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
---
drivers/tty/serial/8250/8250_mtk.c | 2 +-
drivers/tty/serial/8250/Kconfig | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
@@ -370,7 +370,7 @@ config SERIAL_8250_LPC18XXserialport,sayYtothisoption.Ifunsure,sayY.configSERIAL_8250_MT6577-bool"Mediatek serial port support"+tristate"Mediatek serial port support"depends onSERIAL_8250&&ARCH_MEDIATEKhelpIfyouhaveaMediatekbasedboardandwanttousethe