linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Julien Thierry <julien.thierry@arm.com>
Cc: linux-kernel@vger.kernel.org,
	ricardo.neri-calderon@linux.intel.com, marc.zyngier@arm.com,
	peterz@infradead.org, mingo@kernel.org
Subject: Re: [RFC PATCH 1/4] genirq: Provide basic NMI management for interrupt lines
Date: Tue, 17 Jul 2018 11:22:25 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1807171114280.3238@nanos.tec.linutronix.de> (raw)
In-Reply-To: <1531152846-19374-2-git-send-email-julien.thierry@arm.com>

On Mon, 9 Jul 2018, Julien Thierry wrote:
> +/**
> + *	disable_nmi_nosync - disable an nmi without waiting
> + *	@irq: Interrupt to disable
> + *
> + *	Disable the selected interrupt line. Disables and enables are
> + *	nested.
> + *	The interrupt to disable must have been requested through request_nmi.
> + *	Unlike disable_nmi(), this function does not ensure existing
> + *	instances of the IRQ handler have completed before returning.
> + */
> +void disable_nmi_nosync(unsigned int irq)
> +{
> +	disable_irq_nosync(irq);
> +}
> +
> +/**
> + *	disable_nmi - disable an nmi and wait for completion
> + *	@irq: Interrupt to disable
> + *
> + *	Disable the selected interrupt line. Enables and disables are
> + *	nested.
> + *	The interrupt to disable must have been requested through request_nmi.
> + *	This function waits for any pending IRQ handlers for this interrupt
> + *	to complete before returning. If you use this function while
> + *	holding a resource the IRQ handler may need you will deadlock.

I don't see how that wait would work with NMIs.

> +/* This function must be called with desc->lock held */
> +static const void *__cleanup_nmi(unsigned int irq, struct irq_desc *desc)
> +{
> +	const char *devname = NULL;
> +
> +	desc->istate &= ~IRQS_NMI;
> +
> +#ifdef CONFIG_SMP
> +	if (WARN_ON(desc->affinity_notify))
> +		desc->affinity_notify = NULL;
> +#endif

We should not support that affinity notify horror for NMIs at all.

> +	if (!WARN_ON(desc->action == NULL)) {
> +		irq_pm_remove_action(desc, desc->action);
> +		devname = desc->action->name;
> +		unregister_handler_proc(irq, desc->action);
> +
> +		kfree(desc->action);
> +		desc->action = NULL;
> +	}
> +
> +	irq_settings_clr_disable_unlazy(desc);
> +	irq_shutdown(desc);
> +
> +#ifdef CONFIG_SMP
> +	/* make sure affinity_hint is cleaned up */
> +	if (WARN_ON_ONCE(desc->affinity_hint))
> +		desc->affinity_hint = NULL;
> +#endif

Especially not twice :)

Thanks,

	tglx

  reply	other threads:[~2018-07-17  9:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09 16:14 [RFC PATCH 0/4] Provide core API for NMIs Julien Thierry
2018-07-09 16:14 ` [RFC PATCH 1/4] genirq: Provide basic NMI management for interrupt lines Julien Thierry
2018-07-17  9:22   ` Thomas Gleixner [this message]
2018-07-17 11:13     ` Julien Thierry
2018-07-17 11:28       ` Peter Zijlstra
2018-07-17 12:25         ` Julien Thierry
2018-07-17 15:48       ` Julien Thierry
2018-07-17 15:51         ` Peter Zijlstra
2018-07-17 16:35           ` Julien Thierry
2018-07-17 19:46             ` Thomas Gleixner
2018-07-18  8:09               ` Julien Thierry
2018-07-17 19:42           ` Thomas Gleixner
2018-07-09 16:14 ` [RFC PATCH 2/4] genirq: Provide NMI management for percpu_devid interrupts Julien Thierry
2018-07-09 16:14 ` [RFC PATCH 3/4] genirq: Provide NMI handlers Julien Thierry
2018-07-09 16:14 ` [RFC PATCH 4/4] irqdesc: Add domain handler for NMIs Julien Thierry

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=alpine.DEB.2.21.1807171114280.3238@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=julien.thierry@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ricardo.neri-calderon@linux.intel.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).