linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francesco Lavra <francescolavra.fl@gmail.com>
To: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	"Russell King" <linux@arm.linux.org.uk>,
	"Jason Wessel" <jason.wessel@windriver.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Alan Cox" <alan@linux.intel.com>,
	linaro-kernel@lists.linaro.org, patches@linaro.org,
	"Brian Swetland" <swetland@google.com>,
	linux-kernel@vger.kernel.org, "Arve Hjønnevåg" <arve@android.com>,
	linux-serial@vger.kernel.org, "Colin Cross" <ccross@android.com>,
	kgdb-bugreport@lists.sourceforge.net, kernel-team@android.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 07/11] tty/serial: Add kgdb_nmi driver
Date: Sat, 15 Sep 2012 17:52:54 +0200	[thread overview]
Message-ID: <5054A456.80606@gmail.com> (raw)
In-Reply-To: <1347548615-18227-7-git-send-email-anton.vorontsov@linaro.org>

On 09/13/2012 05:03 PM, Anton Vorontsov wrote:
...
> +static int kgdb_nmi_tty_install(struct tty_driver *drv, struct tty_struct *tty)
> +{
> +	struct kgdb_nmi_tty_priv *priv;
> +	int ret;
> +
> +	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> +	if (!priv)
> +		return -ENOMEM;
> +
> +	INIT_KFIFO(priv->fifo);
> +	tasklet_init(&priv->tlet, kgdb_nmi_tty_receiver, (unsigned long)priv);
> +	tty_port_init(&priv->port);
> +	priv->port.ops = &kgdb_nmi_tty_port_ops;
> +	tty->driver_data = priv;
> +
> +	ret = tty_port_install(&priv->port, drv, tty);
> +	if (ret) {
> +		pr_err("%s: can't nstall tty port: %d\n", __func__, ret);

s/nstall/install

...
> diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
> index 2b42a01..ed97cfd 100644
> --- 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;

If kgdb_register_nmi_console() fails, kgdb_unregister_io_module() must
be called for proper cleanup

--
Francesco

  reply	other threads:[~2012-09-15 15:51 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 [this message]
2012-09-17  1:07     ` [PATCH updated " Anton Vorontsov
2012-09-19 11:52   ` [PATCH " Jason Wessel
2012-09-19 16:54     ` Anton Vorontsov
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
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=5054A456.80606@gmail.com \
    --to=francescolavra.fl@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@linux.intel.com \
    --cc=anton.vorontsov@linaro.org \
    --cc=arve@android.com \
    --cc=ccross@android.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jason.wessel@windriver.com \
    --cc=kernel-team@android.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=patches@linaro.org \
    --cc=swetland@google.com \
    /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).