Re: [RFC PATCH 1/4] genirq: Provide basic NMI management for interrupt lines

From: Julien Thierry
Date: Tue Jul 17 2018 - 11:48:23 EST




On 17/07/18 12:13, Julien Thierry wrote:
Hi Thomas,

Thanks for the review.

On 17/07/18 10:22, Thomas Gleixner wrote:

[...]

On Mon, 9 Jul 2018, Julien Thierry wrote:
+/* 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.


Makes sense, I'll add it to the constraints for NMIs and remove that part.

+ÂÂÂ 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 :)


Oops... I'll remove that as well.

Re-reading this I realized that second part was about desc->affinity_hint and not desc->affinity_notify.

Supporting desc->affinity_hint for NMIs shouldn't be an issue, right?

Thanks,

--
Julien Thierry