Skip to contentSkip to conversation

serial: extend compile-test coverage

PATCH Superseded Johan Hovold 3 participants 7 messages Apr 21, 2021 – Apr 22, 2021 TTY layer and serial drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: extend compile-test coverage

Allow more drivers to be compile tested, for example, when doing subsystem-wide changes.

Verified on X86_64 as well as arm, powerpc and m68k with minimal configs in order to catch missing implicit build dependencies (e.g. MAILBOX for SERIAL_TEGRA_TCU).

---
 drivers/tty/serial/8250/Kconfig |  6 ++++--
 drivers/tty/serial/Kconfig      | 20 +++++++++++---------
 2 files changed, 15 insertions(+), 11 deletions(-)
drivers/tty/serial/8250/Kconfig +4 -2
index 4b9d7d1951f8..d1b3c2373fa4 100644
@@ -403,7 +403,8 @@ config SERIAL_8250_RT288X
 
 config SERIAL_8250_OMAP
 	tristate "Support for OMAP internal UART (8250 based driver)"
-	depends on SERIAL_8250 && (ARCH_OMAP2PLUS || ARCH_K3)
+	depends on SERIAL_8250
+	depends on ARCH_OMAP2PLUS || ARCH_K3 || COMPILE_TEST
 	help
 	  If you have a machine based on an Texas Instruments OMAP CPU you
 	  can enable its onboard serial ports by enabling this option.
@@ -439,7 +440,8 @@ config SERIAL_8250_LPC18XX
 
 config SERIAL_8250_MT6577
 	tristate "Mediatek serial port support"
-	depends on SERIAL_8250 && ARCH_MEDIATEK
+	depends on SERIAL_8250
+	depends on ARCH_MEDIATEK || COMPILE_TEST
 	help
 	  If you have a Mediatek based board and want to use the
 	  serial port, say Y to this option. If unsure, say N.
drivers/tty/serial/Kconfig +11 -9
index e6f55c28cc2e..35fd148fd2b2 100644
@@ -20,7 +20,7 @@ comment "Non-8250 serial port support"
 
 config SERIAL_AMBA_PL010
 	tristate "ARM AMBA PL010 serial port support"
-	depends on ARM_AMBA
+	depends on ARM_AMBA || COMPILE_TEST
 	select SERIAL_CORE
 	help
 	  This selects the ARM(R) AMBA(R) PrimeCell PL010 UART.  If you have
@@ -198,7 +198,7 @@ config SERIAL_KGDB_NMI
 
 config SERIAL_MESON
 	tristate "Meson serial port support"
-	depends on ARCH_MESON
+	depends on ARCH_MESON || COMPILE_TEST
 	select SERIAL_CORE
 	help
 	  This enables the driver for the on-chip UARTs of the Amlogic
@@ -278,7 +278,7 @@ config SERIAL_SAMSUNG_CONSOLE
 
 config SERIAL_TEGRA
 	tristate "NVIDIA Tegra20/30 SoC serial controller"
-	depends on ARCH_TEGRA && TEGRA20_APB_DMA
+	depends on (ARCH_TEGRA && TEGRA20_APB_DMA) || COMPILE_TEST
 	select SERIAL_CORE
 	help
 	  Support for the on-chip UARTs on the NVIDIA Tegra series SOCs
@@ -289,7 +289,8 @@ config SERIAL_TEGRA
 
 config SERIAL_TEGRA_TCU
 	tristate "NVIDIA Tegra Combined UART"
-	depends on ARCH_TEGRA && TEGRA_HSP_MBOX
+	depends on MAILBOX
+	depends on (ARCH_TEGRA && TEGRA_HSP_MBOX) || COMPILE_TEST
 	select SERIAL_CORE
 	help
 	  Support for the mailbox-based TCU (Tegra Combined UART) serial port.
@@ -852,7 +853,8 @@ config SERIAL_MPC52xx_CONSOLE_BAUD
 
 config SERIAL_ICOM
 	tristate "IBM Multiport Serial Adapter"
-	depends on PCI && PPC_PSERIES
+	depends on PCI
+	depends on PPC_PSERIES || COMPILE_TEST
 	select SERIAL_CORE
 	select FW_LOADER
 	help
@@ -865,7 +867,7 @@ config SERIAL_ICOM
 
 config SERIAL_TXX9
 	bool "TMPTX39XX/49XX SIO support"
-	depends on HAS_TXX9_SERIAL
+	depends on HAS_TXX9_SERIAL || COMPILE_TEST
 	select SERIAL_CORE
 	default y
 
@@ -921,7 +923,7 @@ config SERIAL_JSM
 
 config SERIAL_MSM
 	tristate "MSM on-chip serial port support"
-	depends on ARCH_QCOM
+	depends on ARCH_QCOM || COMPILE_TEST
 	select SERIAL_CORE
 
 config SERIAL_MSM_CONSOLE
@@ -947,7 +949,7 @@ config SERIAL_QCOM_GENI_CONSOLE
 
 config SERIAL_VT8500
 	bool "VIA VT8500 on-chip serial port support"
