mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: linux-kernel@vger.kernel.org
Cc: kgdb-bugreport@lists.sourceforge.net, kdb@oss.sgi.com,
	mingo@elte.hu, Jason Wessel <jason.wessel@windriver.com>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	David Airlie <airlied@linux.ie>
Subject: [PATCH 36/37] drm,i915 - atomic mutex hacks
Date: Wed, 23 Dec 2009 15:43:03 -0600	[thread overview]
Message-ID: <1261604584-5796-4-git-send-email-jason.wessel@windriver.com> (raw)
In-Reply-To: <1261604584-5796-3-git-send-email-jason.wessel@windriver.com>

Here are some hacks to work around mutex crashes in the drm / i915
code.

For now, this is the only way to make the kms / kgdb path safe on an
SMP system.

CC: Jesse Barnes <jbarnes@virtuousgeek.org>
CC: David Airlie <airlied@linux.ie>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 drivers/gpu/drm/drm_fb_helper.c      |   18 ++++++++++++++++++
 drivers/gpu/drm/i915/intel_display.c |   21 +++++++++++++++++++++
 2 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index b390fd8..ac9ca4a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -400,8 +400,14 @@ static void drm_fb_helper_on(struct fb_info *info)
 			    !crtc->enabled)
 				continue;
 
+#ifdef CONFIG_KGDB
+			if (atomic_read(&kgdb_active) == -1)
+#endif
 			mutex_lock(&dev->mode_config.mutex);
 			crtc_funcs->dpms(crtc, DRM_MODE_DPMS_ON);
+#ifdef CONFIG_KGDB
+			if (atomic_read(&kgdb_active) == -1)
+#endif
 			mutex_unlock(&dev->mode_config.mutex);
 
 			/* Found a CRTC on this fb, now find encoders */
@@ -410,8 +416,14 @@ static void drm_fb_helper_on(struct fb_info *info)
 					struct drm_encoder_helper_funcs *encoder_funcs;
 
 					encoder_funcs = encoder->helper_private;
+#ifdef CONFIG_KGDB
+					if (atomic_read(&kgdb_active) == -1)
+#endif
 					mutex_lock(&dev->mode_config.mutex);
 					encoder_funcs->dpms(encoder, DRM_MODE_DPMS_ON);
+#ifdef CONFIG_KGDB
+					if (atomic_read(&kgdb_active) == -1)
+#endif
 					mutex_unlock(&dev->mode_config.mutex);
 				}
 			}
@@ -828,8 +840,14 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
 		modeset->y = var->yoffset;
 
 		if (modeset->num_connectors) {
+#ifdef CONFIG_KGDB
+			if (atomic_read(&kgdb_active) == -1)
+#endif
 			mutex_lock(&dev->mode_config.mutex);
 			ret = crtc->funcs->set_config(modeset);
+#ifdef CONFIG_KGDB
+			if (atomic_read(&kgdb_active) == -1)
+#endif
 			mutex_unlock(&dev->mode_config.mutex);
 			if (!ret) {
 				info->var.xoffset = var->xoffset;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 71816db..669f9b4 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -949,6 +949,12 @@ intel_find_pll_g4x_dp(const intel_limit_t *limit, struct drm_crtc *crtc,
 void
 intel_wait_for_vblank(struct drm_device *dev)
 {
+#ifdef CONFIG_KGDB
+	if (atomic_read(&kgdb_active) != -1) {
+		mdelay(20);
+		return;
+	}
+#endif /* CONFIG_KGDB */
 	/* Wait for 20ms, i.e. one cycle at 50hz. */
 	msleep(20);
 }
@@ -1371,9 +1377,15 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 	obj = intel_fb->obj;
 	obj_priv = obj->driver_private;
 
+#ifdef CONFIG_KGDB
+	if (atomic_read(&kgdb_active) == -1)
+#endif
 	mutex_lock(&dev->struct_mutex);
 	ret = intel_pin_and_fence_fb_obj(dev, obj);
 	if (ret != 0) {
+#ifdef CONFIG_KGDB
+		if (atomic_read(&kgdb_active) == -1)
+#endif
 		mutex_unlock(&dev->struct_mutex);
 		return ret;
 	}
@@ -1381,6 +1393,9 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 	ret = i915_gem_object_set_to_gtt_domain(obj, 1);
 	if (ret != 0) {
 		i915_gem_object_unpin(obj);
+#ifdef CONFIG_KGDB
+		if (atomic_read(&kgdb_active) == -1)
+#endif
 		mutex_unlock(&dev->struct_mutex);
 		return ret;
 	}
@@ -1408,6 +1423,9 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 	default:
 		DRM_ERROR("Unknown color depth\n");
 		i915_gem_object_unpin(obj);
+#ifdef CONFIG_KGDB
+	if (atomic_read(&kgdb_active) == -1)
+#endif
 		mutex_unlock(&dev->struct_mutex);
 		return -EINVAL;
 	}
@@ -1452,6 +1470,9 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 	}
 	intel_increase_pllclock(crtc, true);
 
+#ifdef CONFIG_KGDB
+	if (atomic_read(&kgdb_active) == -1)
+#endif
 	mutex_unlock(&dev->struct_mutex);
 
 	if (!dev->primary->master)
-- 
1.6.4.rc1


  reply	other threads:[~2009-12-23 21:44 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-23 21:19 [PATCH 0/37] kgdb, kdb and atomic kernel modesetting series Jason Wessel
2009-12-23 21:19 ` [PATCH 01/37] softlockup: add sched_clock_tick() to avoid kernel warning on kgdb resume Jason Wessel
2009-12-23 21:19   ` [PATCH 02/37] x86,hw_breakpoint,kgdb: kgdb to use hw_breakpoint API Jason Wessel
2009-12-23 21:19     ` [PATCH 03/37] Move kernel/kgdb.c to kernel/debug/debug_core.c Jason Wessel
2009-12-23 21:19       ` [PATCH 04/37] Separate the gdbstub from the debug core Jason Wessel
2009-12-23 21:19         ` [PATCH 05/37] kdb: core for kgdb back end Jason Wessel
2009-12-23 21:19           ` [PATCH 06/37] kgdb: eliminate kgdb_wait(), all cpus enter the same way Jason Wessel
2009-12-23 21:19             ` [PATCH 07/37] kgdb,sparc: Add in kgdb_arch_set_pc for sparc Jason Wessel
2009-12-23 21:19               ` [PATCH 08/37] kgdb,sh: update superh kgdb exception handling Jason Wessel
2009-12-23 21:19                 ` [PATCH 09/37] kgdb,blackfin: Add in kgdb_arch_set_pc for blackfin Jason Wessel
2009-12-23 21:19                   ` [PATCH 10/37] kgdb: Make mem access function weak in kgdb.c and kgdb.h Jason Wessel
2009-12-23 21:19                     ` [PATCH 11/37] kgdb: Fix kernel-doc format error in kgdb.h Jason Wessel
2009-12-23 21:19                       ` [PATCH 12/37] kgdb: core changes to support kdb Jason Wessel
2009-12-23 21:19                         ` [PATCH 13/37] kgdb,8250,pl011: Return immediately from console poll Jason Wessel
2009-12-23 21:19                           ` [PATCH 14/37] sh,sh-sci: Use NO_POLL_CHAR in the SCIF polled console code Jason Wessel
2009-12-23 21:19                             ` [PATCH 15/37] sparc,sunzilog: Add console polling support for sunzilog serial driver Jason Wessel
2009-12-23 21:19                               ` [PATCH 16/37] kgdb: gdb "monitor" -> kdb passthrough Jason Wessel
2009-12-23 21:19                                 ` [PATCH 17/37] kgdboc,keyboard: Keyboard driver for kdb with kgdb Jason Wessel
2009-12-23 21:19                                   ` [PATCH 18/37] kgdb: remove post_primary_code references Jason Wessel
2009-12-23 21:19                                     ` [PATCH 19/37] x86,kgdb: Add low level debug hook Jason Wessel
2009-12-23 21:19                                       ` [PATCH 20/37] arm,kgdb: Add hook to catch an oops with debugger Jason Wessel
2009-12-23 21:19                                         ` [PATCH 21/37] powerpc,kgdb: Introduce low level trap catching Jason Wessel
2009-12-23 21:19                                           ` [PATCH 22/37] mips,kgdb: kdb low level trap catch and stack trace Jason Wessel
2009-12-23 21:19                                             ` [PATCH 23/37] kgdb: Add the ability to schedule a breakpoint via a tasklet Jason Wessel
2009-12-23 21:19                                               ` [PATCH 24/37] kgdboc,kdb: Allow kdb to work on a non open console port Jason Wessel
2009-12-23 21:19                                                 ` [PATCH 25/37] printk,kdb: capture printk() when in kdb shell Jason Wessel
2009-12-23 21:19                                                   ` [PATCH 26/37] keyboard, input: Add hook to input to allow low level event clear Jason Wessel
2009-12-23 21:19                                                     ` [PATCH 27/37] debug_core,kdb: Allow the debug core to process a recursive debug entry Jason Wessel
2009-12-23 21:19                                                       ` [PATCH 28/37] kdb,panic,debug_core: Allow the debug core to receive a panic before smp_send_stop() Jason Wessel
2009-12-23 21:19                                                         ` [PATCH 29/37] MAINTAINERS: update kgdb, kdb, and debug_core info Jason Wessel
2009-12-23 21:19                                                           ` [PATCH 30/37] kgdboc,debug_core: Add call backs to allow kernel mode switching Jason Wessel
2009-12-23 21:19                                                             ` [PATCH 31/37] kgdb: add ops arg to kgdb console active & restore hooks Jason Wessel
2009-12-23 21:19                                                               ` [PATCH 32/37] kms,kdb: Force unblank a console device Jason Wessel
2009-12-23 21:43                                                                 ` [PATCH 33/37] drm: add KGDB/KDB support Add support for KDB entry/exit Jason Wessel
2009-12-23 21:43                                                                   ` [PATCH 34/37] i915: when kgdb is active display compression should be off Jason Wessel
2009-12-23 21:43                                                                     ` [PATCH 35/37] drm_fb_helper: Preserve capability to use atomic kms Jason Wessel
2009-12-23 21:43                                                                       ` Jason Wessel [this message]
2009-12-23 21:43                                                                         ` [PATCH 37/37] kgdbts,sh: Add in breakpoint pc offset for superh Jason Wessel
2009-12-24  3:58                                                                           ` Paul Mundt
2010-01-04 17:23                                                                   ` [PATCH 33/37] drm: add KGDB/KDB support Add support for KDB entry/exit Jesse Barnes
2009-12-23 21:50                               ` [PATCH 15/37] sparc,sunzilog: Add console polling support for sunzilog serial driver David Miller
2009-12-23 21:54                                 ` Jason Wessel
2009-12-23 22:00                                   ` David Miller
2009-12-24  6:08                             ` [PATCH 14/37] sh,sh-sci: Use NO_POLL_CHAR in the SCIF polled console code Paul Mundt
2009-12-26 21:07                     ` [PATCH 10/37] kgdb: Make mem access function weak in kgdb.c and kgdb.h Mike Frysinger
2009-12-26 21:12                   ` [PATCH 09/37] kgdb,blackfin: Add in kgdb_arch_set_pc for blackfin Mike Frysinger
2009-12-28  9:49                     ` Zhang, Sonic
2009-12-28  9:57                     ` Zhang, Sonic
2009-12-28 10:17                     ` Zhang, Sonic
2009-12-31  2:45                       ` Sonic Zhang
2010-01-06 19:43                         ` [Kgdb-bugreport] " Jason Wessel
2010-01-06 20:08                           ` Mike Frysinger
2010-01-06 20:34                             ` Jason Wessel
2010-01-06 20:39                               ` Mike Frysinger
2010-01-06 22:40                                 ` Jason Wessel
2010-01-07  6:27                                   ` Mike Frysinger
2010-01-07  3:50                           ` Zhang, Sonic
2009-12-24  6:07                 ` [PATCH 08/37] kgdb,sh: update superh kgdb exception handling Paul Mundt
2009-12-23 21:48               ` [PATCH 07/37] kgdb,sparc: Add in kgdb_arch_set_pc for sparc David Miller
2009-12-23 23:04                 ` Jason Wessel
2009-12-24  4:42                   ` David Miller
2009-12-24  1:28           ` [PATCH 05/37] kdb: core for kgdb back end Andi Kleen
2009-12-28 22:36             ` Jason Wessel
2009-12-28 23:37               ` Andi Kleen
2009-12-24 11:01           ` Peter Zijlstra
2009-12-24 11:16             ` Peter Zijlstra
2009-12-24 15:57               ` Jason Wessel
2009-12-26 21:34                 ` Mike Frysinger
2009-12-24 11:55             ` Jason Wessel
2009-12-24 12:01               ` Peter Zijlstra
2009-12-24 11:04           ` Peter Zijlstra
2009-12-28 16:33             ` Jason Wessel
2009-12-28 16:55               ` Peter Zijlstra
2009-12-28 17:15                 ` Jason Wessel
2009-12-24  0:56 ` [PATCH 0/37] kgdb, kdb and atomic kernel modesetting series Greg KH
2009-12-24  3:55   ` [Kgdb-bugreport] [PATCH 0/37] kgdb,kdb " Jason Wessel

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=1261604584-5796-4-git-send-email-jason.wessel@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=airlied@linux.ie \
    --cc=jbarnes@virtuousgeek.org \
    --cc=kdb@oss.sgi.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®