LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Kernel Testers List" <kernel-testers@vger.kernel.org>,
	"Dave Airlie" <airlied@redhat.com>,
	DRI <dri-devel@lists.sourceforge.net>,
	"Michel Dänzer" <michel@daenzer.net>,
	"Sitsofe Wheeler" <sitsofe@yahoo.com>
Subject: Re: [Bug #12765] i915 VT switch with AIGLX causes X lock up
Date: Mon, 27 Apr 2009 09:46:51 -0700
Message-ID: <20090427094651.7cc09227@hobbes> (raw)
In-Reply-To: <egHshlwQQFE.A.X4D.-qE9JB@chimera>

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

On Sun, 26 Apr 2009 11:46:26 +0200 (CEST)
"Rafael J. Wysocki" <rjw@sisk.pl> wrote:

> This message has been generated automatically as a part of a report
> of regressions introduced between 2.6.28 and 2.6.29.
> 
> The following bug entry is on the current list of known regressions
> introduced between 2.6.28 and 2.6.29.  Please verify if it still
> should be listed and let me know (either way).
> 
> 
> Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=12765
> Subject		: i915 VT switch with AIGLX causes X lock up
> Submitter	: Sitsofe Wheeler <sitsofe@yahoo.com>
> Date		: 2009-02-21 15:38 (65 days old)
> First-Bad-Commit:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=14d200c5e5bd19219d930bbb9a5a22758c8f5bec
> References	:
> http://marc.info/?l=linux-kernel&m=123523074304955&w=4

I think we had a workaround for this (attached), but it sounds like
Robert has tracked down the root cause (search for "Broken vblanks on
Intel" on dri-devel@lists.sourceforge.net).  Will try to get the fix
into the Intel driver soon.  Fortunately this doesn't seem to be biting
a lot of people (at least not that I've heard); I certainly have a hard
time reproducing it.

-- 
Jesse Barnes, Intel Open Source Technology Center

[-- Attachment #2: drm-vblank-wait-fix.patch --]
[-- Type: text/x-patch, Size: 1372 bytes --]

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 69aa0ab..c41cba4 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -341,7 +341,7 @@ int drm_control(struct drm_device *dev, void *data,
  * vblank events since the system was booted, including lost events due to
  * modesetting activity.
  */
-u32 drm_vblank_count(struct drm_device *dev, int crtc)
+unsigned int drm_vblank_count(struct drm_device *dev, int crtc)
 {
 	return atomic_read(&dev->_vblank_count[crtc]);
 }
@@ -522,6 +522,11 @@ out:
 	return ret;
 }
 
+#define frame_after_eq(a,b)	       \
+	(typecheck(unsigned int, a) && \
+	 typecheck(unsigned int, b) && \
+	 ((int)(a) - (int)(b) >= 0))
+
 /**
  * Wait for VBLANK.
  *
@@ -589,10 +594,12 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
 	DRM_DEBUG("waiting on vblank count %d, crtc %d\n",
 		  vblwait->request.sequence, crtc);
 	dev->last_vblank_wait[crtc] = vblwait->request.sequence;
+
+	/* Wait for the sequence number to pass or IRQs to get disabled */
 	DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ,
-		    (((drm_vblank_count(dev, crtc) -
-		       vblwait->request.sequence) <= (1 << 23)) ||
-		     !dev->irq_enabled));
+		    frame_after_eq(drm_vblank_count(dev, crtc),
+				   vblwait->request.sequence) ||
+		    !dev->irq_enabled);
 
 	if (ret != -EINTR) {
 		struct timeval now;

  reply index

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-26  9:42 2.6.30-rc3-git1: Reported regressions 2.6.28 -> 2.6.29 Rafael J. Wysocki
2009-04-26  9:42 ` [Bug #12490] ath5k related kernel panic in 2.6.29-rc1 Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #12705] X200: Brightness broken since 2.6.29-rc4-58-g4c098bc Rafael J. Wysocki
2009-04-26 20:15   ` Nico Schottelius
2009-04-26 23:18     ` Rafael J. Wysocki
2009-04-30  8:00       ` Nico Schottelius
2009-04-26  9:46 ` [Bug #12681] s2ram: fails to wake up on Acer Extensa 4220 (SMP disabled) Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #12499] Problem with using bluetooth adaper connected to usb port Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #12947] r128: system hangs when X is started with DRI enabled Rafael J. Wysocki
2009-04-26 15:07   ` Angel
2009-04-26 17:43     ` Rafael J. Wysocki
2009-04-27 18:12       ` Jos van der Ende
2009-04-28 21:49         ` Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #12909] boot/kernel init duration regression from 2.6.28 Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #12899] Crash in i915.ko: i915_driver_irq_handler Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #12861] Xorg fails to start "Failed to allocate space for kernel memory manager" Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #12765] i915 VT switch with AIGLX causes X lock up Rafael J. Wysocki
2009-04-27 16:46   ` Jesse Barnes [this message]
2009-04-27 22:07     ` Sitsofe Wheeler
2009-04-26  9:46 ` [Bug #12836] 2.6.29-rc breaks STD using Intel 945 Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #12971] "tg3 transmit timed out" when transmitting at high bitrate Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #12980] lockup in X.org Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #12961] Kernel panics in early boot: IO-APIC + timer doesn't work Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13001] PCI-DMA: Out of IOMMU space Rafael J. Wysocki
2009-04-28  8:28   ` FUJITA Tomonori
2009-04-28  9:18     ` Данила Жукоцкий
2009-04-28  9:43       ` FUJITA Tomonori
2009-05-04  5:27         ` Данила Жукоцкий
2009-05-05  1:58           ` Grant Grundler
2009-05-05  4:31             ` adam radford
2009-05-05  5:46               ` Данила Жукоцкий
2009-05-06  4:39                 ` FUJITA Tomonori
2009-05-06 10:39           ` FUJITA Tomonori
2009-04-26  9:46 ` [Bug #13025] After upgrading to kernel 2.6.29, pulseaudio stopped with some strange error Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13003] [2.6.29 regression] ivtv driver causes strange oops'es, disrupts software suspend Rafael J. Wysocki
2009-04-27  6:46   ` Hans Verkuil
2009-04-28 21:53     ` Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13032] 2.6.29 regression: network interfaces drop after suspend/resume Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13040] DRM radeon Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13074] gspca_stv06xx doesn't work with Logitech QuickCam Express (046d:0840) Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13072] forcedeth seems to switch off eth on shutdown Rafael J. Wysocki
2009-04-26 20:52   ` Daniel Bierstedt
     [not found]   ` <1240778558.4995.4.camel@laptop.workgroup>
2009-04-26 23:20     ` Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13112] Oops in drain_array Rafael J. Wysocki
2009-04-26 20:19   ` David Rientjes
2009-04-27  8:52     ` Pekka Enberg
2009-04-27 14:04       ` Christoph Lameter
2009-04-27 16:58         ` Bart
2009-04-27 17:39           ` Christoph Lameter
2009-04-28 13:05             ` Bart
2009-04-27 20:36           ` David Rientjes
2009-04-28  6:47             ` Jens Axboe
2009-04-28  8:11             ` FUJITA Tomonori
2009-04-28 12:43               ` Bart
2009-04-28 14:44                 ` FUJITA Tomonori
2009-04-28 18:22                   ` Jens Axboe
2009-04-26  9:46 ` [Bug #13100] can't anymore even do a s2ram-s2disk-s2ram cycle on acer aspire 5720G Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13172] Spontaneous reboots since 2.6.29-rc* Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13144] resume from suspend fails using video card i915 Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13175] sata_nv incompatible with async scsi scan Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13184] Left audio channel broken after resume from suspend with Intel HDA Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13183] forcedeth: no link during initialization Rafael J. Wysocki
2009-04-26  9:46 ` [Bug #13178] Booting very slow Rafael J. Wysocki
2009-04-27  7:18   ` Martin Knoblauch
2009-04-26  9:46 ` [Bug #13186] cpufreq timer teardown problem Rafael J. Wysocki
2009-04-26 16:28   ` Mathieu Desnoyers
2009-04-26 17:45     ` Rafael J. Wysocki
2009-04-26 18:32       ` Mathieu Desnoyers
2009-04-26 12:47 ` 2.6.30-rc3-git1: Reported regressions 2.6.28 -> 2.6.29 Matthew Wilcox
  -- strict thread matches above, loose matches on Subject: below --
2009-06-07 10:02 2.6.30-rc8-git4: " Rafael J. Wysocki
2009-06-07 10:06 ` [Bug #12765] i915 VT switch with AIGLX causes X lock up Rafael J. Wysocki
2009-06-28 20:11   ` Sitsofe Wheeler
2009-07-20 18:11     ` Jesse Barnes
2009-05-30 19:50 2.6.30-rc7-git4: Reported regressions 2.6.28 -> 2.6.29 Rafael J. Wysocki
2009-05-30 19:55 ` [Bug #12765] i915 VT switch with AIGLX causes X lock up Rafael J. Wysocki
2009-05-31 16:12   ` Sitsofe Wheeler
2009-06-01 20:10     ` Rafael J. Wysocki
2009-05-24 19:27 2.6.30-rc7: Reported regressions 2.6.28 -> 2.6.29 Rafael J. Wysocki
2009-05-24 19:31 ` [Bug #12765] i915 VT switch with AIGLX causes X lock up Rafael J. Wysocki
2009-05-26 22:23   ` Sitsofe Wheeler
2009-05-26 23:12     ` Rafael J. Wysocki
2009-05-16 19:58 2.6.30-rc6: Reported regressions 2.6.28 -> 2.6.29 Rafael J. Wysocki
2009-05-16 20:05 ` [Bug #12765] i915 VT switch with AIGLX causes X lock up Rafael J. Wysocki
2009-05-18  7:13   ` Sitsofe Wheeler
2009-05-18 17:10     ` Rafael J. Wysocki
2009-04-06 18:54 2.6.29-git13: Reported regressions from 2.6.28 Rafael J. Wysocki
2009-04-06 19:05 ` [Bug #12765] i915 VT switch with AIGLX causes X lock up Rafael J. Wysocki
2009-03-21 16:28 2.6.29-rc8-git5: Reported regressions from 2.6.28 Rafael J. Wysocki
2009-03-21 16:39 ` [Bug #12765] i915 VT switch with AIGLX causes X lock up Rafael J. Wysocki
2009-03-14 19:01 2.6.29-rc8: Reported regressions from 2.6.28 Rafael J. Wysocki
2009-03-14 19:05 ` [Bug #12765] i915 VT switch with AIGLX causes X lock up Rafael J. Wysocki
2009-03-16 17:54   ` Sitsofe Wheeler
2009-03-19 13:02     ` Rafael J. Wysocki
2009-03-03 19:22 2.6.29-rc6-git7: Reported regressions from 2.6.28 Rafael J. Wysocki
2009-03-03 19:25 ` [Bug #12765] i915 VT switch with AIGLX causes X lock up Rafael J. Wysocki
2009-02-23 21:45 2.6.29-rc6: Reported regressions from 2.6.28 Rafael J. Wysocki
2009-02-23 21:48 ` [Bug #12765] i915 VT switch with AIGLX causes X lock up Rafael J. Wysocki
2009-02-26 21:43   ` Sitsofe Wheeler
2009-02-26 22:32     ` Rafael J. Wysocki

Reply instructions:

You may reply publically 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=20090427094651.7cc09227@hobbes \
    --to=jbarnes@virtuousgeek.org \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=kernel-testers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michel@daenzer.net \
    --cc=rjw@sisk.pl \
    --cc=sitsofe@yahoo.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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git