Michael Hanselmann | 2 Apr 2006 15:51
Picon

Hang in uart_block_til_ready()

Hello Russell

I've discovered a problem where I'm not sure wether it's an error in the
kernel or in the hardware.

The hardware I'm using for the serial console is a HP Lights-Out 100
Management. It provides a (virtual) serial port which then can be used
for remote administration over the network and is available as ttyS2 in
Linux. I'm using it for a serial console.

When doing open("/dev/ttyS2", O_RDWR) from userland, like it's done by
screen(1) and by my test program, the kernel "hangs" in the schedule()
call in the function uart_block_til_ready of serial_core.c.

The patch below fixes it, but I'm not sure wether it is the correct way,
nor if it might create other problems.

The problem was reproducable with 2.6.15.6, 2.6.16 and 2.6.16-git20 (all
vanilla). I've not been able to reproduce it on another box where the
serial console is on ttyS0 and done by a common 16550A-compatible chip.

Do you or somebody else have an idea what's going on here and how to fix
it correctly?

Thanks,
Michael

---
--- linux-2.6.16-hardened/drivers/serial/serial_core.c.orig	2006-04-02 15:07:43.000000000 +0200
+++ linux-2.6.16-hardened/drivers/serial/serial_core.c	2006-04-02 15:24:52.000000000 +0200
(Continue reading)

Russell King | 2 Apr 2006 16:38
Picon

Re: Hang in uart_block_til_ready()

On Sun, Apr 02, 2006 at 03:51:38PM +0200, Michael Hanselmann wrote:
> I've discovered a problem where I'm not sure wether it's an error in the
> kernel or in the hardware.

It's neither - it's a bug in your test program.  If you want "callout"
semantics, open the port using O_NONBLOCK mode.

If you don't open the port using O_NONBLOCK then the port will wait for
the DCD line (or virtual DCD line) to be asserted by the hardware before
exiting uart_block_til_ready().  This is used for gettys on UARTs so
they don't display the login banner until someone connects to the port.

--

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Michael Hanselmann | 2 Apr 2006 17:17
Picon

Re: Hang in uart_block_til_ready()

Hello Russell

On Sun, Apr 02, 2006 at 03:38:27PM +0100, Russell King wrote:
> On Sun, Apr 02, 2006 at 03:51:38PM +0200, Michael Hanselmann wrote:
> > I've discovered a problem where I'm not sure wether it's an error in the
> > kernel or in the hardware.

> It's neither - it's a bug in your test program.  If you want "callout"
> semantics, open the port using O_NONBLOCK mode.

I've now patched screen(1) and it works, but one thing is amazing me.
The other computer I wrote about has the serial console on ttyS0 and
starting screen(1) on the serial console works. Here's the relevant
strace part:

screen-strace:open("/dev/ttyS0", O_RDWR|O_NONBLOCK) = 3
screen-strace.23801:open("/dev/ttyS0", O_RDWR) = 3

This doesn't work on the HP box with the serial console on ttyS2. After
adding O_NONBLOCK, it works. Here's the strace:

screen-strace:open("/dev/ttyS2", O_RDWR|O_NONBLOCK) = 3
screen-strace.31830:open("/dev/ttyS2", O_RDWR|O_NONBLOCK) = 3

Am I going correct that this is a bug in screen(1) and it only works on
the first box by some mysterious reason? Mabye some timing issue?

Thanks,
Michael

(Continue reading)

Russell King | 2 Apr 2006 17:23
Picon

Re: Hang in uart_block_til_ready()

On Sun, Apr 02, 2006 at 05:17:39PM +0200, Michael Hanselmann wrote:
> Hello Russell
> 
> On Sun, Apr 02, 2006 at 03:38:27PM +0100, Russell King wrote:
> > On Sun, Apr 02, 2006 at 03:51:38PM +0200, Michael Hanselmann wrote:
> > > I've discovered a problem where I'm not sure wether it's an error in the
> > > kernel or in the hardware.
> 
> > It's neither - it's a bug in your test program.  If you want "callout"
> > semantics, open the port using O_NONBLOCK mode.
> 
> I've now patched screen(1) and it works, but one thing is amazing me.
> The other computer I wrote about has the serial console on ttyS0 and
> starting screen(1) on the serial console works. Here's the relevant
> strace part:

Have you checked the state of the DCD line in both cases?  Look in
/proc/tty/driver/serial.

> Am I going correct that this is a bug in screen(1) and it only works on
> the first box by some mysterious reason? Mabye some timing issue?

Probably "works" on the first box because it happens to have DCD asserted
on the real serial port.

--

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
-
(Continue reading)

Michael Hanselmann | 2 Apr 2006 17:42
Picon

Re: Hang in uart_block_til_ready()

On Sun, Apr 02, 2006 at 04:23:50PM +0100, Russell King wrote:
> Have you checked the state of the DCD line in both cases?  Look in
> /proc/tty/driver/serial.

HP box:
2: uart:16550A port:000003E8 irq:4 tx:12888 rx:147 RTS|CTS|DTR|DSR

other box:
0: uart:16550A port:000003F8 irq:4 tx:18886 rx:299 RTS|CTS|DTR|DSR|CD

So, yes. The other box has CD set (unless CD is not DCD). It might be
that the serial cable used there does this, but I can't check it because
the box is several hundreds of kilometers away.

> Probably "works" on the first box because it happens to have DCD asserted
> on the real serial port.

Yes, that explains it.

Thanks for your help,
Michael

--

-- 
Gentoo Linux developer, http://hansmi.ch/, http://forkbomb.ch/
Lennert Buytenhek | 4 Apr 2006 12:18

pl010: increase UART_NR to allow for more than two pl010 UARTs

On the cirrus ep93xx, there are three pl010 UARTs, while the pl010
driver only allows for two by default.  Increase UART_NR to eight to
allow these extra ports to be used.

Signed-off-by: Lennert Buytenhek <buytenh <at> wantstofly.org>

Index: linux-2.6.17-rc1/drivers/serial/amba-pl010.c
===================================================================
--- linux-2.6.17-rc1.orig/drivers/serial/amba-pl010.c
+++ linux-2.6.17-rc1/drivers/serial/amba-pl010.c
 <at>  <at>  -52,7 +52,7  <at>  <at> 

 #include <asm/io.h>

-#define UART_NR		2
+#define UART_NR		8

 #define SERIAL_AMBA_MAJOR	204
 #define SERIAL_AMBA_MINOR	16
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

info | 4 Apr 2006 11:08

$BD>%aD>EE40A4L5NA!*FCBg%P(B $B%C%/%"%C%W%-%c%s%Z!<%s%?!!%9%=%N%b%^%e%$!<%$%$%e%O%_%=%D%=%L%a%F%^%"%H%l%K%*%L%F%=%9!!%X%N%X%J%e%h%3!!%"%g!<%F%e%3!!%C%5!!%9%e%$!<%$%$%e%F%e%d%e%J%3!!%-%j%e%X%3!!%i%X%?%?%?%?%?(B

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

Gregory Gray | 17 Apr 2006 17:36

Academic Qualifications available from prestigious NON-ACCREDITED universities


NO ONE is turned down.

According to the U.S. Census Bureau, with the following degrees, 
here's how much you can  expect to make in your lifetime:

High School Diploma:  $1,100,000
Bachelor's Degree:    $2,100,000
Master's Degree:      $2,500,000
Doctorate:            $4,400,000

You Need a Better Degree, and we can Help!
Obtain degrees from Prestigious non-accredited
Universities based on you life experience.
NO ONE is turned down.

Call Now 7 days a week.
"1-718-504-5376"

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

Jon Anders Haugum | 20 Apr 2006 14:55
Picon
Picon

[PATCH] serial8250: set divisor register correctly for AMD Alchemy SoC uart. 3rd edition.

Alchemy SoC uart have got a non-standard divisor register that needs some
special handling.

This patch adds divisor read/write functions with test and special
handling for Alchemy internal uart.

Signed-off-by: Jon Anders Haugum <jonah <at> omegav.ntnu.no>

---

3rd edition:
- Removed section covering 16C850 autoconfig.

--- linux-2.6.16-rc5/drivers/serial/8250.c.orig	2006-03-03 02:12:10.000000000 +0100
+++ linux-2.6.16-rc5/drivers/serial/8250.c	2006-03-03 02:16:19.000000000 +0100
 <at>  <at>  -362,6 +362,40  <at>  <at>  serial_out(struct uart_8250_port *up, in
 #define serial_inp(up, offset)		serial_in(up, offset)
 #define serial_outp(up, offset, value)	serial_out(up, offset, value)

+/* Uart divisor latch read */
+static inline int _serial_dl_read(struct uart_8250_port *up)
+{
+	return serial_inp(up, UART_DLL) | serial_inp(up, UART_DLM) << 8;
+}
+
+/* Uart divisor latch write */
+static inline void _serial_dl_write(struct uart_8250_port *up, int value)
+{
+	serial_outp(up, UART_DLL, value & 0xff);
+	serial_outp(up, UART_DLM, value >> 8 & 0xff);
(Continue reading)

Alba Conner | 23 Apr 2006 02:11
Picon
Favicon

Degree or Diploma of Your Choice ge


Lazy to attend exam or classes?

We have Diplomas, Degrees, Masters' or Doctorate
to choose from any field of your interest.

Only 2 weeks require to delivers the prestigious non-accredited
universities paper to your doorstep.

Do not hesitate to give us a call today!
1-484-693-8861

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


Gmane