Hi all,
I have run into a problem with using my serial port as a console in linux
2.4.17, and tracked down the change. Just wondering if anyone could shed some
light on the situation. Here's the scoop:
In Linux 2.4.10 -> 2.4.14 (and probably earlier than 2.4.10, but i didn't
check) my serial console port works just fine. I then started using 2.4.17 and
the serial port would continue to spit out output, but would not accept any
input. I turned on the debugging statements and traced the problem down to the
following piece of code from "drivers/char/serial.c".
function -> "change_speed"
#if 0 /* breaks serial console during boot stage */
/*
* !!! ignore all characters if CREAD is not set
*/
if ((cflag & CREAD) == 0)
info->ignore_status_mask |= UART_LSR_DR;
#endif
The "#if 0" statements exist in 2.4.10 -> 2.4.14.
In Linux 2.4.15, the "#if 0" statements were removed, so now that code is hit,
and all the input characters are now ignored.
It is still missing in 2.4.16 & 2.4.17.
If i manually put the lines back (the "#if 0" and "#endif"), then my serial
console works just fine.
Did someone submit serial.c with the "#if 0" lines removed by accident?
I did look at the 2.4.15 changelog and could not see any changes regarding this.
My other question is: Why does this break the serial console?
Someone must have know it has that affect in 2.4 because of the comment that is
in the "#if 0" line. Any idea what is causing 'cflag' to be improperly set in
the serial driver?
I'd much prefer to fix the root problem, as opposed to putting in the "#if 0"
work-around.
Any ideas or pointers would be most appreciated.
Thanks.
--
Craig.
+------------------------------------------------------+
http://www.wombat.ca Why? Why not.
http://www.washington.edu/pine/ Pine @ the U of Wash.
+-------------=*sent via Pine4.42*=--------------------+
> If i manually put the lines back (the "#if 0" and "#endif"), then my serial
> console works just fine.
Except that you broke serial support for CREAD control
> Did someone submit serial.c with the "#if 0" lines removed by accident?
No
> My other question is: Why does this break the serial console?
Your user space is buggy I think, and didn't set CREAD
On Mon, 18 Feb 2002, Alan Cox wrote:
> > If i manually put the lines back (the "#if 0" and "#endif"), then my serial
> > console works just fine.
>
> Except that you broke serial support for CREAD control
>
> > Did someone submit serial.c with the "#if 0" lines removed by accident?
>
> No
If it was removed on purpose, why was the code commented out in the first place?
Why remove it in 2.4.15? Just curious on why that release.
--
Craig.
+------------------------------------------------------+
http://www.wombat.ca Why? Why not.
http://www.washington.edu/pine/ Pine @ the U of Wash.
+-------------=*sent via Pine4.42*=--------------------+
Alan Cox <[email protected]> writes:
> > If i manually put the lines back (the "#if 0" and "#endif"), then my serial
> > console works just fine.
>
> Except that you broke serial support for CREAD control
>
> > Did someone submit serial.c with the "#if 0" lines removed by accident?
>
> No
>
> > My other question is: Why does this break the serial console?
>
> Your user space is buggy I think, and didn't set CREAD
Old versions of /sbin/init are broken and clear CREAD. Most getty's (except
mingetty) do the right thing. I saw the change at 2.4.2 -> 2.4.3. I
don't why some people have managed to avoid it for longer periods of
time.
The great mystery is how /sbin/init managed to work in 2.4.2....
Eric
On 18 Feb 2002, Eric W. Biederman wrote:
> Old versions of /sbin/init are broken and clear CREAD. Most getty's (except
> mingetty) do the right thing. I saw the change at 2.4.2 -> 2.4.3. I
> don't why some people have managed to avoid it for longer periods of
> time.
>
> The great mystery is how /sbin/init managed to work in 2.4.2....
>
> Eric
>
Eric,
Thanks very much to both you and Alan. You were exactly right. The version
of /sbin/init on our filesystem was quite old (2 years old). I grabbed the tar
ball of the newest version, and using this version (without the "#if 0" lines)
works just fine because it sets up the console properly.
Thanks again.
--
Craig.
+------------------------------------------------------+
http://www.wombat.ca Why? Why not.
http://www.washington.edu/pine/ Pine @ the U of Wash.
+-------------=*sent via Pine4.42*=--------------------+