Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Andrew Lutomirski <luto@mit.edu>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [ANNOUNCE] xf86-video-intel 2.11.901
Date: Wed, 23 Jun 2010 09:07:59 -0700	[thread overview]
Message-ID: <20100623090759.39ae2fb2@virtuousgeek.org> (raw)
In-Reply-To: <AANLkTintMOSC8muISDrtZyXJrIgZs9T9G1gghJvc2qnL@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1972 bytes --]

On Mon, 21 Jun 2010 16:32:48 -0400
Andrew Lutomirski <luto@mit.edu> wrote:

> On Sun, Jun 20, 2010 at 11:29 AM, Andrew Lutomirski <luto@mit.edu> wrote:
> > On Fri, Jun 18, 2010 at 4:04 PM, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> >> On Thu, 17 Jun 2010 19:44:10 -0700
> >> Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> >>
> >>> On Fri, 18 Jun 2010 02:20:23 +0200
> >>> Marc Deop i Argemí <damnshock@gmail.com> wrote:
> >>>
> >>> > On Friday June 18 2010 02:17:53 Andrew Lutomirski wrote:
> >>> > > Neither patch applies for me.
> >>> >
> >>> > One of them do apply for me, the other one doesn't.
> >>> >
> >>> > Testing done on latest 2.6.35-rc3, the building fails.
> >>>
> >>> Arg, ok, I'll refresh them and post new ones tomorrow.
> >>
> >> Ok here are some updated ones.
> >
> > Running these patches on 2.6.35-rc3 (plus the brown-paper-bag TCP fix,
> > plus my hotplug_mask hack, plus my CRT regression fix) with
> > xf86-video-intel be55066c6481b4c5e2cd39ef1c0f3be88cae0c93 (which is
> > about a day old) seems stable and I don't have any visible corruption.
> 
> Just froze again.  I moved my mouse and the screen turned black except
> for the mouse cursor and a little underscore in the top left that
> looked like the fbcon cursor.
> 
> Again, magic sysrq didn't work, which I'd imagine would help narrow
> things down (presumably, no matter how hard the graphics hardware gets
> wedged, magic sysrq should still work).

Yeah means the GMCH itself probably hung, possibly not responding to
memory requests from the CPU.

The display was otherwise idle when it froze?  The behavior you
describe sounds like a panic; there's a patch available to get some
more info in that case: "vt/console: try harder to print output when
panicing" that Dave Airlie just posted (attached).  Can you apply it as
well and see if you can reproduce the problem?

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center

[-- Attachment #2: [PATCH] vt_console: try harder to print output when panicing --]
[-- Type: application/octet-stream, Size: 9136 bytes --]

Received: from virtuous by box514.bluehost.com with local-bsmtp (Exim 4.69)
	(envelope-from <airlied@gmail.com>)
	id 1ORH4U-0000lP-JB
	for jbarnes@virtuousgeek.org; Tue, 22 Jun 2010 21:56:19 -0600
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on box514.bluehost.com
X-Spam-Level: 
X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL
	shortcircuit=no autolearn=ham version=3.3.0
Received: from mx1.redhat.com ([209.132.183.28])
	by box514.bluehost.com with esmtp (Exim 4.69)
	(envelope-from <airlied@gmail.com>)
	id 1ORH4U-0000kR-Ac
	for jbarnes@virtuousgeek.org; Tue, 22 Jun 2010 21:56:18 -0600
Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21])
	by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5N3u8A1028985
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 22 Jun 2010 23:56:09 -0400
Received: from clockmaker-el6.bne.redhat.com (dhcp-0-222.bne.redhat.com [10.64.0.222])
	by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5N3Cx4r005867;
	Tue, 22 Jun 2010 23:13:00 -0400
From: Dave Airlie <airlied@gmail.com>
To: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.sf.net, linux-kernel@vger.kernel.org,
        Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: [PATCH] vt/console: try harder to print output when panicing
Date: Wed, 23 Jun 2010 13:12:59 +1000
Message-Id: <1277262779-19338-1-git-send-email-airlied@gmail.com>
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21
X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:spamassassin for local delivery to identified user}

From: Jesse Barnes <jbarnes@virtuousgeek.org>

Jesse's initial patch commit said:

"At panic time (i.e. when oops_in_progress is set) we should try a bit
harder to update the screen and make sure output gets to the VT, since
some drivers are capable of flipping back to it.

So make sure we try to unblank and update the display if called from a
panic context."

I've enhanced this to add a flag to the vc that console layer can set
to indicate they want this behaviour to occur. This also adds support
to fbcon for that flag and adds an fb flag for drivers to indicate
they want to use the support. It enables this for KMS drivers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/char/vt.c                       |   13 +++++++++----
 drivers/gpu/drm/i915/intel_fb.c         |    4 +---
 drivers/gpu/drm/nouveau/nouveau_fbcon.c |    1 +
 drivers/gpu/drm/radeon/radeon_fb.c      |    2 +-
 drivers/video/console/fbcon.c           |    4 +++-
 include/linux/console_struct.h          |    1 +
 include/linux/fb.h                      |    4 ++++
 include/linux/vt_kern.h                 |    7 +++++++
 8 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 7cdb6ee..6e04c9e 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -698,7 +698,10 @@ void redraw_screen(struct vc_data *vc, int is_switch)
 			update_attr(vc);
 			clear_buffer_attributes(vc);
 		}
-		if (update && vc->vc_mode != KD_GRAPHICS)
+
+		/* Forcibly update if we're panicing */
+		if ((update && vc->vc_mode != KD_GRAPHICS) ||
+		    vt_force_oops_output(vc))
 			do_update_region(vc, vc->vc_origin, vc->vc_screenbuf_size / 2);
 	}
 	set_cursor(vc);
@@ -736,6 +739,7 @@ static void visual_init(struct vc_data *vc, int num, int init)
 	vc->vc_hi_font_mask = 0;
 	vc->vc_complement_mask = 0;
 	vc->vc_can_do_color = 0;
+	vc->vc_panic_force_write = false;
 	vc->vc_sw->con_init(vc, init);
 	if (!vc->vc_complement_mask)
 		vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
@@ -2498,7 +2502,7 @@ static void vt_console_print(struct console *co, const char *b, unsigned count)
 		goto quit;
 	}
 
-	if (vc->vc_mode != KD_TEXT)
+	if (vc->vc_mode != KD_TEXT && !vt_force_oops_output(vc))
 		goto quit;
 
 	/* undraw cursor first */
@@ -3703,7 +3707,8 @@ void do_unblank_screen(int leaving_gfx)
 		return;
 	}
 	vc = vc_cons[fg_console].d;
-	if (vc->vc_mode != KD_TEXT)
+	/* Try to unblank in oops case too */
+	if (vc->vc_mode != KD_TEXT && !vt_force_oops_output(vc))
 		return; /* but leave console_blanked != 0 */
 
 	if (blankinterval) {
@@ -3712,7 +3717,7 @@ void do_unblank_screen(int leaving_gfx)
 	}
 
 	console_blanked = 0;
-	if (vc->vc_sw->con_blank(vc, 0, leaving_gfx))
+	if (vc->vc_sw->con_blank(vc, 0, leaving_gfx) || vt_force_oops_output(vc))
 		/* Low-level driver cannot restore -> do it ourselves */
 		update_screen(vc);
 	if (console_blank_hook)
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index c3c5052..bd5d87a 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -128,7 +128,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
 
 	strcpy(info->fix.id, "inteldrmfb");
 
-	info->flags = FBINFO_DEFAULT;
+	info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
 	info->fbops = &intelfb_ops;
 
 	/* setup aperture base/size for vesafb takeover */
@@ -146,8 +146,6 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
 	info->fix.smem_start = dev->mode_config.fb_base + obj_priv->gtt_offset;
 	info->fix.smem_len = size;
 
-	info->flags = FBINFO_DEFAULT;
-
 	info->screen_base = ioremap_wc(dev->agp->base + obj_priv->gtt_offset,
 				       size);
 	if (!info->screen_base) {
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index c9a4a0d..9b2d3b7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -250,6 +250,7 @@ nouveau_fbcon_create(struct nouveau_fbdev *nfbdev,
 		info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA |
 			      FBINFO_HWACCEL_FILLRECT |
 			      FBINFO_HWACCEL_IMAGEBLIT;
+	info->flags |= FBINFO_CAN_FORCE_OUTPUT;
 	info->fbops = &nouveau_fbcon_ops;
 	info->fix.smem_start = dev->mode_config.fb_base + nvbo->bo.offset -
 			       dev_priv->vm_vram_base;
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index dc1634b..dbf8696 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -224,7 +224,7 @@ static int radeonfb_create(struct radeon_fbdev *rfbdev,
 
 	drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
 
-	info->flags = FBINFO_DEFAULT;
+	info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
 	info->fbops = &radeonfb_ops;
 
 	tmp = radeon_bo_gpu_offset(rbo) - rdev->mc.vram_start;
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index b0a3fa0..7eadb35 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -283,7 +283,8 @@ static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info)
 	struct fbcon_ops *ops = info->fbcon_par;
 
 	return (info->state != FBINFO_STATE_RUNNING ||
-		vc->vc_mode != KD_TEXT || ops->graphics);
+		vc->vc_mode != KD_TEXT || ops->graphics) &&
+		!vt_force_oops_output(vc);
 }
 
 static inline int get_color(struct vc_data *vc, struct fb_info *info,
@@ -1073,6 +1074,7 @@ static void fbcon_init(struct vc_data *vc, int init)
 	if (p->userfont)
 		charcnt = FNTCHARCNT(p->fontdata);
 
+	vc->vc_panic_force_write = !!(info->flags & FBINFO_CAN_FORCE_OUTPUT);
 	vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1);
 	vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
 	if (charcnt == 256) {
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index 38fe59d..d7d9acd 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -105,6 +105,7 @@ struct vc_data {
 	struct vc_data **vc_display_fg;		/* [!] Ptr to var holding fg console for this display */
 	unsigned long	vc_uni_pagedir;
 	unsigned long	*vc_uni_pagedir_loc;  /* [!] Location of uni_pagedir variable for this console */
+	bool vc_panic_force_write; /* when oops/panic this VC can accept forced output/blanking */
 	/* additional information is in vt_kern.h */
 };
 
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 8e5a9df..25f4950 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -812,6 +812,10 @@ struct fb_tile_ops {
  */
 #define FBINFO_BE_MATH  0x100000
 
+/* report to the VT layer that this fb driver can accept forced console
+   output like oopses */
+#define FBINFO_CAN_FORCE_OUTPUT     0x200000
+
 struct fb_info {
 	int node;
 	int flags;
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 7f56db4..56cce34 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -100,6 +100,13 @@ extern int unbind_con_driver(const struct consw *csw, int first, int last,
 			     int deflt);
 int vty_init(const struct file_operations *console_fops);
 
+static inline bool vt_force_oops_output(struct vc_data *vc)
+{
+	if (oops_in_progress && vc->vc_panic_force_write)
+		return true;
+	return false;
+}
+
 /*
  * vc_screen.c shares this temporary buffer with the console write code so that
  * we can easily avoid touching user space while holding the console spinlock.
-- 
1.7.1



[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2010-06-23 16:09 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-15  0:39 [ANNOUNCE] xf86-video-intel 2.11.901 Carl Worth
2010-06-15  9:18 ` Julien Cristau
2010-06-15 16:46   ` Carl Worth
2010-06-15 16:51     ` Julien Cristau
2010-06-15 17:16   ` Sergio Monteiro Basto
2010-06-15 17:31     ` Julien Cristau
2010-06-15 17:46       ` Sergio Monteiro Basto
2010-06-15 14:05 ` Marc Deop i Argemí
2010-06-15 14:18   ` Julien Cristau
2010-06-15 15:02     ` Marc Deop i Argemí
2010-06-15 16:47   ` Carl Worth
2010-06-15 17:12     ` Marc Deop i Argemí
2010-06-15 21:23       ` Carl Worth
2010-06-16  8:45         ` Marc Deop i Argemí
2010-06-16 13:10           ` Marc Deop i Argemí
2010-06-16 13:57             ` Chris Wilson
2010-06-16 16:12               ` Marc Deop i Argemí
2010-06-17 13:30                 ` Marc Deop i Argemí
2010-06-17 21:34     ` Elias Gabriel Amaral da Silva
2010-06-18  6:09       ` Carl Worth
2010-06-21  5:09         ` Elias Gabriel Amaral da Silva
2010-06-21  6:08           ` Elias Gabriel Amaral da Silva
2010-06-21  6:37             ` Christopher James Halse Rogers
2010-06-22 18:42               ` Elias Gabriel Amaral da Silva
2010-06-21  5:31         ` Elias Gabriel Amaral da Silva
2010-06-25  6:23           ` Carl Worth
2010-06-25  8:53             ` Clemens Eisserer
2010-06-16  9:20   ` Chris Wilson
2010-06-16 11:25     ` Marc Deop i Argemí
2010-06-16 11:38       ` Andrew Lutomirski
2010-06-16 15:07         ` Andrew Lutomirski
2010-06-17 20:32           ` Jesse Barnes
2010-06-17 22:27             ` Marc Deop i Argemí
2010-06-18  0:17             ` Andrew Lutomirski
2010-06-18  0:20               ` Marc Deop i Argemí
2010-06-18  2:44                 ` Jesse Barnes
2010-06-18 20:04                   ` Jesse Barnes
2010-06-18 20:07                     ` Jesse Barnes
2010-06-19 16:35                     ` Marc Deop i Argemí
2010-06-20 15:29                     ` Andrew Lutomirski
2010-06-21 20:32                       ` Andrew Lutomirski
2010-06-23 16:07                         ` Jesse Barnes [this message]
2010-07-01 20:55                           ` Andrew Lutomirski
2010-07-01 21:21                             ` Jesse Barnes
2010-07-01 21:34                               ` Andrew Lutomirski
2010-06-15 14:54 ` Vasily Khoruzhick
2010-06-15 16:49   ` Carl Worth
2010-06-15 16:55     ` Vasily Khoruzhick
2010-06-15 17:36       ` Vasily Khoruzhick
2010-06-15 19:58   ` Clemens Eisserer
2010-06-15 20:15     ` Chris Wilson
2010-06-15 21:03       ` Clemens Eisserer
2010-06-15 21:26         ` Carl Worth
2010-06-15 21:40         ` Chris Wilson
2010-06-15 22:05           ` Clemens Eisserer
2010-06-15 22:24             ` Clemens Eisserer
2010-06-15 22:31             ` Chris Wilson
2010-06-15 22:56               ` Clemens Eisserer
2010-06-16  5:45       ` Vasily Khoruzhick

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=20100623090759.39ae2fb2@virtuousgeek.org \
    --to=jbarnes@virtuousgeek.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=luto@mit.edu \
    /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