All of lore.kernel.org
 help / color / mirror / Atom feed
* Uartlite - poll support
@ 2010-08-17  8:42 Michal Simek
  2010-08-17  8:42 ` [PATCH] serial: Add CONSOLE_POLL support for uartlite Michal Simek
  2010-08-17 14:34 ` Uartlite - poll support Greg KH
  0 siblings, 2 replies; 9+ messages in thread
From: Michal Simek @ 2010-08-17  8:42 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-serial

Hi Greg,

I am not sure who is responsible for drivers/serial but I see
that your tty tree contains a lot of serial patches. 
Could you please add the uartlite poll patch to your tree?

Thanks,
Michal



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

* [PATCH] serial: Add CONSOLE_POLL support for uartlite
  2010-08-17  8:42 Uartlite - poll support Michal Simek
@ 2010-08-17  8:42 ` Michal Simek
  2010-08-22 19:04   ` Peter Korsgaard
  2010-08-17 14:34 ` Uartlite - poll support Greg KH
  1 sibling, 1 reply; 9+ messages in thread
From: Michal Simek @ 2010-08-17  8:42 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-serial, Michal Simek, Jason Wessel

CONSOLE_POLL support for uartlite enables
KGDB debugging over serial line.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 drivers/serial/uartlite.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 9b03d7b..c0fae0d 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -322,6 +322,26 @@ static int ulite_verify_port(struct uart_port *port, struct serial_struct *ser)
 	return -EINVAL;
 }
 
+#ifdef CONFIG_CONSOLE_POLL
+static int ulite_get_poll_char(struct uart_port *port)
+{
+	while (!(ioread32be(port->membase + ULITE_STATUS)
+						& ULITE_STATUS_RXVALID))
+		return NO_POLL_CHAR;
+
+	return ioread32be(port->membase + ULITE_RX);
+}
+
+static void ulite_put_poll_char(struct uart_port *port, unsigned char ch)
+{
+	while (ioread32be(port->membase + ULITE_STATUS) & ULITE_STATUS_TXFULL)
+		cpu_relax();
+
+	/* write char to device */
+	iowrite32be(ch, port->membase + ULITE_TX);
+}
+#endif
+
 static struct uart_ops ulite_ops = {
 	.tx_empty	= ulite_tx_empty,
 	.set_mctrl	= ulite_set_mctrl,
@@ -338,7 +358,11 @@ static struct uart_ops ulite_ops = {
 	.release_port	= ulite_release_port,
 	.request_port	= ulite_request_port,
 	.config_port	= ulite_config_port,
-	.verify_port	= ulite_verify_port
+	.verify_port	= ulite_verify_port,
+#ifdef CONFIG_CONSOLE_POLL
+	.poll_get_char	= ulite_get_poll_char,
+	.poll_put_char	= ulite_put_poll_char,
+#endif
 };
 
 /* ---------------------------------------------------------------------
-- 
1.5.5.6


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

* Re: Uartlite - poll support
  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-17 14:34 ` Greg KH
  1 sibling, 0 replies; 9+ messages in thread
From: Greg KH @ 2010-08-17 14:34 UTC (permalink / raw)
  To: Michal Simek; +Cc: linux-kernel, linux-serial

On Tue, Aug 17, 2010 at 10:42:04AM +0200, Michal Simek wrote:
> Hi Greg,
> 
> I am not sure who is responsible for drivers/serial but I see
> that your tty tree contains a lot of serial patches. 
> Could you please add the uartlite poll patch to your tree?

Sure, I'll queue it up for .37.

thanks,

greg k-h

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

* Re: [PATCH] serial: Add CONSOLE_POLL support for uartlite
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Korsgaard @ 2010-08-22 19:04 UTC (permalink / raw)
  To: Michal Simek; +Cc: gregkh, linux-kernel, linux-serial, Jason Wessel

>>>>> "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.

 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.

 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.

Otherwise it looks fine.

Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

-- 
Bye, Peter Korsgaard

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

* Re: [PATCH] serial: Add CONSOLE_POLL support for uartlite
  2010-08-22 19:04   ` Peter Korsgaard
@ 2010-08-23  8:47     ` Michal Simek
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Simek @ 2010-08-23  8:47 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: gregkh, linux-kernel, linux-serial, Jason Wessel

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

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

