From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Brian Beattie <brianb@apcon.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: A question about break and sysrq on a serial console (2.6.19.1)
Date: Thu, 18 Jan 2007 17:11:33 +0000 [thread overview]
Message-ID: <20070118171133.GE31418@flint.arm.linux.org.uk> (raw)
In-Reply-To: <1169139169.16802.31.camel@brianb>
On Thu, Jan 18, 2007 at 08:52:49AM -0800, Brian Beattie wrote:
> On Thu, 2007-01-18 at 16:47 +0000, Russell King wrote:
> > On Thu, Jan 18, 2007 at 08:19:47AM -0800, Brian Beattie wrote:
> > > On Thu, 2007-01-18 at 09:13 +0000, Russell King wrote:
> > > > On Wed, Jan 17, 2007 at 03:56:54PM -0800, Brian Beattie wrote:
> > > > > I'm trying to do a SYSRQ over a serial console. As I understand it a
> > > > > break will do that, but I'm not seeing the SYSRQ. In looking at
> > > > > uart_handle_break() in drivers/serial/8250.c it looks like the code will
> > > > > toggle port->sysrq, rather than just setting it when the port is a
> > > > > console. I think the correct code would be to move the "port->sysrq =
> > > > > 0;" to follow the closing brace on the next line, or am I missing
> > > > > something.
> > > >
> > > > Thereby preventing the action of <break> (which may be to cause a SAK
> > > > event, which would be rather important on a console to ensure that
> > > > you're really logging in rather than typing your password into another
> > > > users program which just looks like a login program.)
> > > >
> > > > Note that the sequence for sysrq is:
> > > >
> > > > (non-break characters or nothing) <break> <sysrq-char>
> > > >
> > > well the code as is, is not working. Printk's tell me that
> > > uart_handle_break() is called repeatedly while the break condition is
> > > active, toggling port->sysrq so that it's a 50/50 chance on whether
> > > port->sysrq will be set or cleared when the break condition ends. On
> > > the other hand the 8250 break condition handling code is not working
> > > anyway, so the problem may be that the 8250 code is not calling
> > > uart_handle_break() correctly.
> >
> > Please learn to use the "reply to all" button when using mailing lists.
> I don't post much to LKML, I realized after I hit send I needed to reply
> all.
> >
> > Works fine here. Which UART are you actually using? At a guess, it's
> > probably a bad clone which does not have a correct break implementation.
>
> it's the built-in mpc8349 powerpc uart.
Well, it looks like this UART has a differing behaviour to proper 16xxx
UARTs - it says that the BI will be cleared when a stop bit is received
in addition to when the LSR is read. That means that unless you check
the LSR while the break condition is present, you may never know one
existed.
Standard 8250-compatible UARTs only clear the BI when the LSR is read.
As for the rest of the description, it's quite loose. It doesn't really
say under what conditions the BI bit is set, but I suggest that your UART
repeatedly (and incorrectly) sets the BI bit when no *new* break condition
exists. That would certainly explain your behaviour.
Again, standard 8250-compatible UARTs don't do this.
Not sure how to fix this without other people seeing a behavioural
change.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
prev parent reply other threads:[~2007-01-18 17:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-17 23:56 A question about break and sysrq on a serial console (2.6.19.1) Brian Beattie
2007-01-18 9:13 ` Russell King
[not found] ` <1169137187.16802.26.camel@brianb>
[not found] ` <20070118164747.GD31418@flint.arm.linux.org.uk>
2007-01-18 16:52 ` Brian Beattie
2007-01-18 17:11 ` Russell King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070118171133.GE31418@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=brianb@apcon.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox