All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Andrew Morton <akpm@linux-foundation.org>,
	Konstantin Khlebnikov <khlebnikov@openvz.org>
Subject: [PATCH] drm/fb-helper: don't sleep for screen unblank when an oopps is in progress
Date: Sun, 27 Jan 2013 18:42:42 +0100	[thread overview]
Message-ID: <1359308562-22165-1-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1359044448-3861-17-git-send-email-daniel.vetter@ffwll.ch>

Otherwise the system will burn even brighter and worse, leave the user
wondering what's going on exactly.

Since we already have a panic handler which will (try) to restore the
entire fbdev console mode, we can just bail out. Inspired by a patch
from Konstantin Khlebnikov. The callchain leading to this, cut&pasted
from Konstantin's original patch:

callstack:
panic()
bust_spinlocks(1)
unblank_screen()
vc->vc_sw->con_blank()
fbcon_blank()
fb_blank()
info->fbops->fb_blank()
drm_fb_helper_blank()
drm_fb_helper_dpms()
drm_modeset_lock_all()
mutex_lock(&dev->mode_config.mutex)

Note that the entire locking in the fb helper around panic/sysrq and
kdbg is ... non-existant. So we have a decent change of blowing up
everything. But since reworking this ties in with funny concepts like
the fbdev notifier chain or the impressive things which happen around
console_lock while oopsing, I'll leave that as an exercise for braver
souls than me.

v2: Drop the -EBUSY return value I've copied, we don't need it since
the we'll take care of things ourselves anyway.

Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
References: https://patchwork.kernel.org/patch/1878181/
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_fb_helper.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index a7538cc..01099b5 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -386,6 +386,14 @@ static void drm_fb_helper_dpms(struct fb_info *info, int dpms_mode)
 	int i, j;
 
 	/*
+	 * fbdev->blank can be called from irq context in case of a panic.
+	 * Since we already have our own special panic handler which will
+	 * restore the fbdev console mode completely, just bail out early.
+	 */
+	if (oops_in_progress)
+		return;
+
+	/*
 	 * For each CRTC in this fb, turn the connectors on/off.
 	 */
 	drm_modeset_lock_all(dev);
-- 
1.7.10.4

  reply	other threads:[~2013-01-27 17:42 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24 16:20 [PATCH 00/16] [RFC] drm fb helper cleanups Daniel Vetter
2013-01-24 16:20 ` [PATCH 01/16] omapdrm: only take crtc->mutex in crtc callbacks Daniel Vetter
2013-01-24 16:45   ` Rob Clark
2013-01-24 16:20 ` [PATCH 02/16] omapdrm: simply locking in the fb debugfs file Daniel Vetter
2013-01-24 16:46   ` Rob Clark
2013-01-24 16:20 ` [PATCH 03/16] drm: review locking for drm_fb_helper_restore_fbdev_mode Daniel Vetter
2013-02-11 22:10   ` Rob Clark
2013-01-24 16:20 ` [PATCH 04/16] drm/fb-helper: kill drm_fb_helper_restore Daniel Vetter
2013-02-11 22:08   ` Rob Clark
2013-01-24 16:20 ` [PATCH 05/16] drm/fb-helper: unexport drm_fb_helper_panic Daniel Vetter
2013-02-11 22:11   ` Rob Clark
2013-01-24 16:20 ` [PATCH 06/16] drm/fb-helper: inline drm_fb_helper_single_add_all_connectors Daniel Vetter
2013-01-24 21:27   ` Dave Airlie
2013-01-24 22:50     ` Daniel Vetter
2013-01-24 16:20 ` [PATCH 07/16] drm/fb-helper: unexport drm_fb_helper_single_fb_probe Daniel Vetter
2013-02-11 22:14   ` Rob Clark
2013-01-24 16:20 ` [PATCH 08/16] drm/tegra: don't set up initial fbcon config twice Daniel Vetter
2013-01-24 16:20 ` [PATCH 09/16] drm/fb-helper: don't disable everything in initial_config Daniel Vetter
2013-01-27 17:41   ` [PATCH] " Daniel Vetter
2013-02-12  0:49     ` Rob Clark
2013-01-24 16:20 ` [PATCH 10/16] drm/i915: rip out helper->disable noop functions Daniel Vetter
2013-01-24 16:20 ` [PATCH 11/16] drm/fb-helper: fixup up set_config semantics Daniel Vetter
2013-02-11 23:15   ` Rob Clark
2013-02-12  0:24     ` [PATCH] drm/fb-helper: fixup " Daniel Vetter
2013-02-12  0:24     ` [PATCH] drm/fb-helper: remove unused members of struct drm_fb_helper Daniel Vetter
2013-02-12  0:25     ` [PATCH] drm/fb-helper: fixup set_config semantics Daniel Vetter
2013-02-12  0:33       ` Rob Clark
2013-01-24 16:20 ` [PATCH 12/16] drm/fb-helper: directly call set_par from the hotplug handler Daniel Vetter
2013-02-12  0:16   ` Rob Clark
2013-01-24 16:20 ` [PATCH 13/16] drm/fb-helper: streamline drm_fb_helper_single_fb_probe Daniel Vetter
2013-02-12  0:24   ` Rob Clark
2013-02-12  0:33     ` Daniel Vetter
2013-02-12  0:35       ` Rob Clark
2013-01-24 16:20 ` [PATCH 14/16] drm/<drivers>: simplify ->fb_probe callback Daniel Vetter
2013-02-13 21:51   ` Rob Clark
2013-01-24 16:20 ` [PATCH 15/16] drm/fb-helper: improve kerneldoc Daniel Vetter
2013-01-27 17:42   ` [PATCH] " Daniel Vetter
2013-02-01 12:21     ` Laurent Pinchart
2013-02-05 21:43       ` Daniel Vetter
2013-01-24 16:20 ` [PATCH 16/16] drm/fb-helper: don't sleep for screen unblank when an oopps is in progress Daniel Vetter
2013-01-27 17:42   ` Daniel Vetter [this message]
2013-02-13 21:59     ` [PATCH] " Rob Clark
2013-01-24 16:53 ` [PATCH 00/16] [RFC] drm fb helper cleanups Rob Clark
2013-01-24 21:00   ` Greg KH

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=1359308562-22165-1-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=akpm@linux-foundation.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=khlebnikov@openvz.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.