All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] allow alternative name for PXA serial console
@ 2013-03-12 23:02 Sergey Yanovich
  2013-03-12 23:10 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 9+ messages in thread
From: Sergey Yanovich @ 2013-03-12 23:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Sergey Yanovich, Jiri Slaby, linux-serial, linux-kernel

ICP DAS LP-8x4x is an industrial data acquision device. It is based
on PXA270 CPU. The board containsi a lot of (up to 36) standard UARTi
8250i serial ports. System console on the board is provided with
an on-chip PXA serial port. Both modules use /dev/ttyS0 by default.

To solve the collision, PXA ports could be configured with different
name and device numbers.

Signed-off-by: Sergey Yanovich <ynvich@gmail.com>
---
 drivers/tty/serial/Kconfig |   14 ++++++++++++++
 drivers/tty/serial/pxa.c   |   22 ++++++++++++++++++----
 2 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 59c23d0..09cf980 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -406,6 +406,20 @@ config SERIAL_PXA_CONSOLE
 	  your boot loader (lilo or loadlin) about how to pass options to the
 	  kernel at boot time.)
 
+config SERIAL_PXA_TTYSA_NAME
+	bool "as /dev/ttySA[0-3]"
+	depends on SERIAL_PXA
+	default N
+	help
+	  If you have enabled the serial port on the Intel XScale PXA
+	  CPU you can make it appear as /dev/ttySA[0-3] in the system.
+
+	  If you say N here (default), the ports will use UART /dev/ttyS[0-3]
+	  names and corresponding major and minor devices numbers.
+
+	  If you say Y here, the ports will have SA-1100 style names and
+	  numbers. It is reqired at least for one PXA based device.
+
 config SERIAL_SA1100
 	bool "SA1100 serial port support"
 	depends on ARCH_SA1100
diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 2764828..a7e5e40 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -619,6 +619,20 @@ serial_pxa_type(struct uart_port *port)
 static struct uart_pxa_port *serial_pxa_ports[4];
 static struct uart_driver serial_pxa_reg;
 
+#ifndef CONFIG_SERIAL_PXA_TTYSA_NAME
+
+#define PXA_TTY_NAME	"ttyS"
+#define PXA_TTY_MAJOR	TTY_MAJOR
+#define PXA_TTY_MINOR	64
+
+#else
+
+#define PXA_TTY_NAME	"ttySA"
+#define PXA_TTY_MAJOR	204
+#define PXA_TTY_MINOR	5
+
+#endif
+
 #ifdef CONFIG_SERIAL_PXA_CONSOLE
 
 #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
@@ -778,7 +792,7 @@ serial_pxa_console_setup(struct console *co, char *options)
 }
 
 static struct console serial_pxa_console = {
-	.name		= "ttyS",
+	.name		= PXA_TTY_NAME,
 	.write		= serial_pxa_console_write,
 	.device		= uart_console_device,
 	.setup		= serial_pxa_console_setup,
@@ -819,9 +833,9 @@ struct uart_ops serial_pxa_pops = {
 static struct uart_driver serial_pxa_reg = {
 	.owner		= THIS_MODULE,
 	.driver_name	= "PXA serial",
-	.dev_name	= "ttyS",
-	.major		= TTY_MAJOR,
-	.minor		= 64,
+	.dev_name	= PXA_TTY_NAME
+	.major		= PXA_TTY_MAJOR,
+	.minor		= PXA_TTY_MINOR,
 	.nr		= 4,
 	.cons		= PXA_CONSOLE,
 };
-- 
1.7.10.4


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

* Re: [PATCH] allow alternative name for PXA serial console
  2013-03-12 23:02 [PATCH] allow alternative name for PXA serial console Sergey Yanovich
@ 2013-03-12 23:10 ` Greg Kroah-Hartman
  2013-03-12 23:34   ` Сергей Янович
  0 siblings, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2013-03-12 23:10 UTC (permalink / raw)
  To: Sergey Yanovich; +Cc: Jiri Slaby, linux-serial, linux-kernel

On Wed, Mar 13, 2013 at 03:02:22AM +0400, Sergey Yanovich wrote:
> ICP DAS LP-8x4x is an industrial data acquision device. It is based
> on PXA270 CPU. The board containsi a lot of (up to 36) standard UARTi
> 8250i serial ports. System console on the board is provided with
> an on-chip PXA serial port. Both modules use /dev/ttyS0 by default.
> 
> To solve the collision, PXA ports could be configured with different
> name and device numbers.
> 
> Signed-off-by: Sergey Yanovich <ynvich@gmail.com>
> ---
>  drivers/tty/serial/Kconfig |   14 ++++++++++++++
>  drivers/tty/serial/pxa.c   |   22 ++++++++++++++++++----
>  2 files changed, 32 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 59c23d0..09cf980 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -406,6 +406,20 @@ config SERIAL_PXA_CONSOLE
>  	  your boot loader (lilo or loadlin) about how to pass options to the
>  	  kernel at boot time.)
>  
> +config SERIAL_PXA_TTYSA_NAME
> +	bool "as /dev/ttySA[0-3]"

Does that config text really make sense?  What does it look like when
you run "make oldconfig"?

> +	depends on SERIAL_PXA
> +	default N
> +	help
> +	  If you have enabled the serial port on the Intel XScale PXA
> +	  CPU you can make it appear as /dev/ttySA[0-3] in the system.
> +
> +	  If you say N here (default), the ports will use UART /dev/ttyS[0-3]
> +	  names and corresponding major and minor devices numbers.
> +
> +	  If you say Y here, the ports will have SA-1100 style names and
> +	  numbers. It is reqired at least for one PXA based device.

Ugh, why does it matter what it is named?

Use udev, or a tool like it, to rename serial ports if you really need
it, don't do this in the kernel please.

thanks,

greg k-h

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

* Re: [PATCH] allow alternative name for PXA serial console
  2013-03-12 23:10 ` Greg Kroah-Hartman
@ 2013-03-12 23:34   ` Сергей Янович
  2013-03-12 23:39       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 9+ messages in thread
From: Сергей Янович @ 2013-03-12 23:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-serial, linux-kernel

On 13 March 2013 03:10, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> On Wed, Mar 13, 2013 at 03:02:22AM +0400, Sergey Yanovich wrote:
>> +config SERIAL_PXA_TTYSA_NAME
>> +     bool "as /dev/ttySA[0-3]"
>
> Does that config text really make sense?  What does it look like when
> you run "make oldconfig"?

--------------------
* Non-8250 serial port support
*
PXA serial port support (SERIAL_PXA) [Y/n/?] y
  Console on PXA serial port (SERIAL_PXA_CONSOLE) [Y/n/?] y
  as /dev/ttySA[0-3] (SERIAL_PXA_TTYSA_NAME) [N/y/?] (NEW)
---------------------

So the kernel will have PXA serial port, a console on it, and it will
have a name (and numbers) /dev/ttySA0 to /dev/ttySA3.

>> ICP DAS LP-8x4x is an industrial data acquision device. It is based
>> on PXA270 CPU. The board containsi a lot of (up to 36) standard UARTi
>> 8250i serial ports. System console on the board is provided with
>> an on-chip PXA serial port. Both modules use /dev/ttyS0 by default.
>>
>> To solve the collision, PXA ports could be configured with different
>> name and device numbers.

> Ugh, why does it matter what it is named?
>
> Use udev, or a tool like it, to rename serial ports if you really need
> it, don't do this in the kernel please.

It doesn't matter what it is named. It matters that both drivers try
to use the same major device number. I have to change major device
number for PXA tty, as a result I need a different name in /dev

Maybe I am missing something obvious, but it seems that such a
collision is a kernel bug. Someone assumed that PXA cannot have a 8250
tty device and used 8250's parameters in PXA tty driver.

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

* Re: [PATCH] allow alternative name for PXA serial console
  2013-03-12 23:34   ` Сергей Янович
@ 2013-03-12 23:39       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2013-03-12 23:39 UTC (permalink / raw)
  To: Сергей
	Янович
  Cc: Jiri Slaby, linux-serial, linux-kernel

On Wed, Mar 13, 2013 at 03:34:59AM +0400, Сергей Янович wrote:
> On 13 March 2013 03:10, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > On Wed, Mar 13, 2013 at 03:02:22AM +0400, Sergey Yanovich wrote:
> >> +config SERIAL_PXA_TTYSA_NAME
> >> +     bool "as /dev/ttySA[0-3]"
> >
> > Does that config text really make sense?  What does it look like when
> > you run "make oldconfig"?
> 
> --------------------
> * Non-8250 serial port support
> *
> PXA serial port support (SERIAL_PXA) [Y/n/?] y
>   Console on PXA serial port (SERIAL_PXA_CONSOLE) [Y/n/?] y
>   as /dev/ttySA[0-3] (SERIAL_PXA_TTYSA_NAME) [N/y/?] (NEW)

Please make it sane for the single line it is on.

> So the kernel will have PXA serial port, a console on it, and it will
> have a name (and numbers) /dev/ttySA0 to /dev/ttySA3.
> 
> >> ICP DAS LP-8x4x is an industrial data acquision device. It is based
> >> on PXA270 CPU. The board containsi a lot of (up to 36) standard UARTi
> >> 8250i serial ports. System console on the board is provided with
> >> an on-chip PXA serial port. Both modules use /dev/ttyS0 by default.
> >>
> >> To solve the collision, PXA ports could be configured with different
> >> name and device numbers.
> 
> > Ugh, why does it matter what it is named?
> >
> > Use udev, or a tool like it, to rename serial ports if you really need
> > it, don't do this in the kernel please.
> 
> It doesn't matter what it is named. It matters that both drivers try
> to use the same major device number. I have to change major device
> number for PXA tty, as a result I need a different name in /dev
> 
> Maybe I am missing something obvious, but it seems that such a
> collision is a kernel bug. Someone assumed that PXA cannot have a 8250
> tty device and used 8250's parameters in PXA tty driver.

Yes, someone must have messed up, so care to find the root problem here?

thanks,

greg k-h

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

* Re: [PATCH] allow alternative name for PXA serial console
@ 2013-03-12 23:39       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2013-03-12 23:39 UTC (permalink / raw)
  To: Сергей
	Янович
  Cc: Jiri Slaby, linux-serial, linux-kernel

On Wed, Mar 13, 2013 at 03:34:59AM +0400, Сергей Янович wrote:
> On 13 March 2013 03:10, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > On Wed, Mar 13, 2013 at 03:02:22AM +0400, Sergey Yanovich wrote:
> >> +config SERIAL_PXA_TTYSA_NAME
> >> +     bool "as /dev/ttySA[0-3]"
> >
> > Does that config text really make sense?  What does it look like when
> > you run "make oldconfig"?
> 
> --------------------
> * Non-8250 serial port support
> *
> PXA serial port support (SERIAL_PXA) [Y/n/?] y
>   Console on PXA serial port (SERIAL_PXA_CONSOLE) [Y/n/?] y
>   as /dev/ttySA[0-3] (SERIAL_PXA_TTYSA_NAME) [N/y/?] (NEW)

Please make it sane for the single line it is on.

> So the kernel will have PXA serial port, a console on it, and it will
> have a name (and numbers) /dev/ttySA0 to /dev/ttySA3.
> 
> >> ICP DAS LP-8x4x is an industrial data acquision device. It is based
> >> on PXA270 CPU. The board containsi a lot of (up to 36) standard UARTi
> >> 8250i serial ports. System console on the board is provided with
> >> an on-chip PXA serial port. Both modules use /dev/ttyS0 by default.
> >>
> >> To solve the collision, PXA ports could be configured with different
> >> name and device numbers.
> 
> > Ugh, why does it matter what it is named?
> >
> > Use udev, or a tool like it, to rename serial ports if you really need
> > it, don't do this in the kernel please.
> 
> It doesn't matter what it is named. It matters that both drivers try
> to use the same major device number. I have to change major device
> number for PXA tty, as a result I need a different name in /dev
> 
> Maybe I am missing something obvious, but it seems that such a
> collision is a kernel bug. Someone assumed that PXA cannot have a 8250
> tty device and used 8250's parameters in PXA tty driver.

Yes, someone must have messed up, so care to find the root problem here?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] allow alternative name for PXA serial console
  2013-03-12 23:39       ` Greg Kroah-Hartman
@ 2013-03-13  0:03         ` Сергей Янович
  -1 siblings, 0 replies; 9+ messages in thread
From: Сергей Янович @ 2013-03-13  0:03 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-serial, linux-kernel

On 13 March 2013 03:39, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> On Wed, Mar 13, 2013 at 03:34:59AM +0400, Сергей Янович wrote:
>> --------------------
>> * Non-8250 serial port support
>> *
>> PXA serial port support (SERIAL_PXA) [Y/n/?] y
>>   Console on PXA serial port (SERIAL_PXA_CONSOLE) [Y/n/?] y
>>   as /dev/ttySA[0-3] (SERIAL_PXA_TTYSA_NAME) [N/y/?] (NEW)
>
> Please make it sane for the single line it is on.

"PXA serial port with SA-1100 major"
"PXA serial port with SA-1100 major number"
"PXA serial port with SA-1100 major device number"

Could anything like that be acceptable?

How long a line could be?

>> Maybe I am missing something obvious, but it seems that such a
>> collision is a kernel bug. Someone assumed that PXA cannot have a 8250
>> tty device and used 8250's parameters in PXA tty driver.
>
> Yes, someone must have messed up, so care to find the root problem here?

Two drivers try to use the same resource. It was in pre-git era, so it
difficult to find out exactly. I would guess that that 8250 have
precedence by at least 5 years. But it is almost guaranteed that lots
of people depend on PXA console having ttyS0 name. So simple
s/ttyS/ttySA/ is not a solution. My patch preserves status quo by
default, but allows to have a correct workaround for those who face a
collision. By correct I mean that it will not create a new collision
since a system cannot run on both SA-1100 and PXA270 at the same time.
This assumption is already documented in
arch/arm/mach-pxa/include/mach/irqs.h line 94.

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

* Re: [PATCH] allow alternative name for PXA serial console
@ 2013-03-13  0:03         ` Сергей Янович
  0 siblings, 0 replies; 9+ messages in thread
From: Сергей Янович @ 2013-03-13  0:03 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-serial, linux-kernel

On 13 March 2013 03:39, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> On Wed, Mar 13, 2013 at 03:34:59AM +0400, Сергей Янович wrote:
>> --------------------
>> * Non-8250 serial port support
>> *
>> PXA serial port support (SERIAL_PXA) [Y/n/?] y
>>   Console on PXA serial port (SERIAL_PXA_CONSOLE) [Y/n/?] y
>>   as /dev/ttySA[0-3] (SERIAL_PXA_TTYSA_NAME) [N/y/?] (NEW)
>
> Please make it sane for the single line it is on.

"PXA serial port with SA-1100 major"
"PXA serial port with SA-1100 major number"
"PXA serial port with SA-1100 major device number"

Could anything like that be acceptable?

How long a line could be?

>> Maybe I am missing something obvious, but it seems that such a
>> collision is a kernel bug. Someone assumed that PXA cannot have a 8250
>> tty device and used 8250's parameters in PXA tty driver.
>
> Yes, someone must have messed up, so care to find the root problem here?

Two drivers try to use the same resource. It was in pre-git era, so it
difficult to find out exactly. I would guess that that 8250 have
precedence by at least 5 years. But it is almost guaranteed that lots
of people depend on PXA console having ttyS0 name. So simple
s/ttyS/ttySA/ is not a solution. My patch preserves status quo by
default, but allows to have a correct workaround for those who face a
collision. By correct I mean that it will not create a new collision
since a system cannot run on both SA-1100 and PXA270 at the same time.
This assumption is already documented in
arch/arm/mach-pxa/include/mach/irqs.h line 94.
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] allow alternative name for PXA serial console
  2013-03-13  0:03         ` Сергей Янович
@ 2013-11-22 14:46           ` Sergei Ianovich
  -1 siblings, 0 replies; 9+ messages in thread
From: Sergei Ianovich @ 2013-11-22 14:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-serial, linux-kernel

On 13 March 2013 04:03, Сергей Янович <ynvich@gmail.com> wrote:
> On 13 March 2013 03:39, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>> On Wed, Mar 13, 2013 at 03:34:59AM +0400, Сергей Янович wrote:
>>> --------------------
>>> * Non-8250 serial port support
>>> *
>>> PXA serial port support (SERIAL_PXA) [Y/n/?] y
>>>   Console on PXA serial port (SERIAL_PXA_CONSOLE) [Y/n/?] y
>>>   as /dev/ttySA[0-3] (SERIAL_PXA_TTYSA_NAME) [N/y/?] (NEW)
>>
>> Please make it sane for the single line it is on.
>
> "PXA serial port with SA-1100 major"
> "PXA serial port with SA-1100 major number"
> "PXA serial port with SA-1100 major device number"
>
> Could anything like that be acceptable?
>
> How long a line could be?
>
>>> Maybe I am missing something obvious, but it seems that such a
>>> collision is a kernel bug. Someone assumed that PXA cannot have a 8250
>>> tty device and used 8250's parameters in PXA tty driver.
>>
>> Yes, someone must have messed up, so care to find the root problem here?
>
> Two drivers try to use the same resource. It was in pre-git era, so it
> difficult to find out exactly. I would guess that that 8250 have
> precedence by at least 5 years. But it is almost guaranteed that lots
> of people depend on PXA console having ttyS0 name. So simple
> s/ttyS/ttySA/ is not a solution. My patch preserves status quo by
> default, but allows to have a correct workaround for those who face a
> collision. By correct I mean that it will not create a new collision
> since a system cannot run on both SA-1100 and PXA270 at the same time.
> This assumption is already documented in
> arch/arm/mach-pxa/include/mach/irqs.h line 94.

Patch discussion seemed to stall. Could we restart?

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

* Re: [PATCH] allow alternative name for PXA serial console
@ 2013-11-22 14:46           ` Sergei Ianovich
  0 siblings, 0 replies; 9+ messages in thread
From: Sergei Ianovich @ 2013-11-22 14:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-serial, linux-kernel

On 13 March 2013 04:03, Сергей Янович <ynvich@gmail.com> wrote:
> On 13 March 2013 03:39, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>> On Wed, Mar 13, 2013 at 03:34:59AM +0400, Сергей Янович wrote:
>>> --------------------
>>> * Non-8250 serial port support
>>> *
>>> PXA serial port support (SERIAL_PXA) [Y/n/?] y
>>>   Console on PXA serial port (SERIAL_PXA_CONSOLE) [Y/n/?] y
>>>   as /dev/ttySA[0-3] (SERIAL_PXA_TTYSA_NAME) [N/y/?] (NEW)
>>
>> Please make it sane for the single line it is on.
>
> "PXA serial port with SA-1100 major"
> "PXA serial port with SA-1100 major number"
> "PXA serial port with SA-1100 major device number"
>
> Could anything like that be acceptable?
>
> How long a line could be?
>
>>> Maybe I am missing something obvious, but it seems that such a
>>> collision is a kernel bug. Someone assumed that PXA cannot have a 8250
>>> tty device and used 8250's parameters in PXA tty driver.
>>
>> Yes, someone must have messed up, so care to find the root problem here?
>
> Two drivers try to use the same resource. It was in pre-git era, so it
> difficult to find out exactly. I would guess that that 8250 have
> precedence by at least 5 years. But it is almost guaranteed that lots
> of people depend on PXA console having ttyS0 name. So simple
> s/ttyS/ttySA/ is not a solution. My patch preserves status quo by
> default, but allows to have a correct workaround for those who face a
> collision. By correct I mean that it will not create a new collision
> since a system cannot run on both SA-1100 and PXA270 at the same time.
> This assumption is already documented in
> arch/arm/mach-pxa/include/mach/irqs.h line 94.

Patch discussion seemed to stall. Could we restart?
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2013-11-22 14:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-12 23:02 [PATCH] allow alternative name for PXA serial console Sergey Yanovich
2013-03-12 23:10 ` Greg Kroah-Hartman
2013-03-12 23:34   ` Сергей Янович
2013-03-12 23:39     ` Greg Kroah-Hartman
2013-03-12 23:39       ` Greg Kroah-Hartman
2013-03-13  0:03       ` Сергей Янович
2013-03-13  0:03         ` Сергей Янович
2013-11-22 14:46         ` Sergei Ianovich
2013-11-22 14:46           ` Sergei Ianovich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.