Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Sergei Shtylylov <sshtylyov@ru.mvista.com>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: rmk+serial@arm.linux.org.uk, linux-mips@linux-mips.org,
	ralf@linux-mips.org
Subject: Re: [PATCH] serial_txx9: forcibly init the spinlock for PCI UART used as a console
Date: Tue, 27 Dec 2005 19:29:07 +0300	[thread overview]
Message-ID: <43B16BD3.9080108@ru.mvista.com> (raw)
In-Reply-To: <20051228.003457.74752441.anemo@mba.ocn.ne.jp>

Hello.

Atsushi Nemoto wrote:

>>>>>>On Tue, 27 Dec 2005 16:38:54 +0300, Sergei Shtylylov <sshtylyov@ru.mvista.com> said:

>>>The problem is not just only spin_lock_init.  The parameters of
>>>"console=" option (baudrate, etc.) are not passed for PCI UART.

> sshtylyov>     They are -- uart_add_one_port() calls console setup
> sshtylyov> once more when registering PCI UART with serial code.

> Yes, you are right.  I missed the register_console call in
> uart_add_one_port().  So your patch will fix the problem.  But I
> suppose the spinlock should be initialized in serial_core.  How about
> this?

> --- a/drivers/serial/serial_core.c
> +++ b/drivers/serial/serial_core.c
> @@ -2233,7 +2233,7 @@ int uart_add_one_port(struct uart_driver
>  	 * If this port is a console, then the spinlock is already
>  	 * initialised.
>  	 */
> -	if (!uart_console(port))
> +	if (!(uart_console(port) && (port->cons->flags & CON_ENABLED)))
>  		spin_lock_init(&port->lock);
>  
>  	uart_configure_port(drv, state, port);

    I wouldn't object.

>>>--- a/drivers/serial/serial_txx9.c
>>>+++ b/drivers/serial/serial_txx9.c
>>>@@ -937,11 +942,6 @@ static int serial_txx9_console_setup(str
>>>return -ENODEV;
>>>
>>>/*
>>>-	 * Temporary fix.
>>>-	 */
>>>-	spin_lock_init(&port->lock);
>>>-
>>>-	/*
>>>*	Disable UART interrupts, set DTR and RTS high
>>>*	and set speed.
>>>*/

> sshtylyov> Can you tell me, how this is supposed to work with TX49xx
> sshtylyov> SOC UARTs? When that spinlock will be init'ed for the
> sshtylyov> console port? uart_add_one_port() won't do it, and your
> sshtylyov> added code below won't do it either, so I disagree with
> sshtylyov> this change (though with "empty" spinlock it will no doubt
> sshtylyov> work) since there's nothing to init.
> 
> The spinlock is initialized in uart_set_options() which is called
> from console setup function.

    I'm sorry, haven't dug that deep. :-)
    Thought explicit spinlock init was really necessary there...

WBR, Sergei

  reply	other threads:[~2005-12-27 16:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-26 22:24 [PATCH] serial_txx9: forcibly init the spinlock for PCI UART used as a console Sergei Shtylylov
2005-12-27  5:45 ` Atsushi Nemoto
2005-12-27 13:38   ` Sergei Shtylylov
2005-12-27 15:34     ` Atsushi Nemoto
2005-12-27 16:29       ` Sergei Shtylylov [this message]
2005-12-27 18:41       ` Russell King
2005-12-27 18:54         ` Sergei Shtylylov
2005-12-27 19:31           ` Sergei Shtylyov
2005-12-28  4:25         ` Atsushi Nemoto
2005-12-29 16:32           ` Atsushi Nemoto
2006-01-05 15:14         ` Atsushi Nemoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43B16BD3.9080108@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=rmk+serial@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox