mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	x86@kernel.org, Robert Hodaszi <Robert.Hodaszi@digi.com>,
	Vadim Pasternak <vadimp@mellanox.com>,
	Ido Schimmel <idosch@mellanox.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-serial@vger.kernel.org
Subject: Re: [patch 2/5] genirq: Add optional hardware synchronization for shutdown
Date: Fri, 28 Jun 2019 11:41:00 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1906281128310.1802@nanos.tec.linutronix.de> (raw)
In-Reply-To: <dbcd11d3-c967-a0a0-02a6-86d162f93a56@arm.com>

Marc,

On Fri, 28 Jun 2019, Marc Zyngier wrote:
> On 25/06/2019 12:13, Thomas Gleixner wrote:
> >  
> >  	int		(*irq_set_affinity)(struct irq_data *data, const struct cpumask *dest, bool force);
> >  	int		(*irq_retrigger)(struct irq_data *data);
> > +	int		(*irq_inflight)(struct irq_data *data);
> 
> I wonder how different this irq_inflight() is from the irq_get_irqchip_state()
> that can already report a number of states from the HW.
> 
> It is also unclear to me how "in flight" maps to the internal state of
> the interrupt controller: Is it pending? Acked? If the interrupt has been
> masked already, pending should be harmless (the interrupt won't fire anymore).
> But seeing it in the acked would probably mean that it is on its way to being
> handled, with a potential splat.

in flight means that the interrupt chip (in the offending case the IO-APIC)
has that interrupt raised internally _AND_ already propagated to the
destination CPU (in this case the local APIC of the destination). The CPU
has accepted the interrupt and now the chip is in a state where it waits
for it to be acknowledged. If we proceed in that state then the destination
CPU will eventually handle it _after_ all the resources are freed. But that
means that the in flight/wait for acknowledge state becomes stale because
the handling CPU does not find the connection to that chip anymore.

> > +		/*
> > +		 * If requested and supported, check at the chip whether it
> > +		 * is in flight at the hardware level:
> > +		 */
> > +		if (!inprogress && sync_chip && chip && chip->irq_inflight)
> > +			inprogress = chip->irq_inflight(irqd);
> 
> To expand on what I was trying to exptree above, I wonder if that would 
> be similar to in effect to:
> 
> 		if (!inprogress && sync_chip && chip && chip->irq_get_irqchip_state)
> 			chip->irq_get_irqchip_state(irqd, IRQCHIP_STATE_ACTIVE, &inprogress);

Ah, indeed that could be mapped to it.

I'm happy to get rid of the extra callback. Now the question is whether
this would would give an headache for any of the chips which already
implement that callback and whether it needs to become conditional on the
trigger type at the core level. For the IO-APIC this state is only defined
for level type which makes sense as edge is fire and forget.

Thanks,

	tglx

  reply	other threads:[~2019-06-28  9:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25 11:13 [patch 0/5] x86/irq: Cure various interrupt issues Thomas Gleixner
2019-06-25 11:13 ` [patch 1/5] genirq: Delay deactivation in free_irq() Thomas Gleixner
2019-06-28  7:42   ` Marc Zyngier
2019-06-28  9:28     ` Thomas Gleixner
2019-06-25 11:13 ` [patch 2/5] genirq: Add optional hardware synchronization for shutdown Thomas Gleixner
2019-06-26 13:03   ` Thomas Gleixner
2019-06-28  7:59   ` Marc Zyngier
2019-06-28  9:41     ` Thomas Gleixner [this message]
2019-06-25 11:13 ` [patch 3/5] x86/ioapic: Implement irq_inflight() callback Thomas Gleixner
2019-06-25 11:13 ` [patch 4/5] x86/irq: Handle spurious interrupt after shutdown gracefully Thomas Gleixner
2019-06-25 11:13 ` [patch 5/5] x86/irq: Seperate unused system vectors from spurious entry again Thomas Gleixner

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.1906281128310.1802@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=Robert.Hodaszi@digi.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=idosch@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=vadimp@mellanox.com \
    --cc=x86@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

all inboxes | Powered by JetHome®