public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: keithp@keithp.com, Daniel Vetter <daniel.vetter@ffwll.ch>,
	linux-kernel@vger.kernel.org, Dave Airlie <airlied@redhat.com>,
	dri-devel@lists.sourceforge.net
Subject: Re: [BISECTED] drm: random hang since 620f378 "drm: prune modes when ..."
Date: Mon, 21 Dec 2009 16:06:43 +0000	[thread overview]
Message-ID: <200912211606.43789.arnd@arndb.de> (raw)
In-Reply-To: <20091217111359.54f4c518@jbarnes-piketon>

On Thursday 17 December 2009 19:13:59 Jesse Barnes wrote:
> Another patch to try...

The machine has been working fine for almost two days with this.

> -
> -       if (IS_G4X(dev)) {
> -               u16 gcfgc;
> -
> -               /* Adjust render clock... */
> -               pci_read_config_word(dev->pdev, GCFGC, &gcfgc);
> -
> -               /* Down to minimum... */
> -               gcfgc &= ~GM45_GC_RENDER_CLOCK_MASK;
> -               gcfgc |= GM45_GC_RENDER_CLOCK_266_MHZ;
> -
> -               pci_write_config_word(dev->pdev, GCFGC, gcfgc);

Interestingly, I could not even find GCFGC in the public documentation,
but it also doesn't seem to be what it was in older chips.

The value in there is 0x0025, which does not make any sense whatsoever
according to the definitions in the header file. Writing
GM45_GC_RENDER_CLOCK_266_MHZ in there manually does not seem to have an
effect either, the machine does not crash and the value still remains
at 0x0025.

I tried "while true ; do sudo setpci -s 00:02.1 f0.W=0028 ; done".

I'll try the patch below next, not touching the register at all.

> -/* Note that no increase function is needed for this - increase_renderclock()
> - *  will also rewrite these bits
> - */
> -void intel_decrease_displayclock(struct drm_device *dev)
> -{
> -       if (IS_IRONLAKE(dev))
> -               return;
> -
> -       if (IS_I945G(dev) || IS_I945GM(dev) || IS_I915G(dev) ||
> -           IS_I915GM(dev)) {
> -               u16 gcfgc;
> -
> -               /* Adjust render clock... */
> -               pci_read_config_word(dev->pdev, GCFGC, &gcfgc);
> -
> -               /* Down to minimum... */
> -               gcfgc &= ~0xf0;
> -               gcfgc |= 0x80;
> -
> -               pci_write_config_word(dev->pdev, GCFGC, gcfgc);
> -       }
> -}

This does not do anything on G4X, right? I actually put this function
back in (still doesn't crash), but then I noticed that the registers
are not accessed at all on my machine in this function.

	Arnd

--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3792,7 +3792,7 @@ void intel_increase_renderclock(struct drm_device *dev, bool schedule)
 	}
 
 	/* Restore render clock frequency to original value */
-	if (IS_G4X(dev) || IS_I9XX(dev))
+	if (IS_I9XX(dev))
 		pci_write_config_word(dev->pdev, GCFGC, dev_priv->orig_clock);
 	else if (IS_I85X(dev))
 		pci_write_config_word(dev->pdev, HPLLCC, dev_priv->orig_clock);
@@ -3816,18 +3816,7 @@ void intel_decrease_renderclock(struct drm_device *dev)
 		return;
 	}
 
-	if (IS_G4X(dev)) {
-		u16 gcfgc;
-
-		/* Adjust render clock... */
-		pci_read_config_word(dev->pdev, GCFGC, &gcfgc);
-
-		/* Down to minimum... */
-		gcfgc &= ~GM45_GC_RENDER_CLOCK_MASK;
-		gcfgc |= GM45_GC_RENDER_CLOCK_266_MHZ;
-
-		pci_write_config_word(dev->pdev, GCFGC, gcfgc);
-	} else if (IS_I965G(dev)) {
+	if (IS_I965G(dev)) {
 		u16 gcfgc;
 
 		/* Adjust render clock... */

  parent reply	other threads:[~2009-12-21 16:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07 17:30 [BISECTED] drm: random hang since 620f378 "drm: prune modes when ..." Arnd Bergmann
2009-12-08 21:59 ` Arnd Bergmann
2009-12-08 22:13   ` Dave Airlie
2009-12-08 23:07     ` Arnd Bergmann
2009-12-09  5:38       ` Dave Airlie
2009-12-13 12:18         ` Arnd Bergmann
2009-12-13 12:30           ` Arnd Bergmann
2009-12-13 20:00             ` Daniel Vetter
2009-12-13 21:31               ` Arnd Bergmann
2009-12-13 21:54                 ` Dave Airlie
2009-12-14 18:20                   ` Jesse Barnes
2009-12-14 20:38                     ` Arnd Bergmann
2009-12-14 20:50                       ` Jesse Barnes
2009-12-15  9:51                         ` Arnd Bergmann
2009-12-16 13:53                           ` Arnd Bergmann
2009-12-16 20:18                             ` Jesse Barnes
2009-12-16 21:20                               ` Arnd Bergmann
2009-12-16 21:30                                 ` Jesse Barnes
2009-12-16 21:36                                   ` Arnd Bergmann
2009-12-16 22:41                                     ` Arnd Bergmann
2009-12-17 17:25                                       ` Jesse Barnes
2009-12-17 17:52                                         ` Arnd Bergmann
2009-12-17 19:13                                           ` Jesse Barnes
2009-12-19 13:16                                             ` Arnd Bergmann
2009-12-21 16:06                                             ` Arnd Bergmann [this message]
2009-12-21 17:57                                               ` Arnd Bergmann
2009-12-28 18:47                                                 ` Jesse Barnes
2009-12-30 22:00                                                   ` Arnd Bergmann
2009-12-16 12:19                     ` Mathieu Taillefumier

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=200912211606.43789.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=airlied@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=jbarnes@virtuousgeek.org \
    --cc=keithp@keithp.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox