Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 1/2] serial: imx: Remove SERIAL_IMX_CONSOLE
@ 2013-06-04 17:08 Fabio Estevam
  2013-06-04 17:08 ` [PATCH v2 2/2] serial: imx: Allow module build Fabio Estevam
  0 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2013-06-04 17:08 UTC (permalink / raw)
  To: gregkh; +Cc: shawn.guo, b35083, kernel, linux-serial, Fabio Estevam

When CONFIG_SERIAL_IMX_CONSOLE is not selected the following build warnings
appear:

drivers/tty/serial/imx.c:274:13: warning: 'imx_port_ucrs_save' defined but not used [-Wunused-function]
drivers/tty/serial/imx.c:283:13: warning: 'imx_port_ucrs_restore' defined but not used [-Wunused-function]

Instead of fixing the warning by protecting mx_port_ucrs_save() and 
imx_port_ucrs_restore() with an "ifdef", let's get rid of the SERIAL_IMX_CONSOLE
option and make the console support always present.

While at it, change the CPU vendor name to Freescale. 

Suggested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Fix the warning by removing SERIAL_IMX_CONSOLE

 drivers/tty/serial/Kconfig | 18 ++----------------
 drivers/tty/serial/imx.c   | 10 ++--------
 2 files changed, 4 insertions(+), 24 deletions(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 7e7006f..a9ae1cd 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -554,26 +554,12 @@ config SERIAL_IMX
 	bool "IMX serial port support"
 	depends on ARCH_MXC
 	select SERIAL_CORE
+	select SERIAL_CORE_CONSOLE
 	select RATIONAL
 	help
-	  If you have a machine based on a Motorola IMX CPU you
+	  If you have a machine based on a Freescale IMX CPU you
 	  can enable its onboard serial port by enabling this option.
 
-config SERIAL_IMX_CONSOLE
-	bool "Console on IMX serial port"
-	depends on SERIAL_IMX
-	select SERIAL_CORE_CONSOLE
-	help
-	  If you have enabled the serial port on the Motorola IMX
-	  CPU you can make it the console by answering Y to this option.
-
-	  Even if you say Y here, the currently visible virtual console
-	  (/dev/tty0) will still be used as the system console by default, but
-	  you can alter that using a kernel command line option such as
-	  "console=ttySA0". (Try "man bootparam" or see the documentation of
-	  your boot loader (lilo or loadlin) about how to pass options to the
-	  kernel at boot time.)
-
 config SERIAL_UARTLITE
 	tristate "Xilinx uartlite serial port support"
 	depends on PPC32 || MICROBLAZE || MFD_TIMBERDALE
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index a07e94f..d0fcd5e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -27,7 +27,7 @@
  * Added hardware handshake
  */
 
-#if defined(CONFIG_SERIAL_IMX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+#if defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
 #endif
 
@@ -1211,7 +1211,6 @@ static struct uart_ops imx_pops = {
 
 static struct imx_port *imx_ports[UART_NR];
 
-#ifdef CONFIG_SERIAL_IMX_CONSOLE
 static void imx_console_putchar(struct uart_port *port, int ch)
 {
 	struct imx_port *sport = (struct imx_port *)port;
@@ -1374,11 +1373,6 @@ static struct console imx_console = {
 	.data		= &imx_reg,
 };
 
-#define IMX_CONSOLE	&imx_console
-#else
-#define IMX_CONSOLE	NULL
-#endif
-
 static struct uart_driver imx_reg = {
 	.owner          = THIS_MODULE,
 	.driver_name    = DRIVER_NAME,
@@ -1386,7 +1380,7 @@ static struct uart_driver imx_reg = {
 	.major          = SERIAL_IMX_MAJOR,
 	.minor          = MINOR_START,
 	.nr             = ARRAY_SIZE(imx_ports),
-	.cons           = IMX_CONSOLE,
+	.cons           = &imx_console,
 };
 
 static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] serial: imx: Allow module build
  2013-06-04 17:08 [PATCH v2 1/2] serial: imx: Remove SERIAL_IMX_CONSOLE Fabio Estevam
@ 2013-06-04 17:08 ` Fabio Estevam
  2013-06-05  1:36   ` Lu Jingchang-B35083
  0 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2013-06-04 17:08 UTC (permalink / raw)
  To: gregkh; +Cc: shawn.guo, b35083, kernel, linux-serial, Fabio Estevam

There is no need to only allow the serial driver to be built-in.

Allow the imx serial driver to be build as a module.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- None
 drivers/tty/serial/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index a9ae1cd..28cffda 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -551,7 +551,7 @@ config BFIN_UART3_CTSRTS
 	  Enable hardware flow control in the driver.
 
 config SERIAL_IMX
-	bool "IMX serial port support"
+	tristate "IMX serial port support"
 	depends on ARCH_MXC
 	select SERIAL_CORE
 	select SERIAL_CORE_CONSOLE
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [PATCH v2 2/2] serial: imx: Allow module build
  2013-06-04 17:08 ` [PATCH v2 2/2] serial: imx: Allow module build Fabio Estevam
@ 2013-06-05  1:36   ` Lu Jingchang-B35083
  2013-06-05  1:47     ` Estevam Fabio-R49496
  0 siblings, 1 reply; 6+ messages in thread
From: Lu Jingchang-B35083 @ 2013-06-05  1:36 UTC (permalink / raw)
  To: Estevam Fabio-R49496, gregkh@linuxfoundation.org
  Cc: shawn.guo@linaro.org, kernel@pengutronix.de,
	linux-serial@vger.kernel.org



>-----Original Message-----
>From: Estevam Fabio-R49496
>Sent: Wednesday, June 05, 2013 1:09 AM
>To: gregkh@linuxfoundation.org
>Cc: shawn.guo@linaro.org; Lu Jingchang-B35083; kernel@pengutronix.de;
>linux-serial@vger.kernel.org; Estevam Fabio-R49496
>Subject: [PATCH v2 2/2] serial: imx: Allow module build
>
>There is no need to only allow the serial driver to be built-in.
>
>Allow the imx serial driver to be build as a module.
>
>Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>---
>Changes since v1:
>- None
> drivers/tty/serial/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index
>a9ae1cd..28cffda 100644
>--- a/drivers/tty/serial/Kconfig
>+++ b/drivers/tty/serial/Kconfig
>@@ -551,7 +551,7 @@ config BFIN_UART3_CTSRTS
> 	  Enable hardware flow control in the driver.
>
> config SERIAL_IMX
>-	bool "IMX serial port support"
>+	tristate "IMX serial port support"
> 	depends on ARCH_MXC
> 	select SERIAL_CORE
> 	select SERIAL_CORE_CONSOLE
>--
[Lu Jingchang-B35083] 
With the two patches, when configure the imx serial driver as a module, I fail to build it with following error message:

ERROR: "uart_console_device" [drivers/tty/serial/imx.ko] undefined!
make[1]: *** [__modpost] Error 1

Best regards,
Jingchang


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH v2 2/2] serial: imx: Allow module build
  2013-06-05  1:36   ` Lu Jingchang-B35083
@ 2013-06-05  1:47     ` Estevam Fabio-R49496
  2013-06-05  2:33       ` Lu Jingchang-B35083
  0 siblings, 1 reply; 6+ messages in thread
From: Estevam Fabio-R49496 @ 2013-06-05  1:47 UTC (permalink / raw)
  To: Lu Jingchang-B35083, gregkh@linuxfoundation.org
  Cc: shawn.guo@linaro.org, kernel@pengutronix.de,
	linux-serial@vger.kernel.org, festevam@gmail.com

Hi Lu,

[Sorry for top-posting. I only have email access from browser now].

Building as module does work for me.

Please do a 'make clean' and then try again.

Regards,

Fabio Estevam
________________________________________
From: Lu Jingchang-B35083
Sent: Tuesday, June 04, 2013 8:36 PM
To: Estevam Fabio-R49496; gregkh@linuxfoundation.org
Cc: shawn.guo@linaro.org; kernel@pengutronix.de; linux-serial@vger.kernel.org
Subject: RE: [PATCH v2 2/2] serial: imx: Allow module build

>-----Original Message-----
>From: Estevam Fabio-R49496
>Sent: Wednesday, June 05, 2013 1:09 AM
>To: gregkh@linuxfoundation.org
>Cc: shawn.guo@linaro.org; Lu Jingchang-B35083; kernel@pengutronix.de;
>linux-serial@vger.kernel.org; Estevam Fabio-R49496
>Subject: [PATCH v2 2/2] serial: imx: Allow module build
>
>There is no need to only allow the serial driver to be built-in.
>
>Allow the imx serial driver to be build as a module.
>
>Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>---
>Changes since v1:
>- None
> drivers/tty/serial/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index
>a9ae1cd..28cffda 100644
>--- a/drivers/tty/serial/Kconfig
>+++ b/drivers/tty/serial/Kconfig
>@@ -551,7 +551,7 @@ config BFIN_UART3_CTSRTS
>         Enable hardware flow control in the driver.
>
> config SERIAL_IMX
>-      bool "IMX serial port support"
>+      tristate "IMX serial port support"
>       depends on ARCH_MXC
>       select SERIAL_CORE
>       select SERIAL_CORE_CONSOLE
>--
[Lu Jingchang-B35083]
With the two patches, when configure the imx serial driver as a module, I fail to build it with following error message:

ERROR: "uart_console_device" [drivers/tty/serial/imx.ko] undefined!
make[1]: *** [__modpost] Error 1

Best regards,
Jingchang


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH v2 2/2] serial: imx: Allow module build
  2013-06-05  1:47     ` Estevam Fabio-R49496
@ 2013-06-05  2:33       ` Lu Jingchang-B35083
  2013-06-05  2:44         ` Fabio Estevam
  0 siblings, 1 reply; 6+ messages in thread
From: Lu Jingchang-B35083 @ 2013-06-05  2:33 UTC (permalink / raw)
  To: Estevam Fabio-R49496, gregkh@linuxfoundation.org
  Cc: shawn.guo@linaro.org, kernel@pengutronix.de,
	linux-serial@vger.kernel.org, festevam@gmail.com



>-----Original Message-----
>From: Estevam Fabio-R49496
>Sent: Wednesday, June 05, 2013 9:47 AM
>To: Lu Jingchang-B35083; gregkh@linuxfoundation.org
>Cc: shawn.guo@linaro.org; kernel@pengutronix.de; linux-
>serial@vger.kernel.org; festevam@gmail.com
>Subject: RE: [PATCH v2 2/2] serial: imx: Allow module build
>
>Hi Lu,
>
>[Sorry for top-posting. I only have email access from browser now].
>
>Building as module does work for me.
>
>Please do a 'make clean' and then try again.
>
>
[Lu Jingchang-B35083] 
With make arch=ARM clean, I still meet the same fail problem. Does the driver support console when built as module?
If it does, I see that "uart_console_device" referenced by imx.c is not exported with EXPORT_SYMBOL in serial core.
>From the patch, I think the drive support console when built as module, doesn't it?
But explanation from Arnd Bergmann [arnd@arndb.de] yesterday is: "All serial port drivers do this. IIRC the reason is that the console has to be started from console_initcall(), which is not available in modules."
It seems serial driver module mode doesn't support console support, do I misunderstand? 
Thanks!


Best regards,
Jingchang
________________________________________
>From: Lu Jingchang-B35083
>Sent: Tuesday, June 04, 2013 8:36 PM
>To: Estevam Fabio-R49496; gregkh@linuxfoundation.org
>Cc: shawn.guo@linaro.org; kernel@pengutronix.de; linux-
>serial@vger.kernel.org
>Subject: RE: [PATCH v2 2/2] serial: imx: Allow module build
>
>>-----Original Message-----
>>From: Estevam Fabio-R49496
>>Sent: Wednesday, June 05, 2013 1:09 AM
>>To: gregkh@linuxfoundation.org
>>Cc: shawn.guo@linaro.org; Lu Jingchang-B35083; kernel@pengutronix.de;
>>linux-serial@vger.kernel.org; Estevam Fabio-R49496
>>Subject: [PATCH v2 2/2] serial: imx: Allow module build
>>
>>There is no need to only allow the serial driver to be built-in.
>>
>>Allow the imx serial driver to be build as a module.
>>
>>Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>>---
>>Changes since v1:
>>- None
>> drivers/tty/serial/Kconfig | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
>>index a9ae1cd..28cffda 100644
>>--- a/drivers/tty/serial/Kconfig
>>+++ b/drivers/tty/serial/Kconfig
>>@@ -551,7 +551,7 @@ config BFIN_UART3_CTSRTS
>>         Enable hardware flow control in the driver.
>>
>> config SERIAL_IMX
>>-      bool "IMX serial port support"
>>+      tristate "IMX serial port support"
>>       depends on ARCH_MXC
>>       select SERIAL_CORE
>>       select SERIAL_CORE_CONSOLE
>>--
>[Lu Jingchang-B35083]
>With the two patches, when configure the imx serial driver as a module, I
>fail to build it with following error message:
>
>ERROR: "uart_console_device" [drivers/tty/serial/imx.ko] undefined!
>make[1]: *** [__modpost] Error 1
>
>Best regards,
>Jingchang


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] serial: imx: Allow module build
  2013-06-05  2:33       ` Lu Jingchang-B35083
@ 2013-06-05  2:44         ` Fabio Estevam
  0 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2013-06-05  2:44 UTC (permalink / raw)
  To: Lu Jingchang-B35083
  Cc: Estevam Fabio-R49496, gregkh@linuxfoundation.org,
	shawn.guo@linaro.org, kernel@pengutronix.de,
	linux-serial@vger.kernel.org

On Tue, Jun 4, 2013 at 11:33 PM, Lu Jingchang-B35083
<B35083@freescale.com> wrote:

> [Lu Jingchang-B35083]
> With make arch=ARM clean, I still meet the same fail problem. Does the driver support console when built as module?
> If it does, I see that "uart_console_device" referenced by imx.c is not exported with EXPORT_SYMBOL in serial core.
> From the patch, I think the drive support console when built as module, doesn't it?
> But explanation from Arnd Bergmann [arnd@arndb.de] yesterday is: "All serial port drivers do this. IIRC the reason is that the console has to be started from console_initcall(), which is not available in modules."
> It seems serial driver module mode doesn't support console support, do I misunderstand?

Yes, correct. Looks like your last patch is the correct approach. I
will send a v3.

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-05  2:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04 17:08 [PATCH v2 1/2] serial: imx: Remove SERIAL_IMX_CONSOLE Fabio Estevam
2013-06-04 17:08 ` [PATCH v2 2/2] serial: imx: Allow module build Fabio Estevam
2013-06-05  1:36   ` Lu Jingchang-B35083
2013-06-05  1:47     ` Estevam Fabio-R49496
2013-06-05  2:33       ` Lu Jingchang-B35083
2013-06-05  2:44         ` Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox