public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rui Wang <rui.y.wang@intel.com>
To: daniel.vetter@ffwll.ch
Cc: bp@alien8.de, tony.luck@intel.com, airlied@redhat.com,
	robdclark@gmail.com, matthew.d.roper@intel.com,
	gong.chen@intel.com, linux-kernel@vger.kernel.org,
	Rui Wang <rui.y.wang@intel.com>
Subject: Re: drm/mgag200: doesn't work in panic context
Date: Wed,  1 Jul 2015 15:26:03 +0800	[thread overview]
Message-ID: <1435735563-5820-1-git-send-email-rui.y.wang@intel.com> (raw)

On Tuesday, June 30, 2015 11:24 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> On Tue, Jun 30, 2015 at 9:23 AM, Rui Wang <rui.y.wang@intel.com> wrote:
> > But einj does something more than what an IPI can do, it injects hardware
> > errors which trigger exceptions in NMI context... and the exception handler
> > usually panics on fatal errors. And the display may be the only way to catch
> > what has happened. I'm just hoping that the future version may work in
> > NMI context.
> 
> NMI sounds ... ambigous ;-) But yeah if we can somehow inject
> something as an NMI too then that would be even better. What I want to
> avoid is forcing reboots, since that means you can't run a basic
> modeset test afterwards to make sure nothing was trampled too badly.
> Of course we'd have replace the screen contents, but the important
> part is that the panic handler doen't touch anything if the driver is
> in modeset code right now (because it'll massively increase the risk
> of dying completely), and an easy way to check that it didn't step all
> over modeset state unduly is to do a modeset afterwards. If that works
> we'll be fine.
> 
> Also with that approach we can make sure that no real errors get into
> dmesg (as opposed to a real panic), which means we can capture dmesg
> afterwards and if there is a seroius log message (or even backtrace)
> then drm panic handling has a bug.
> 
> All that isn't possible when we force a real panic to happen.
> 
> Actually thinking more about NMI that shouldn't be a problem. The
> important thing with nmi vs. hardirq is that you can't even reliably
> grab an irqsave spinlock, it's trylocks all the way down. But that
> also holds for the panic handler, it's trylocks only. Could we somehow
> just check that using lockdep - is there an NMI lockdep context
> somewhere we could fake-grab? That's another upside of using an IPI
> btw: Real panics kill lockdep ;-)

Einj is supported by ACPI in combination with the hardwre. The injected
errors result in true MCEs, truly non-maskable. Lockdep might not be useful
in this case. Corrected Errors (CEs) don't result in panic but I guess it
might be possible to let it invoke your future mode-setting code for testing
purpose, without rebooting. (Notice that MCEs can happen right from inside
your mode-setting code while accessing any memory address)

But anyway we're not looking for a 100% working solution so if it could only
work in normal irq or ipi context, it'd already be a big plus compared to
what we have now.

Thanks
Rui


             reply	other threads:[~2015-07-01  7:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01  7:26 Rui Wang [this message]
2015-07-01  9:59 ` drm/mgag200: doesn't work in panic context Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2015-06-30  7:23 Rui Wang
2015-06-30 15:23 ` Daniel Vetter
2015-06-30  2:53 Rui Wang
2015-06-30  6:36 ` Daniel Vetter
2015-06-26  7:55 Rui Wang
2015-06-26  9:27 ` Daniel Vetter
2015-06-26 18:30   ` Luck, Tony
2015-06-27 13:52     ` Daniel Vetter
2015-06-27 14:12       ` Borislav Petkov
2015-06-27 17:56         ` Daniel Vetter
2015-06-29  8:09           ` Borislav Petkov
2015-06-29  9:25             ` Daniel Vetter
2015-06-29  9:42               ` Borislav Petkov
2015-06-29  9:58                 ` Daniel Vetter

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=1435735563-5820-1-git-send-email-rui.y.wang@intel.com \
    --to=rui.y.wang@intel.com \
    --cc=airlied@redhat.com \
    --cc=bp@alien8.de \
    --cc=daniel.vetter@ffwll.ch \
    --cc=gong.chen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.d.roper@intel.com \
    --cc=robdclark@gmail.com \
    --cc=tony.luck@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