Skip to contentSkip to conversation

serial: 8250_ce4100: Fix CONFIG_SERIAL_8250=n build

PATCH Superseded Andy Shevchenko 2 participants 4 messages Jul 16, 2025 TTY layer and serial drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: 8250_ce4100: Fix CONFIG_SERIAL_8250=n build

On i386, when

CONFIG_X86_INTEL_CE=y
# CONFIG_SERIAL_8250 is not set

will try to compile the driver and use the stub simultaneously. This breaks the build. Fix it by making sure that the driver compiles only when CONFIG_SERIAL_8250 is also enabled.

Fixes acc902de05b2 ("serial: 8250: Move CE4100 quirks to a module under 8250 driver")
---
 drivers/tty/serial/8250/Makefile | 2 ++
 1 file changed, 2 insertions(+)
drivers/tty/serial/8250/Makefile +2 -0
index e61dc3f4ca50..1d6633bbcd70 100644
@@ -24,7 +24,9 @@ obj-$(CONFIG_SERIAL_8250_ASPEED_VUART)	+= 8250_aspeed_vuart.o
 obj-$(CONFIG_SERIAL_8250_BCM2835AUX)	+= 8250_bcm2835aux.o
 obj-$(CONFIG_SERIAL_8250_BCM7271)	+= 8250_bcm7271.o
 obj-$(CONFIG_SERIAL_8250_BOCA)		+= 8250_boca.o
+ifneq ($(CONFIG_SERIAL_8250),)
 obj-$(CONFIG_X86_INTEL_CE)		+= 8250_ce4100.o
+endif
 obj-$(CONFIG_SERIAL_8250_DFL)		+= 8250_dfl.o
 obj-$(CONFIG_SERIAL_8250_DW)		+= 8250_dw.o
 obj-$(CONFIG_SERIAL_8250_EM)		+= 8250_em.o
Signature · 1 line
2.47.2
maintainer
#1 lore raw
Quoted 22 lines · Andy Shevchenko

On i386, when

CONFIG_X86_INTEL_CE=y
# CONFIG_SERIAL_8250 is not set

will try to compile the driver and use the stub simultaneously. This breaks the build. Fix it by making sure that the driver compiles only when CONFIG_SERIAL_8250 is also enabled.

Fixes acc902de05b2 ("serial: 8250: Move CE4100 quirks to a module under 8250 driver")
---
  drivers/tty/serial/8250/Makefile | 2 ++
  1 file changed, 2 insertions(+)
drivers/tty/serial/8250/Makefile +0 -0
index e61dc3f4ca50..1d6633bbcd70 100644

drivers/tty/serial/8250/Makefile obj-$(CONFIG_SERIAL_8250_ASPEED_VUART) += 8250_aspeed_vuart.o · line 27

Quoted 4 lines
drivers/tty/serial/8250/Makefile +1 -0
@@ -24,7 +24,9 @@ obj-$(CONFIG_SERIAL_8250_ASPEED_VUART)	+= 8250_aspeed_vuart.o
  obj-$(CONFIG_SERIAL_8250_BCM2835AUX)	+= 8250_bcm2835aux.o
  obj-$(CONFIG_SERIAL_8250_BCM7271)	+= 8250_bcm7271.o
  obj-$(CONFIG_SERIAL_8250_BOCA)		+= 8250_boca.o
+ifneq ($(CONFIG_SERIAL_8250),)

Why not ifdef CONFIG_SERIAL_8250 then?

Also, what happens if 8250=m and X86_INTEL_CE=y?

Quoted 5 lines
drivers/tty/serial/8250/Makefile +1 -0
  obj-$(CONFIG_X86_INTEL_CE)		+= 8250_ce4100.o
+endif
  obj-$(CONFIG_SERIAL_8250_DFL)		+= 8250_dfl.o
  obj-$(CONFIG_SERIAL_8250_DW)		+= 8250_dw.o
  obj-$(CONFIG_SERIAL_8250_EM)		+= 8250_em.o
Signature · 2 lines
js
suse labs
#2 lore raw
Quoted 9 lines · Jiri Slaby
Quoted 8 lines · Andy Shevchenko

On i386, when

CONFIG_X86_INTEL_CE=y
# CONFIG_SERIAL_8250 is not set

will try to compile the driver and use the stub simultaneously. This breaks the build. Fix it by making sure that the driver compiles only when CONFIG_SERIAL_8250 is also enabled.

...

Quoted 3 lines
Quoted 1 line

+ifneq ($(CONFIG_SERIAL_8250),)

Why not ifdef CONFIG_SERIAL_8250 then?

$ git grep -n '^ifn\?eq .*CONFIG_' | wc -l
427
$ git grep -n '^ifdef CONFIG_' | wc -l
431

Is there a preference in serial drivers?

Quoted 1 line

Also, what happens if 8250=m and X86_INTEL_CE=y?

So, in such a case if somebody wants to use UART, it will go crazy due to missed workaround applied. BUT, this is preexisted issue and not related (directly) to this fix. Perhaps we can combine both with

ifeq ($(CONFIG_SERIAL_8250),y)

and add two Fixes tags.

Quoted 2 lines
Quoted 2 lines

obj-$(CONFIG_X86_INTEL_CE) += 8250_ce4100.o
+endif

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#3 lore raw
Quoted 15 lines · Andy Shevchenko
Quoted 9 lines · Jiri Slaby
Quoted 8 lines · Andy Shevchenko

On i386, when

CONFIG_X86_INTEL_CE=y
# CONFIG_SERIAL_8250 is not set

will try to compile the driver and use the stub simultaneously. This breaks the build. Fix it by making sure that the driver compiles only when CONFIG_SERIAL_8250 is also enabled.

...

Quoted 2 lines
Quoted 1 line

+ifneq ($(CONFIG_SERIAL_8250),)

Quoted 8 lines
Quoted 1 line

Why not ifdef CONFIG_SERIAL_8250 then?

$ git grep -n '^ifn\?eq .*CONFIG_' | wc -l
427
$ git grep -n '^ifdef CONFIG_' | wc -l
431

Is there a preference in serial drivers?

The simpler to read/understand -- the latter.

Quoted 9 lines
Quoted 1 line

Also, what happens if 8250=m and X86_INTEL_CE=y?

So, in such a case if somebody wants to use UART, it will go crazy due to missed workaround applied. BUT, this is preexisted issue and not related (directly) to this fix. Perhaps we can combine both with

ifeq ($(CONFIG_SERIAL_8250),y)

and add two Fixes tags.

+1 makes sense to me. Or introduce a Kconfig entry to handle the deps...

thanks,

Signature · 2 lines
js
suse labs