-	depends on ARCH_VT8500
+	depends on ARCH_VT8500 || COMPILE_TEST
 	select SERIAL_CORE
 
 config SERIAL_VT8500_CONSOLE
@@ -957,7 +959,7 @@ config SERIAL_VT8500_CONSOLE
 
 config SERIAL_OMAP
 	tristate "OMAP serial port support"
-	depends on ARCH_OMAP2PLUS
+	depends on ARCH_OMAP2PLUS || COMPILE_TEST
 	select SERIAL_CORE
 	help
 	  If you have a machine based on an Texas Instruments OMAP CPU you
Signature · 1 line
2.26.3
#1 lore raw
I love your patch! Perhaps something to improve:

Hi Johan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on usb/usb-testing v5.12-rc8 next-20210421] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Johan-Hovold/serial-extend-compile-test-coverage/20210421-234950
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: x86_64-randconfig-a014-20210421 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d87b9b81ccb95217181ce75515c6c68bbb408ca4)

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/c010530fa587261662c6abdb59ade994645dcfa8
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Johan-Hovold/serial-extend-compile-test-coverage/20210421-234950 git checkout c010530fa587261662c6abdb59ade994645dcfa8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

>> drivers/tty/serial/serial_txx9.c:987:12: warning: no previous prototype for function 'early_serial_txx9_setup' [-Wmissing-prototypes]
   int __init early_serial_txx9_setup(struct uart_port *port)
              ^

drivers/tty/serial/serial_txx9.c:987:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int __init early_serial_txx9_setup(struct uart_port *port)
^
static
1 warning generated.

vim +/early_serial_txx9_setup +987 drivers/tty/serial/serial_txx9.c

^1da177e4c3f41 drivers/serial/serial_txx9.c Linus Torvalds 2005-04-16 986

^1da177e4c3f41 drivers/serial/serial_txx9.c Linus Torvalds 2005-04-16 @987  int __init early_serial_txx9_setup(struct uart_port *port)
^1da177e4c3f41 drivers/serial/serial_txx9.c Linus Torvalds 2005-04-16  988  {
^1da177e4c3f41 drivers/serial/serial_txx9.c Linus Torvalds 2005-04-16  989  	if (port->line >= ARRAY_SIZE(serial_txx9_ports))
^1da177e4c3f41 drivers/serial/serial_txx9.c Linus Torvalds 2005-04-16  990  		return -ENODEV;
^1da177e4c3f41 drivers/serial/serial_txx9.c Linus Torvalds 2005-04-16  991  
^1da177e4c3f41 drivers/serial/serial_txx9.c Linus Torvalds 2005-04-16  992  	serial_txx9_ports[port->line].port = *port;
^1da177e4c3f41 drivers/serial/serial_txx9.c Linus Torvalds 2005-04-16  993  	serial_txx9_ports[port->line].port.ops = &serial_txx9_pops;
37a6c7d0096bb5 drivers/serial/serial_txx9.c Atsushi Nemoto 2007-10-16  994  	serial_txx9_ports[port->line].port.flags |=
37a6c7d0096bb5 drivers/serial/serial_txx9.c Atsushi Nemoto 2007-10-16  995  		UPF_BOOT_AUTOCONF | UPF_FIXED_PORT;
^1da177e4c3f41 drivers/serial/serial_txx9.c Linus Torvalds 2005-04-16  996  	return 0;
^1da177e4c3f41 drivers/serial/serial_txx9.c Linus Torvalds 2005-04-16  997  }
^1da177e4c3f41 drivers/serial/serial_txx9.c Linus Torvalds 2005-04-16  998  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#2 lore raw
Quoted 29 lines · kernel test robot

I love your patch! Perhaps something to improve:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on usb/usb-testing v5.12-rc8 next-20210421] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Johan-Hovold/serial-extend-compile-test-coverage/20210421-234950
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: x86_64-randconfig-a014-20210421 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d87b9b81ccb95217181ce75515c6c68bbb408ca4)

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/c010530fa587261662c6abdb59ade994645dcfa8
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Johan-Hovold/serial-extend-compile-test-coverage/20210421-234950 git checkout c010530fa587261662c6abdb59ade994645dcfa8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

Quoted 8 lines
Quoted 1 line
Quoted 1 line

drivers/tty/serial/serial_txx9.c:987:12: warning: no previous prototype for function 'early_serial_txx9_setup' [-Wmissing-prototypes]

int __init early_serial_txx9_setup(struct uart_port *port)

              ^

drivers/tty/serial/serial_txx9.c:987:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int __init early_serial_txx9_setup(struct uart_port *port)
^
static
1 warning generated.

This function is called from arch/mips/txx9/generic/setup.c, and does have a forward declaration in arch/mips/include/asm/txx9/generic.h. Unfortunately the latter cannot be included from the driver, unless the || COMPILE_TEST is dropped again.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert(a)linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#3 lore raw
Quoted 11 lines · Geert Uytterhoeven
Quoted 8 lines · kernel test robot
Quoted 1 line
Quoted 1 line

