linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: anton.vorontsov@linaro.org (Anton Vorontsov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 07/11] tty/serial: Add kgdb_nmi driver
Date: Wed, 19 Sep 2012 09:54:47 -0700	[thread overview]
Message-ID: <20120919165447.GA6316@lizard> (raw)
In-Reply-To: <5059B200.9040706@windriver.com>

On Wed, Sep 19, 2012 at 06:52:32AM -0500, Jason Wessel wrote:
[...]
> > --- a/drivers/tty/serial/kgdboc.c
> > +++ b/drivers/tty/serial/kgdboc.c
> > @@ -145,6 +145,8 @@ __setup("kgdboc=", kgdboc_option_setup);
> >  
> >  static void cleanup_kgdboc(void)
> >  {
> > +	if (kgdb_unregister_nmi_console())
> > +		return;
> >  	kgdboc_unregister_kbd();
> >  	if (configured == 1)
> >  		kgdb_unregister_io_module(&kgdboc_io_ops);
> > @@ -198,6 +200,10 @@ do_register:
> >  	if (err)
> >  		goto noconfig;
> >  
> > +	err = kgdb_register_nmi_console();
> > +	if (err)
> > +		goto noconfig;
> > +
> 
> Just one question on this one, what do you expect to happen, or how
> does this work when you use a different serial port for example on a
> board that has a real serial port and an FIQ port?   It was not
> obvious that there was a path to check if the port you are
> registering is an FIQ enabled port and then call the
> kgdb_register_nmi_console at that point.

Yes, it works perfectly fine. If the port is not FIQ-enabled (which,
technically, can be enabled later -- it's just not implemented), then
ttyNMI just won't able to receive data.

The reason why I register nmi console in KGDB code (as opposite to arch
code), is the dependcy: the port should be initialized before it can be
used as ttyNMI. We could place the ttyNMI registration code into
late_initcall in arch/, and check for dbg_io_ops, but that is ugly by
itself, plus dbg_io_ops can change.

But with your kgdb_arch->enable_nmi suggestion (which I'll surely
implement), we can skip the registration at least for the cases when
the arch doesn't have this feature.

Thanks!

Anton.

  reply	other threads:[~2012-09-19 16:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-13 15:01 [PATCH v7 0/11] KGDB/KDB FIQ (NMI) debugger Anton Vorontsov
2012-09-13 15:03 ` [PATCH 01/11] kernel/debug: Mask KGDB NMI upon entry Anton Vorontsov
2012-09-19 11:52   ` Jason Wessel
2012-09-13 15:03 ` [PATCH 02/11] kdb: Implement disable_nmi command Anton Vorontsov
2012-09-19 11:52   ` Jason Wessel
2012-09-13 15:03 ` [PATCH 03/11] kdb: Turn KGDB_KDB=n stubs into static inlines Anton Vorontsov
2012-09-13 15:03 ` [PATCH 04/11] tty/serial/core: Introduce poll_init callback Anton Vorontsov
2012-09-13 15:03 ` [PATCH 05/11] tty/serial/amba-pl011: Implement " Anton Vorontsov
2012-09-13 15:03 ` [PATCH 06/11] tty/serial/amba-pl011: Quiesce interrupts in poll_get_char Anton Vorontsov
2012-09-13 15:03 ` [PATCH 07/11] tty/serial: Add kgdb_nmi driver Anton Vorontsov
2012-09-15 15:52   ` Francesco Lavra
2012-09-17  1:07     ` [PATCH updated " Anton Vorontsov
2012-09-19 11:52   ` [PATCH " Jason Wessel
2012-09-19 16:54     ` Anton Vorontsov [this message]
2012-09-13 15:03 ` [PATCH 08/11] ARM: Move some macros from entry-armv to entry-header Anton Vorontsov
2012-09-13 15:03 ` [PATCH 09/11] ARM: Add KGDB/KDB FIQ debugger generic code Anton Vorontsov
2012-09-13 15:03 ` [PATCH 10/11] ARM: VIC: Add a couple of low-level FIQ management helpers Anton Vorontsov
2012-09-13 15:03 ` [PATCH 11/11] ARM: versatile: Make able to use UART ports for KGDB FIQ debugger Anton Vorontsov
2012-09-13 17:04 ` [PATCH v7 0/11] KGDB/KDB FIQ (NMI) debugger Alan Cox
2012-09-13 16:55   ` Anton Vorontsov
2012-09-17 11:37 ` Greg Kroah-Hartman
2012-09-17 12:43   ` Jason Wessel
2012-09-17 12:54     ` Greg Kroah-Hartman
2012-09-17 15:39       ` Anton Vorontsov
2012-09-17 15:54         ` Greg Kroah-Hartman
2012-09-19 11:57           ` Jason Wessel
2012-09-19 16:57             ` Anton Vorontsov
  -- strict thread matches above, loose matches on Subject: below --
2012-09-19 23:40 [PATCH v8 " Anton Vorontsov
2012-09-19 23:41 ` [PATCH 07/11] tty/serial: Add kgdb_nmi driver Anton Vorontsov
2012-09-20 13:57   ` Jason Wessel
2012-09-24 21:26 [PATCH v9 0/11] KGDB/KDB FIQ (NMI) debugger Anton Vorontsov
2012-09-24 21:27 ` [PATCH 07/11] tty/serial: Add kgdb_nmi driver Anton Vorontsov

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=20120919165447.GA6316@lizard \
    --to=anton.vorontsov@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).