Skip to contentSkip to conversation

powerpc: dont include 8250 pre-setup if 8250 driver isn't enabled.

PATCH In review Paul Gortmaker 3 participants 3 messages Jan 21, 2012 – Feb 2, 2012 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: dont include 8250 pre-setup if 8250 driver isn't enabled.

The legacy_serial code was setting things up based on the assumption that the main 8250 driver would be loaded shortly after. But some randconfigs exposed an issue where early debug (UDB) UART support was enabled, yet the core UART 8250 support was disabled.

In theory a person could care about _really_ early UART output for early debug, but not care about generic console output via UART on embedded devices, so fix things so it is a valid combination.

While this might seem like a pointless randconfig change, there are some existing default configs that actually reflect the above setup.

arch/powerpc/kernel/legacy_serial.c +9 -0
index 3fea368..9a82a49 100644
@@ -413,6 +413,14 @@ void __init find_legacy_serial_ports(void)
 	DBG(" <- find_legacy_serial_port()\n");
 }
 
+/*
+ * In theory, one could have the early debugging enabled, but yet not care
+ * about 8250 after that, i.e. PPC_UDBG_16550=y but "SERIAL_8250 is not set".
+ * Mostly appears in randconfig builds, but some defconfigs have this.
+ */
+
+#ifdef CONFIG_SERIAL_8250
+
 static struct platform_device serial_device = {
 	.name	= "serial8250",
 	.id	= PLAT8250_DEV_PLATFORM,
@@ -523,6 +531,7 @@ static int __init serial_dev_init(void)
 }
 device_initcall(serial_dev_init);
 
+#endif	/* CONFIG_SERIAL_8250 */
 
 #ifdef CONFIG_SERIAL_8250_CONSOLE
 /*
Signature · 1 line
1.7.7.2
#1 lore raw
Quoted 4 lines · Paul Gortmaker

The legacy_serial code was setting things up based on the assumption that the main 8250 driver would be loaded shortly after. =A0But some randconfigs exposed an issue where early debug (UDB) UART support was enabled, yet the core UART 8250 support was disabled.

Hi Ben,

Can you mark this in patchworks as Superseded? It is at:

http://patchwork.ozlabs.org/patch/137142/

You fixed it independently with this:

http://git.kernel.org/?p=3Dlinux/kernel/git/benh/powerpc.git;a=3Dcommit;h=
=3D3493c85366ba09c9d0972c919e7123367a39982a

Thanks,
Paul.

arch/powerpc/kernel/le=

Quoted 11 lines

In theory a person could care about _really_ early UART output for early debug, but not care about generic console output via UART on embedded devices, so fix things so it is a valid combination.

While this might seem like a pointless randconfig change, there are some existing default configs that actually reflect the above setup.

arch/powerpc/kernel/le= renamed from arch/powerpc/kernel/legacy_serial.c +0 -0

gacy_serial.c

arch/powerpc/kernel/legacy_serial.c void __init find_legacy_serial_ports(void) · line 417

Quoted 9 lines

index 3fea368..9a82a49 100644

arch/powerpc/kernel/legacy_serial.c +2 -0
@@ -413,6 +413,14 @@ void __init find_legacy_serial_ports(void)
 =A0 =A0 =A0 =A0DBG(" <- find_legacy_serial_port()\n");
 =A0}
 
+/*
+ * In theory, one could have the early debugging enabled, but yet not ca=

re

arch/powerpc/kernel/legacy_serial.c void __init find_legacy_serial_ports(void) · line 418

Quoted 1 line
arch/powerpc/kernel/legacy_serial.c +1 -0
+ * about 8250 after that, i.e. PPC_UDBG_16550=3Dy but "SERIAL_8250 is no=

t set".

Quoted 23 lines
arch/powerpc/kernel/legacy_serial.c +6 -0
+ * Mostly appears in randconfig builds, but some defconfigs have this.
+ */
+
+#ifdef CONFIG_SERIAL_8250
+
 =A0static struct platform_device serial_device =3D {
 =A0 =A0 =A0 =A0.name =A0 =3D "serial8250",
 =A0 =A0 =A0 =A0.id =A0 =A0 =3D PLAT8250_DEV_PLATFORM,
@@ -523,6 +531,7 @@ static int __init serial_dev_init(void)
 =A0}
 =A0device_initcall(serial_dev_init);
 
+#endif /* CONFIG_SERIAL_8250 */
 

=A0#ifdef CONFIG_SERIAL_8250_CONSOLE
=A0/*
--
1.7.7.2

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

#2 lore raw
Quoted 9 lines · Paul Gortmaker
Quoted 4 lines · Paul Gortmaker

The legacy_serial code was setting things up based on the assumption that the main 8250 driver would be loaded shortly after. But some randconfigs exposed an issue where early debug (UDB) UART support was enabled, yet the core UART 8250 support was disabled.

Hi Ben,

Quoted 7 lines

Can you mark this in patchworks as Superseded? It is at:

http://patchwork.ozlabs.org/patch/137142/

You fixed it independently with this:

http://git.kernel.org/?p=linux/kernel/git/benh/powerpc.git;a=commit;h=3493c85366ba09c9d0972c919e7123367a39982a

No worries, thanks.

Cheers,
Ben.

Quoted 48 lines

Thanks,
Paul.

Quoted 44 lines

In theory a person could care about _really_ early UART output for early debug, but not care about generic console output via UART on embedded devices, so fix things so it is a valid combination.

While this might seem like a pointless randconfig change, there are some existing default configs that actually reflect the above setup.

arch/powerpc/kernel/legacy_serial.c +9 -1
index 3fea368..9a82a49 100644
@@ -413,6 +413,14 @@ void __init find_legacy_serial_ports(void)
       DBG(" <- find_legacy_serial_port()\n");
 }
 
+/*
+ * In theory, one could have the early debugging enabled, but yet not care
+ * about 8250 after that, i.e. PPC_UDBG_16550=y but "SERIAL_8250 is not set".
+ * Mostly appears in randconfig builds, but some defconfigs have this.
+ */
+
+#ifdef CONFIG_SERIAL_8250
+
 static struct platform_device serial_device = {
       .name   = "serial8250",
       .id     = PLAT8250_DEV_PLATFORM,
@@ -523,6 +531,7 @@ static int __init serial_dev_init(void)
 }
 device_initcall(serial_dev_init);
 
+#endif /* CONFIG_SERIAL_8250 */
 
 #ifdef CONFIG_SERIAL_8250_CONSOLE
 /*
--

1.7.7.2

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev