Skip to contentSkip to conversation

serial console problems with 2.4.4

DISCUSSION Reto Baettig 3 participants 6 messages May 2, 2001 – May 3, 2001

lore
Share & tools
lore
#0 lore raw

Hi

I just installed 2.4.4 on our alpha SMP boxes (ES40) and now I have problems with the serial console:

sulogin does not accept input from the serial line mingetty does not accept input from the serial line agetty works fine

Everything works fine for the 2.4.2 kernel. I took the .config file from the 2.4.2 kernel to compile the 2.4.4 kernel.

Any ideas?

Reto

#1 lore raw
Quoted 4 lines · On Wed, 02 May 2001 11:54:11 +0200 Reto Baettig <[email protected]> wrote:

Hi

I just installed 2.4.4 on our alpha SMP boxes (ES40) and now I have problems with the serial console:

I get same kind of problem when upgrading from 2.4.2 to 2.4.3 and using busybox as init/getty

The problem was a bug in busybox. The console initialisation code was not correct.

Quoted 4 lines

sulogin does not accept input from the serial line mingetty does not accept input from the serial line agetty works fine

So this this probably a sulogin/mingetty problem. They should set the CREAD flag in your tty c_cflag.

the patch for busybox repalced the line

	tty.c_cflag |= HUPCL|CLOCAL
by
	tty.c_cflag |= CREAD|HUPCL|CLOCAL

Hope this help.

Signature · 1 line
Fabrice Gautier <[email protected]>
#2 lore raw
Quoted 12 lines · Fabrice Gautier
Quoted 9 lines · On 02 May 2001 10:37:21 -0600 [email protected] (Eric W. Biederman) wrote:
Quoted 8 lines · Fabrice Gautier

So this this probably a sulogin/mingetty problem. They should set the CREAD flag in your tty c_cflag.

the patch for busybox repalced the line

	tty.c_cflag |= HUPCL|CLOCAL
by
	tty.c_cflag |= CREAD|HUPCL|CLOCAL
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Hope this help.

This part is correct.

However the kernel sets CREAD by default.

Are your sure? Wasn't this the behaviour for 2.4.2 but changed in 2.4.3

init=/bin/bash works fine over a serial console in 2.4.4. So I am certain.

I get the impression that something in 2.4.3 fixed CREAD handling, and we started noticing the buggy user space.

Quoted 4 lines
Quoted 1 line

sysvinit (and possibly other inits) clears CREAD.

In my case I was using busybox as init. So there is no sysinit or any other init called before this line.

The busy box init is also clearing CREAD (as of 0.51 anyway).

Quoted 3 lines
Quoted 1 line

I wish I knew where the breakage actually occured.

Just look at this diff on serial.c between 2.4.2 and 2.4.3:

If it was a real diff between 2.4.2 and 2.4.3 I would agree, however it looks like your attempt to fix 2.4.3.

Eric

Quoted 14 lines
../../linux-2.4.2/drivers/char/serial.c renamed from serial.c +2 -2
@@ -1764,8 +1765,8 @@
 	/*
 	 * !!! ignore all characters if CREAD is not set
 	 */
-//	if ((cflag & CREAD) == 0)
-//		info->ignore_status_mask |= UART_LSR_DR;
+	if ((cflag & CREAD) == 0)
+		info->ignore_status_mask |= UART_LSR_DR;
 	save_flags(flags); cli();
 	if (uart_config[info->state->type].flags & UART_STARTECH) {
 		serial_outp(info, UART_LCR, 0xBF);
#3 lore raw
Quoted 3 lines · On 03 May 2001 02:15:03 -0600 [email protected] (Eric W. Biederman) wrote:

I get the impression that something in 2.4.3 fixed CREAD handling, and we started noticing the buggy user space.

That's my impression too...

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I wish I knew where the breakage actually occured.

Just look at this diff on serial.c between 2.4.2 and 2.4.3:

If it was a real diff between 2.4.2 and 2.4.3 I would agree, however it looks like your attempt to fix 2.4.3.

Err... Yes sorry, in fact this was a workaround proposed by Kanoj, the maintener of serial.c (I think)...

Regards.

Signature · 1 line
Fabrice Gautier <[email protected]>
#4 lore raw
In reply to Reto Baettig
Quoted 21 lines · Fabrice Gautier
Quoted 4 lines · On Wed, 02 May 2001 11:54:11 +0200 Reto Baettig <[email protected]> wrote:

Hi

I just installed 2.4.4 on our alpha SMP boxes (ES40) and now I have problems with the serial console:

I get same kind of problem when upgrading from 2.4.2 to 2.4.3 and using busybox as init/getty

The problem was a bug in busybox. The console initialisation code was not correct.

Quoted 4 lines

sulogin does not accept input from the serial line mingetty does not accept input from the serial line agetty works fine

So this this probably a sulogin/mingetty problem. They should set the CREAD flag in your tty c_cflag.

Quoted 6 lines

the patch for busybox repalced the line

	tty.c_cflag |= HUPCL|CLOCAL
by
	tty.c_cflag |= CREAD|HUPCL|CLOCAL

Hope this help.

This part is correct.

However the kernel sets CREAD by default. sysvinit (and possibly other inits) clears CREAD. I wish I knew where the breakage actually occured.

And then sulogin/mingetty need to reenable it.

It's not too big of a deal except the serial code doesn't accept SAK's when CREAD is clear.

Eric

#5 lore raw
Quoted 9 lines · On 02 May 2001 10:37:21 -0600 [email protected] (Eric W. Biederman) wrote:
Quoted 8 lines · Fabrice Gautier

So this this probably a sulogin/mingetty problem. They should set the CREAD flag in your tty c_cflag.

the patch for busybox repalced the line

	tty.c_cflag |= HUPCL|CLOCAL
by
	tty.c_cflag |= CREAD|HUPCL|CLOCAL
Quoted 5 lines
Quoted 1 line

Hope this help.

This part is correct.

However the kernel sets CREAD by default.

Are your sure? Wasn't this the behaviour for 2.4.2 but changed in 2.4.3

Quoted 1 line

sysvinit (and possibly other inits) clears CREAD.

In my case I was using busybox as init. So there is no sysinit or any other init called before this line.

Quoted 1 line

I wish I knew where the breakage actually occured.

Just look at this diff on serial.c between 2.4.2 and 2.4.3:

../../linux-2.4.2/drivers/char/serial.c renamed from serial.c +2 -2
@@ -1764,8 +1765,8 @@
 	/*
 	 * !!! ignore all characters if CREAD is not set
 	 */
-//	if ((cflag & CREAD) == 0)
-//		info->ignore_status_mask |= UART_LSR_DR;
+	if ((cflag & CREAD) == 0)
+		info->ignore_status_mask |= UART_LSR_DR;
 	save_flags(flags); cli();
 	if (uart_config[info->state->type].flags & UART_STARTECH) {
 		serial_outp(info, UART_LCR, 0xBF);
Signature · 1 line
Fabrice Gautier <[email protected]>