Re: [patch] 2.4.0-test6-pre8: Magic SysRq fixes for serial.c

From: Maciej W. Rozycki (macro@ds2.pg.gda.pl)
Date: Wed Aug 09 2000 - 10:13:45 EST


On Wed, 9 Aug 2000, Philipp Rumpf wrote:

> > and also the next one provided it arrived in the
> > SysRq recognition interval.
>
> No.

 Just look at the code:

handle_sysrq(ch, regs, NULL, NULL);
break_pressed = 0;
goto ignore_char;
^^^^^^^^^^^^^^^^

We just dropped the character regradless of whether handle_sysrq()
actually did anything.

> No. Dropping the character is perfectly fine - it's the same thing that
> happens on the keyboard (now), and it's about as complex as a hack like
> SysRq should be, IMHO.

 For the keyboard -- yes. Nobody expects pressing SysRq and another key
simultaneously producing a keypress event for the other key.

 For the serial line -- no. A sequence of BREAK and than a character
within a few seconds is a valid event. And I want to keep SysRq
compiled-in and disabled all the time so that I can enable it and get a
register dump or a task list in case something goes wrong.

> No it doesn't. The character after a break gets handled the way it should
> be - it gets interpreted as magic sysrq event, passed on to handle_sysrq,
> and we forget about it. It just happens to be a nop cause all SysRq keys
> are when sysrq_enabled == 0.

 After a bit of thinking I agree this is not a major misbehaviour and if I
nothing breaks due to it, for the sake of simplicity we may keep things as
they are now.

> Not sure I'm following - the character preceding a break condition shouldn't
> be affected, unless you're talking about the 0 byte that gets put in the
> FIFO for every break condition, which should get dropped.

 BREAK is an asynchronous event and you may get one even when there are
unreceived characters in the FIFO. I'm not sure how 8250 clones handle it
-- I can't recall the null byte but I'd have to look up docs again. Some
chips put a null character at the front, indeed.

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Aug 15 2000 - 21:00:18 EST