All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: Peter Korsgaard <jacmet@sunsite.dk>
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org,
	Jason Wessel <jason.wessel@windriver.com>
Subject: Re: [PATCH] serial: Add CONSOLE_POLL support for uartlite
Date: Mon, 23 Aug 2010 10:47:10 +0200	[thread overview]
Message-ID: <4C72358E.90503@monstr.eu> (raw)
In-Reply-To: <87mxsejwpo.fsf@macbook.be.48ers.dk>

Peter Korsgaard wrote:
>>>>>> "Michal" == Michal Simek <monstr@monstr.eu> writes:
> 
>  Michal> CONSOLE_POLL support for uartlite enables
>  Michal> KGDB debugging over serial line.
> 
> Please CC me on uartlite patches in the future, thanks.

Oou sorry.

> 
>  Michal> Signed-off-by: Michal Simek <monstr@monstr.eu>
>  Michal> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
>  Michal> ---
>  Michal>  drivers/serial/uartlite.c |   26 +++++++++++++++++++++++++-
>  Michal>  1 files changed, 25 insertions(+), 1 deletions(-)
> 
>  Michal> diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
>  Michal> index 9b03d7b..c0fae0d 100644
>  Michal> --- a/drivers/serial/uartlite.c
>  Michal> +++ b/drivers/serial/uartlite.c
>  Michal> @@ -322,6 +322,26 @@ static int ulite_verify_port(struct uart_port *port, struct serial_struct *ser)
>  Michal>  	return -EINVAL;
>  Michal>  }
>  
>  Michal> +#ifdef CONFIG_CONSOLE_POLL
>  Michal> +static int ulite_get_poll_char(struct uart_port *port)
>  Michal> +{
>  Michal> +	while (!(ioread32be(port->membase + ULITE_STATUS)
>  Michal> +						& ULITE_STATUS_RXVALID))
>  Michal> +		return NO_POLL_CHAR;
>  Michal> +
> 
> Using while instead of 'if' is imho pretty obscure here.

Agree that if is the better solution.

> 
>  Michal> +	return ioread32be(port->membase + ULITE_RX);
>  Michal> +}
>  Michal> +
>  Michal> +static void ulite_put_poll_char(struct uart_port *port, unsigned char ch)
>  Michal> +{
>  Michal> +	while (ioread32be(port->membase + ULITE_STATUS) & ULITE_STATUS_TXFULL)
>  Michal> +		cpu_relax();
> 
> 
> You could reuse ulite_console_wait_tx() like ulite_console_putchar()
> does.

yes, but ulite_console_wait_tx is used only when uartlite console is 
used. Not sure if I tried to setup console and KGDB but in this case I 
will have to add some ifdef that's why was easier for me to write on ioread.

> 
> Otherwise it looks fine.
> 
> Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
> 

I will changed driver and send v2.

Thanks,
Michal



-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian

  reply	other threads:[~2010-08-23  8:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17  8:42 Uartlite - poll support Michal Simek
2010-08-17  8:42 ` [PATCH] serial: Add CONSOLE_POLL support for uartlite Michal Simek
2010-08-22 19:04   ` Peter Korsgaard
2010-08-23  8:47     ` Michal Simek [this message]
2010-08-17 14:34 ` Uartlite - poll support Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2010-08-09 10:07 [PATCH] serial: Add CONSOLE_POLL support for uartlite Michal Simek
2010-08-10 11:48 ` Jason Wessel
2010-08-10 11:48   ` Jason Wessel
2010-08-10 11:50   ` Michal Simek

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=4C72358E.90503@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=gregkh@suse.de \
    --cc=jacmet@sunsite.dk \
    --cc=jason.wessel@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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 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.