linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: kexec: EOI active and mask all interrupts in	kexec crash path
Date: Wed, 18 Jan 2012 15:48:09 +0000	[thread overview]
Message-ID: <20120118154809.GL29346@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <20120118154044.GJ1068@n2100.arm.linux.org.uk>

On Wed, Jan 18, 2012 at 03:40:44PM +0000, Russell King - ARM Linux wrote:
> On Wed, Jan 18, 2012 at 03:31:20PM +0000, Will Deacon wrote:
> > On Wed, Jan 18, 2012 at 03:07:24PM +0000, Russell King - ARM Linux wrote:
> > > On Wed, Jan 18, 2012 at 03:01:25PM +0000, Will Deacon wrote:
> > > > The kexec machine crash code can be called in interrupt context via a
> > > > sysrq trigger made using the magic key combination. If the irq chip
> > > > dealing with the serial interrupt is using the fasteoi flow handler,
> > > > then we will never EOI the interrupt because the interrupt handler will
> > > > be fatal. In the case of a GIC, this results in the crash kernel not
> > > > receiving interrupts on that CPU interface.
> > > > 
> > > > This patch adds code (based on the PowerPC implementation) to EOI any
> > > > pending interrupts on the crash CPU before masking and disabling all
> > > > interrupts. Secondary cores are not a problem since they are placed into
> > > > a cpu_relax() loop via an IPI.
> > > 
> > > So, what happens if we fault in an interrupt handler, we have
> > > panic_on_oops set, and we have panic configured to automatically
> > > reboot after a period?
> > 
> > If we fault in an interrupt handler, we'll end up with the faulting CPU in
> > machine_crash_shutdown, with the secondaries getting put into
> > machine_crash_nonpanic_core. Then the faulting CPU will EOI the interrupt it
> > was previously handling, before masking it.
> 
> How does the faulting interrupt get EOI'd?  If we've faulted in an
> interrupt handler, we don't return to the interrupt handler to complete
> the handling.

That's what the new machine_kexec_mask_interrupts is supposed to do. It
iterates over all of the irq_descs and does:

	if (chip->irq_eoi && irqd_irq_inprogress(&desc->irq_data))
		chip->irq_eoi(&desc->irq_data);

This is called from machine_crash_shutdown, so we should pick up the
previous interrupt there without having to return to the handler.

> > The problem with that is working out which interrupts to EOI, on which
> > CPU interfaces and in which order. The GIC manual states that EOIing an
> > interrupt which hasn't been previously acked on that interface is
> > UNPREDICTABLE.
> 
> Is there no way to re-initialize the gic after an interrupt has begun
> to be processed, but not EOI'd ?

Unfortunately, I'm not aware of anything like this (I was hoping for some
reset functionality). I'll double check that I didn't miss anything, but it
seems that you can't reset the GIC state machine without manually putting it
all back.

Will

  reply	other threads:[~2012-01-18 15:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 15:01 [PATCH] ARM: kexec: EOI active and mask all interrupts in kexec crash path Will Deacon
2012-01-18 15:07 ` Russell King - ARM Linux
2012-01-18 15:31   ` Will Deacon
2012-01-18 15:40     ` Russell King - ARM Linux
2012-01-18 15:48       ` Will Deacon [this message]
2012-01-19 13:33         ` Will Deacon

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=20120118154809.GL29346@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --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).