* Re: [PATCH] serial: Add CONSOLE_POLL support for uartlite
  2010-08-10 11:48   ` Jason Wessel
  (?)
@ 2010-08-10 11:50   ` Michal Simek
  -1 siblings, 0 replies; 9+ messages in thread
From: Michal Simek @ 2010-08-10 11:50 UTC (permalink / raw)
  To: Jason Wessel
  Cc: jacmet, grant.likely, linux-serial, linux-kernel, KGDB Mailing List

Jason Wessel wrote:
> On 08/09/2010 05:07 AM, Michal Simek wrote:
>> CONSOLE_POLL support for uartlite enables
>> KGDB debugging over serial line.
>>
>> Signed-off-by: Michal Simek <monstr@monstr.eu>
>> ---
>>  drivers/serial/uartlite.c |   26 +++++++++++++++++++++++++-
>>  1 files changed, 25 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
>> index caf085d..ce1f3e0 100644
>> --- a/drivers/serial/uartlite.c
>> +++ b/drivers/serial/uartlite.c
>> @@ -322,6 +322,26 @@ static int ulite_verify_port(struct uart_port *port, struct serial_struct *ser)
>>  	return -EINVAL;
>>  }
>>  
>> +#ifdef CONFIG_CONSOLE_POLL
>> +static int ulite_get_poll_char(struct uart_port *port)
>> +{
>> +	while (!(ioread32be(port->membase + ULITE_STATUS)
>> +						& ULITE_STATUS_RXVALID))
>> +		cpu_relax();
>> +
>> +	return ioread32be(port->membase + ULITE_RX);
>> +}
> 
> 
> 
> After kdb was merged, the CONSOLE_POLL API had a subtle change where
> all I/O drivers should return immediately with a return of
> NO_POLL_CHAR in order to allow more than one I/O driver to operate in
> the same poll loop.
> 
> 
> The patch should look like the following for the get_poll_char.
> 
> +static int ulite_get_poll_char(struct uart_port *port)
> +{
> +	if (!(ioread32be(port->membase + ULITE_STATUS)
> +	    & ULITE_STATUS_RXVALID))
> +		return NO_POLL_CHAR;
> +
> +	return ioread32be(port->membase + ULITE_RX);
> +}
> 
> 
> If you agree to the change you can add my SOB.
> 
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

I have no problem with it.

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

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

* Re: [PATCH] serial: Add CONSOLE_POLL support for uartlite
  2010-08-09 10:07 [PATCH] serial: Add CONSOLE_POLL support for uartlite Michal Simek
@ 2010-08-10 11:48   ` Jason Wessel
  0 siblings, 0 replies; 9+ messages in thread
From: Jason Wessel @ 2010-08-10 11:48 UTC (permalink / raw)
  To: Michal Simek
  Cc: jacmet, grant.likely, linux-serial, linux-kernel, KGDB Mailing List

On 08/09/2010 05:07 AM, Michal Simek wrote:
> CONSOLE_POLL support for uartlite enables
> KGDB debugging over serial line.
> 
> Signed-off-by: Michal Simek <monstr@monstr.eu>
> ---
>  drivers/serial/uartlite.c |   26 +++++++++++++++++++++++++-
>  1 files changed, 25 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
> index caf085d..ce1f3e0 100644
> --- a/drivers/serial/uartlite.c
> +++ b/drivers/serial/uartlite.c
> @@ -322,6 +322,26 @@ static int ulite_verify_port(struct uart_port *port, struct serial_struct *ser)
>  	return -EINVAL;
>  }
>  
> +#ifdef CONFIG_CONSOLE_POLL
> +static int ulite_get_poll_char(struct uart_port *port)
> +{
> +	while (!(ioread32be(port->membase + ULITE_STATUS)
> +						& ULITE_STATUS_RXVALID))
> +		cpu_relax();
> +
> +	return ioread32be(port->membase + ULITE_RX);
> +}



After kdb was merged, the CONSOLE_POLL API had a subtle change where
all I/O drivers should return immediately with a return of
NO_POLL_CHAR in order to allow more than one I/O driver to operate in
the same poll loop.


The patch should look like the following for the get_poll_char.

+static int ulite_get_poll_char(struct uart_port *port)
+{
+	if (!(ioread32be(port->membase + ULITE_STATUS)
+	    & ULITE_STATUS_RXVALID))
+		return NO_POLL_CHAR;
+
+	return ioread32be(port->membase + ULITE_RX);
+}


If you agree to the change you can add my SOB.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

Cheers,
Jason.


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

* Re: [PATCH] serial: Add CONSOLE_POLL support for uartlite
@ 2010-08-10 11:48   ` Jason Wessel
  0 siblings, 0 replies; 9+ messages in thread
From: Jason Wessel @ 2010-08-10 11:48 UTC (permalink / raw)
  To: Michal Simek
  Cc: grant.likely, jacmet, linux-kernel, linux-serial, KGDB Mailing List

On 08/09/2010 05:07 AM, Michal Simek wrote:
> CONSOLE_POLL support for uartlite enables
> KGDB debugging over serial line.
> 
> Signed-off-by: Michal Simek <monstr@monstr.eu>
> ---
>  drivers/serial/uartlite.c |   26 +++++++++++++++++++++++++-
>  1 files changed, 25 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
> index caf085d..ce1f3e0 100644
> --- a/drivers/serial/uartlite.c
> +++ b/drivers/serial/uartlite.c
> @@ -322,6 +322,26 @@ static int ulite_verify_port(struct uart_port *port, struct serial_struct *ser)
>  	return -EINVAL;
>  }
>  
> +#ifdef CONFIG_CONSOLE_POLL
> +static int ulite_get_poll_char(struct uart_port *port)
> +{
> +	while (!(ioread32be(port->membase + ULITE_STATUS)
> +						& ULITE_STATUS_RXVALID))
> +		cpu_relax();
> +
> +	return ioread32be(port->membase + ULITE_RX);
> +}



After kdb was merged, the CONSOLE_POLL API had a subtle change where
all I/O drivers should return immediately with a return of
NO_POLL_CHAR in order to allow more than one I/O driver to operate in
the same poll loop.


The patch should look like the following for the get_poll_char.

+static int ulite_get_poll_char(struct uart_port *port)
+{
+	if (!(ioread32be(port->membase + ULITE_STATUS)
+	    & ULITE_STATUS_RXVALID))
+		return NO_POLL_CHAR;
+
+	return ioread32be(port->membase + ULITE_RX);
+}


If you agree to the change you can add my SOB.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

Cheers,
Jason.


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 

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

* [PATCH] serial: Add CONSOLE_POLL support for uartlite
@ 2010-08-09 10:07 Michal Simek
  2010-08-10 11:48   ` Jason Wessel
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Simek @ 2010-08-09 10:07 UTC (permalink / raw)
  To: jacmet; +Cc: grant.likely, linux-serial, linux-kernel, Michal Simek

CONSOLE_POLL support for uartlite enables
KGDB debugging over serial line.

Signed-off-by: Michal Simek <monstr@monstr.eu>
---
 drivers/serial/uartlite.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index caf085d..ce1f3e0 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -322,6 +322,26 @@ static int ulite_verify_port(struct uart_port *port, struct serial_struct *ser)
 	return -EINVAL;
 }
 
+#ifdef CONFIG_CONSOLE_POLL
+static int ulite_get_poll_char(struct uart_port *port)
+{
+	while (!(ioread32be(port->membase + ULITE_STATUS)
+						& ULITE_STATUS_RXVALID))
+		cpu_relax();
+
+	return ioread32be(port->membase + ULITE_RX);
+}
+
+static void ulite_put_poll_char(struct uart_port *port, unsigned char ch)
+{
+	while (ioread32be(port->membase + ULITE_STATUS) & ULITE_STATUS_TXFULL)
+		cpu_relax();
+
+	/* write char to device */
+	iowrite32be(ch, port->membase + ULITE_TX);
+}
+#endif
+
 static struct uart_ops ulite_ops = {
 	.tx_empty	= ulite_tx_empty,
 	.set_mctrl	= ulite_set_mctrl,
@@ -338,7 +358,11 @@ static struct uart_ops ulite_ops = {
 	.release_port	= ulite_release_port,
 	.request_port	= ulite_request_port,
 	.config_port	= ulite_config_port,
-	.verify_port	= ulite_verify_port
+	.verify_port	= ulite_verify_port,
+#ifdef CONFIG_CONSOLE_POLL
+	.poll_get_char	= ulite_get_poll_char,
+	.poll_put_char	= ulite_put_poll_char,
+#endif
 };
 
 /* ---------------------------------------------------------------------
-- 
1.5.5.6


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

end of thread, other threads:[~2010-08-23  8:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.