drivers/tty/serial/serial_txx9.c:987:12: warning: no previous prototype for function 'early_serial_txx9_setup' [-Wmissing-prototypes]

int __init early_serial_txx9_setup(struct uart_port *port)

              ^

drivers/tty/serial/serial_txx9.c:987:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int __init early_serial_txx9_setup(struct uart_port *port)
^
static
1 warning generated.

Quoted 4 lines

This function is called from arch/mips/txx9/generic/setup.c, and does have a forward declaration in arch/mips/include/asm/txx9/generic.h. Unfortunately the latter cannot be included from the driver, unless the || COMPILE_TEST is dropped again.

Thanks, Geert. I was just about to send a v2 without the txx9 hunk.

Johan

#4 lore raw

Hi Johan,

Quoted 11 lines · Johan Hovold
Quoted 10 lines · Geert Uytterhoeven
Quoted 8 lines · kernel test robot
Quoted 1 line
Quoted 1 line

drivers/tty/serial/serial_txx9.c:987:12: warning: no previous prototype for function 'early_serial_txx9_setup' [-Wmissing-prototypes]

int __init early_serial_txx9_setup(struct uart_port *port)

              ^

drivers/tty/serial/serial_txx9.c:987:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int __init early_serial_txx9_setup(struct uart_port *port)
^
static
1 warning generated.

Quoted 6 lines
Quoted 4 lines

This function is called from arch/mips/txx9/generic/setup.c, and does have a forward declaration in arch/mips/include/asm/txx9/generic.h. Unfortunately the latter cannot be included from the driver, unless the || COMPILE_TEST is dropped again.

Thanks, Geert. I was just about to send a v2 without the txx9 hunk.

well, I guess apart from this (W=1!) warning, this driver still compile-tests fine.
Do we consider hard-to-fix W=1 warnings to be legitimate blockers for enabling compile-testing?

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert(a)linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#5 lore raw
Quoted 19 lines · Geert Uytterhoeven

Hi Johan,

Quoted 16 lines · Johan Hovold
Quoted 14 lines · Geert Uytterhoeven
Quoted 8 lines · kernel test robot
Quoted 1 line
Quoted 1 line

drivers/tty/serial/serial_txx9.c:987:12: warning: no previous prototype for function 'early_serial_txx9_setup' [-Wmissing-prototypes]

int __init early_serial_txx9_setup(struct uart_port *port)

              ^

drivers/tty/serial/serial_txx9.c:987:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int __init early_serial_txx9_setup(struct uart_port *port)
^
static
1 warning generated.

This function is called from arch/mips/txx9/generic/setup.c, and does have a forward declaration in arch/mips/include/asm/txx9/generic.h. Unfortunately the latter cannot be included from the driver, unless the || COMPILE_TEST is dropped again.

Quoted 6 lines
Quoted 1 line

Thanks, Geert. I was just about to send a v2 without the txx9 hunk.

well, I guess apart from this (W=1!) warning, this driver still compile-tests fine.
Do we consider hard-to-fix W=1 warnings to be legitimate blockers for enabling compile-testing?

Since the build bots have enabled them (and people have turned it into a crusade to suppress every W=1 warning by any means) I think it's reasonable to not introduce new ones knowingly.

And I'm not too motivated right now to try to work around this one myself. The idea here was just to enable COMPILE_TEST for drivers that did not have any build-time dependencies.

Johan

#6 lore raw

Hi Johan,

Quoted 25 lines · Johan Hovold
Quoted 17 lines · Geert Uytterhoeven
Quoted 16 lines · Johan Hovold
Quoted 14 lines · Geert Uytterhoeven
Quoted 8 lines · kernel test robot
Quoted 1 line
Quoted 1 line

drivers/tty/serial/serial_txx9.c:987:12: warning: no previous prototype for function 'early_serial_txx9_setup' [-Wmissing-prototypes]

int __init early_serial_txx9_setup(struct uart_port *port)

              ^

drivers/tty/serial/serial_txx9.c:987:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int __init early_serial_txx9_setup(struct uart_port *port)
^
static
1 warning generated.

This function is called from arch/mips/txx9/generic/setup.c, and does have a forward declaration in arch/mips/include/asm/txx9/generic.h. Unfortunately the latter cannot be included from the driver, unless the || COMPILE_TEST is dropped again.

Quoted 6 lines
Quoted 1 line

Thanks, Geert. I was just about to send a v2 without the txx9 hunk.

well, I guess apart from this (W=1!) warning, this driver still compile-tests fine.
Do we consider hard-to-fix W=1 warnings to be legitimate blockers for enabling compile-testing?

Quoted 7 lines

Since the build bots have enabled them (and people have turned it into a crusade to suppress every W=1 warning by any means) I think it's reasonable to not introduce new ones knowingly.

And I'm not too motivated right now to try to work around this one myself. The idea here was just to enable COMPILE_TEST for drivers that did not have any build-time dependencies.

OK.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert(a)linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds