serial: fix Kconfig for Freescale 16550
Subsystems (2)
PATCH 1/1 serial: fix Kconfig for Freescale 16550
next-20111212 breaks with linking a pmac32_defconfig with:
drivers/built-in.o: In function `fsl8250_handle_irq':
(.text+0x7ba74): undefined reference to serial8250_modem_status' drivers/built-in.o: In function fsl8250_handle_irq':
(.text+0x7baa4): undefined reference to serial8250_tx_chars' drivers/built-in.o: In function fsl8250_handle_irq':
(.text+0x7bab4): undefined reference to `serial8250_rx_chars'
Caused by:
9deaa53 serial: add irq handler for Freescale 16550 errata.
pmac32_defconfig results in SERIAL_8250_FSL=y but SERIAL_8250=m so 8250_fsl.c doesn't link properly.
This explicitly makes SERIAL_8250_FSL depends on SERIAL_8250=y.
---
I'm not sure this is the right fix as it seems like a Kconfig bug.
drivers/tty/serial/Kconfig +1 -1
@@ -99,7 +99,7 @@ config SERIAL_8250_PNP config SERIAL_8250_FSL bool - depends on SERIAL_8250 && PPC + depends on SERIAL_8250=y && PPC default PPC config SERIAL_8250_HP300
Quoted 25 lines · Michael Neuling
next-20111212 breaks with linking a
pmac32_defconfigwith:
drivers/built-in.o: In function `fsl8250_handle_irq':
(.text+0x7ba74): undefined reference toserial8250_modem_status' drivers/built-in.o: In functionfsl8250_handle_irq':
(.text+0x7baa4): undefined reference toserial8250_tx_chars' drivers/built-in.o: In functionfsl8250_handle_irq':
(.text+0x7bab4): undefined reference to `serial8250_rx_chars'Caused by:
9deaa53 serial: add irq handler for Freescale 16550 errata.
pmac32_defconfigresults in SERIAL_8250_FSL=y but SERIAL_8250=m so8250_fsl.cdoesn't link properly.This explicitly makes
SERIAL_8250_FSLdepends on SERIAL_8250=y.Signed-off-by Michael Neuling <[email protected]>---
I'm not sure this is the right fix as it seems like aKconfigbug.drivers/tty/serial/Kconfig +0
-0
drivers/tty/serial/Kconfig config SERIAL_8250_PNP · line 102
Quoted 5 lines
drivers/tty/serial/Kconfig +1
-1@@ -99,7 +99,7 @@ config SERIAL_8250_PNP config SERIAL_8250_FSL bool - depends on SERIAL_8250 && PPC + depends on SERIAL_8250=y && PPC
Then you can't select SERIAL_8250 as a module at all, right? Perhaps you should allow SERIAL_8250_FSL to be a module as well here? So changing the bool to a tristate should be the correct option? Can you try that?
greg k-h
Quoted 27 lines · In message <[email protected]> you wrote:
Quoted 26 lines · Michael Neuling
next-20111212 breaks with linking a
pmac32_defconfigwith:
drivers/built-in.o: In function `fsl8250_handle_irq':
(.text+0x7ba74): undefined reference toserial8250_modem_status' drivers/built-in.o: In functionfsl8250_handle_irq':
(.text+0x7baa4): undefined reference toserial8250_tx_chars' drivers/built-in.o: In functionfsl8250_handle_irq':
(.text+0x7bab4): undefined reference to `serial8250_rx_chars'Caused by:
9deaa53 serial: add irq handler for Freescale 16550 errata.
pmac32_defconfigresults in SERIAL_8250_FSL=y but SERIAL_8250=m so8250_fsl.cdoesn't link properly.This explicitly makes
SERIAL_8250_FSLdepends on SERIAL_8250=y.Signed-off-by Michael Neuling <[email protected]>---
I'm not sure this is the right fix as it seems like aKconfigbug.drivers/tty/serial/Kconfig +0
-0@@ -99,7 +99,7 @@ config SERIAL_8250_PNP
Quoted 6 lines
drivers/tty/serial/Kconfig config SERIAL_8250_PNP · line 102
Quoted 4 lines
drivers/tty/serial/Kconfig +1
-1config SERIAL_8250_FSL bool - depends on SERIAL_8250 && PPC + depends on SERIAL_8250=y && PPCThen you can't select
SERIAL_8250as a module at all, right?
Correct, unless SERIAL_8250_FOL=n of course.
Quoted 3 lines
Perhaps you should allow
SERIAL_8250_FSLto be a module as well here? So changing the bool to a tristate should be the correct option? Can you try that?
Yep, that works also. New patch below.
This should probably be aced by Paul to ensure he's cool with it being a module now.
Mikey
From: Michael Neuling <[email protected]>
serial: fix Kconfig for Freescale 16550
next-20111212 breaks with linking a pmac32_defconfig with:
drivers/built-in.o: In function `fsl8250_handle_irq':
(.text+0x7ba74): undefined reference to serial8250_modem_status' drivers/built-in.o: In function fsl8250_handle_irq':
(.text+0x7baa4): undefined reference to serial8250_tx_chars' drivers/built-in.o: In function fsl8250_handle_irq':
(.text+0x7bab4): undefined reference to `serial8250_rx_chars'
Caused by:
9deaa53 serial: add irq handler for Freescale 16550 errata.
pmac32_defconfig results in SERIAL_8250_FSL=y but SERIAL_8250=m so 8250_fsl.c doesn't link properly for the kernel.
This makes SERIAL_8250_FSL tristate.
drivers/tty/serial/Kconfig +1 -1
@@ -98,7 +98,7 @@ config SERIAL_8250_PNP disable this feature if you only need legacy serial support. config SERIAL_8250_FSL - bool + tristate depends on SERIAL_8250 && PPC default PPC
Quoted 1 line · [Re: [PATCH] serial: fix Kconfig for Freescale 16550] On 13/12/2011 (Tue…
In message <[email protected]> you wrote:
[...]
Quoted 4 lines
Quoted 1 line
Then you can't select
SERIAL_8250as a module at all, right?Correct, unless SERIAL_8250_FOL=n of course.
Quoted 8 lines
Quoted 3 lines
Perhaps you should allow
SERIAL_8250_FSLto be a module as well here? So changing the bool to a tristate should be the correct option? Can you try that?Yep, that works also. New patch below.
This should probably be aced by Paul to ensure he's cool with it being a module now.
This will still be broken, but in a different place and for different boards. [The legacy_serial.c won't link for 8250=m on FSL boards.]
I think your original fix was closer to the right one. Let me expand
on that. This thing isn't a real stand alone driver. It is an errata
fix that is specific to Freescale boards, and only is relevant in fixing
magic SysRQ functionality on the serial console. The Freescale boards
are almost exclusively headless, with a serial console interface to u-boot as the only way to do initial interaction with the board at bootup. So having serial as a module on these boards is largely academic. (But if you want modular serial, you still can, and you dont need the errata fix for that.)
So, with all that in mind, I think this is the right fix. I'll launch some build coverage against it, but it seems straightforward. Thanks for the report, and sorry for catching pmac in the fallout.
Paul.
---
From 675520f2d175bd71bf857b75a5a9b5a08ee0ee54 Mon Sep 17 00:00:00 2001
From: Paul Gortmaker <[email protected]>
Date: Mon, 12 Dec 2011 21:18:15 -0500
Subject: [PATCH] serial: make FSL errata depend on 8250_CONSOLE, not just
8250
The recent commit "serial: add irq handler for Freescale 16550 errata" would allow Kconfig choices that had 8250 support as a module and yet still try and build in the errata fix non-modular, resulting in build failures for some non-embedded PPC targets.
Since we hook in the errata fix from legacy_serial.c, which is built only for PPC_UDBG_16550, and since the errata is only really relevant for SysRQ on serial console, tighten up the dependencies to be exactly that.
We'll get coverage on the relevant Freescale boards because the Kconfig for their CPU types all select the PPC_UDBG_16550 option, and the defconfigs also all select the 8250_CONSOLE option. Also, the 8250_CONSOLE option has a strict dependency on "SERIAL_8250=y" which resolves the reported problem for non Freescale targets.
drivers/tty/serial/Kconfig +1 -1
@@ -99,7 +99,7 @@ config SERIAL_8250_PNP config SERIAL_8250_FSL bool - depends on SERIAL_8250 && PPC + depends on SERIAL_8250_CONSOLE && PPC_UDBG_16550 default PPC config SERIAL_8250_HP300
Signature · 1 line
1.7.7
Michael Neuling
Tested-byQuoted 1 line · In message <[email protected]> you wrote:
[Re: [PATCH] serial: fix
Kconfigfor Freescale 16550] On 13/12/2011 (Tue 12:5
Quoted 54 lines · 3) Michael Neuling wrote:
Quoted 2 lines
In message <[email protected]> you wrote:
[...]
Quoted 4 lines
Quoted 1 line
Then you can't select
SERIAL_8250as a module at all, right?Correct, unless SERIAL_8250_FOL=n of course.
Quoted 8 lines
Quoted 3 lines
Perhaps you should allow
SERIAL_8250_FSLto be a module as well here? So changing the bool to a tristate should be the correct option? Can you try that?Yep, that works also. New patch below.
This should probably be aced by Paul to ensure he's cool with it being a module now.
This will still be broken, but in a different place and for different boards. [The
legacy_serial.cwon't link for 8250=m on FSL boards.]I think your original fix was closer to the right one. Let me expand
on that. This thing isn't a real stand alone driver. It is an errata
fix that is specific to Freescale boards, and only is relevant in fixing
magic SysRQ functionality on the serial console. The Freescale boards
are almost exclusively headless, with a serial console interface to u-boot as the only way to do initial interaction with the board at bootup. So having serial as a module on these boards is largely academic. (But if you want modular serial, you still can, and you dont need the errata fix for that.)So, with all that in mind, I think this is the right fix. I'll launch some build coverage against it, but it seems straightforward. Thanks for the report, and sorry for catching pmac in the fallout.
Paul.
---From
675520f2d175bd71bf857b75a5a9b5a08ee0ee54Mon Sep 17 00:00:00 2001
From: Paul Gortmaker <[email protected]>
Date: Mon, 12 Dec 2011 21:18:15 -0500
Subject: [PATCH] serial: make FSL errata depend on 8250_CONSOLE, not just
8250The recent commit "serial: add irq handler for Freescale 16550 errata" would allow
Kconfigchoices that had 8250 support as a module and yet still try and build in the errata fix non-modular, resulting in build failures for some non-embedded PPC targets.Since we hook in the errata fix from
legacy_serial.c, which is built only forPPC_UDBG_16550, and since the errata is only really relevant for SysRQ on serial console, tighten up the dependencies to be exactly that.
Quoted 8 lines
We'll get coverage on the relevant Freescale boards because the
Kconfigfor their CPU types all select thePPC_UDBG_16550option, and the defconfigs also all select the 8250_CONSOLE option. Also, the 8250_CONSOLE option has a strict dependency on "SERIAL_8250=y" which resolves the reported problem for non Freescale targets.Reported-by Michael Neuling <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
Works here for me (although it still seems like a Kconfig bug).
Quoted 17 lines
drivers/tty/serial/Kconfig +1
-1@@ -99,7 +99,7 @@ config SERIAL_8250_PNP config SERIAL_8250_FSL bool - depends on SERIAL_8250 && PPC + depends on SERIAL_8250_CONSOLE && PPC_UDBG_16550 default PPC config SERIAL_8250_HP300Signature · 1 line
1.7.7