Hang in uart_block_til_ready()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
@@ -1456,6 +1456,10 @@ uart_block_til_ready(struct file *filp, 
 			break;
 		}
 
+		/* hansmi: fixes a hang on open("/dev/ttyS2", O_RDWR) for me */
+		if (uart_console(port) && (port->cons->flags & CON_ENABLED))
+			break;
+
 		/*
 		 * Set DTR to allow modem to know we're waiting.  Do
 		 * not set RTS here - we want to make sure we catch

Attachment: pgpj28lExRnLz.pgp
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux