diff mbox

Oops in i915 intel_init_clock_gating

Message ID 20110615133256.113293a0@jbarnes-desktop (mailing list archive)
State New, archived
Headers show

Commit Message

Jesse Barnes June 15, 2011, 8:32 p.m. UTC
On Wed, 15 Jun 2011 16:08:51 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:

> The problem of dev_priv->display.init_clock_gating not getting set is 
> still present in 3.0-rc3.  On my system this happens because 
> intel_init_display() never gets called in the first place.
> 
> AFAICT, the normal calling sequence during driver initialization is:
> 
> 	i915_driver_load() -> i915_load_modeset_init() ->
> 		intel_modeset_init() -> intel_init_display().
> 
> But in my case the call to i915_load_modeset_init() doesn't occur 
> because drm_core_check_feature(dev, DRIVER_MODESET) is False.

Ouch, a non-KMS config.  Any reason you can't use KMS?

This patch should help at any rate.

Comments

Alan Stern June 15, 2011, 9:14 p.m. UTC | #1
On Wed, 15 Jun 2011, Jesse Barnes wrote:

> On Wed, 15 Jun 2011 16:08:51 -0400 (EDT)
> Alan Stern <stern@rowland.harvard.edu> wrote:
> 
> > The problem of dev_priv->display.init_clock_gating not getting set is 
> > still present in 3.0-rc3.  On my system this happens because 
> > intel_init_display() never gets called in the first place.
> > 
> > AFAICT, the normal calling sequence during driver initialization is:
> > 
> > 	i915_driver_load() -> i915_load_modeset_init() ->
> > 		intel_modeset_init() -> intel_init_display().
> > 
> > But in my case the call to i915_load_modeset_init() doesn't occur 
> > because drm_core_check_feature(dev, DRIVER_MODESET) is False.
> 
> Ouch, a non-KMS config.  Any reason you can't use KMS?

Normally I do use it.  This was a special testing config I've been 
nursing along for years, since well before KMS existed.  Either I never 
enabled KMS in the config, or else at some point it caused trouble so I 
removed it and never added it back.  Can't remember which -- all the 
testing I do with this config is at a VT, never under X.

> This patch should help at any rate.

I confirm that the patch fixes the problem.  Thanks.

On a different but related note, "rmmod i915" incites a lockdep 
notification:

[   54.316439] INFO: trying to register non-static key.
[   54.316589] the code is fine but needs lockdep annotation.
[   54.316729] turning off the locking correctness validator.
[   54.316871] Pid: 1683, comm: rmmod Not tainted 3.0.0-rc3 #2
[   54.317011] Call Trace:
[   54.317153]  [<c11f582a>] ? printk+0xf/0x11
[   54.317296]  [<c1049b3f>] register_lock_class+0x58/0x2d7
[   54.317438]  [<c102176e>] ? get_parent_ip+0xb/0x31
[   54.317579]  [<c105295a>] ? is_module_text_address+0x37/0x45
[   54.317722]  [<c1038917>] ? __kernel_text_address+0x1c/0x3e
[   54.317864]  [<c1049e61>] __lock_acquire+0xa3/0xc5a
[   54.318005]  [<c1003833>] ? dump_trace+0x7f/0xa5
[   54.318146]  [<c104aa09>] ? __lock_acquire+0xc4b/0xc5a
[   54.318287]  [<c104adf7>] lock_acquire+0x5e/0x75
[   54.318427]  [<c10364f4>] ? work_on_cpu+0x96/0x96
[   54.318567]  [<c1036530>] wait_on_work+0x3c/0x133
[   54.318707]  [<c10364f4>] ? work_on_cpu+0x96/0x96
[   54.318848]  [<c102fe0d>] ? lock_timer_base.clone.23+0x20/0x3e
[   54.318991]  [<c11f7892>] ? _raw_spin_unlock_irqrestore+0x36/0x5b
[   54.319134]  [<c102176e>] ? get_parent_ip+0xb/0x31
[   54.319275]  [<c11f9f99>] ? sub_preempt_count+0x7c/0x89
[   54.319417]  [<c1036cb2>] __cancel_work_timer+0xa0/0xde
[   54.319559]  [<c1036d07>] cancel_work_sync+0xa/0xc
[   54.319714]  [<f0128105>] i915_driver_unload+0x136/0x224 [i915]
[   54.319874]  [<f00af39d>] drm_put_dev+0xa9/0x170 [drm]
[   54.320029]  [<f00b086d>] drm_pci_exit+0x49/0x63 [drm]
[   54.320045]  [<f01508d0>] i915_exit+0x12/0x742 [i915]
[   54.320045]  [<c1050da5>] sys_delete_module+0x175/0x1c1
[   54.320045]  [<c107efb2>] ? remove_vma+0x52/0x58
[   54.320045]  [<c11f7ce0>] ? restore_all+0xf/0xf
[   54.320045]  [<c11fb610>] sysenter_do_call+0x12/0x36
[   54.336786] [drm] Module unloaded

Is this a known problem?

Alan Stern
Keith Packard June 22, 2011, 6:12 p.m. UTC | #2
On Wed, 15 Jun 2011 13:32:56 -0700, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:

> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 0defd42..a1a28fb 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -429,6 +429,9 @@ static int i915_drm_thaw(struct drm_device *dev)
>  	/* KMS EnterVT equivalent */
>  	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
>  		mutex_lock(&dev->struct_mutex);
> +
> +		intel_init_clock_gating(dev);
> +
>  		dev_priv->mm.suspended = 0;
>  
>  		error = i915_gem_init_ringbuffer(dev);
> diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> index 60a94d2..b478d16 100644
> --- a/drivers/gpu/drm/i915/i915_suspend.c
> +++ b/drivers/gpu/drm/i915/i915_suspend.c
> @@ -863,8 +863,6 @@ int i915_restore_state(struct drm_device *dev)
>  		I915_WRITE(IMR, dev_priv->saveIMR);
>  	}
>  
> -	intel_init_clock_gating(dev);
> -
>  	if (IS_IRONLAKE_M(dev)) {
>  		ironlake_enable_drps(dev);
>  		intel_init_emon(dev);
> 

I haven't seen any comments as to whether this patch needs to be merged
into the kernel. Has anyone tested this?
Alan Stern June 22, 2011, 7:04 p.m. UTC | #3
On Wed, 22 Jun 2011, Keith Packard wrote:

> On Wed, 15 Jun 2011 13:32:56 -0700, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 0defd42..a1a28fb 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -429,6 +429,9 @@ static int i915_drm_thaw(struct drm_device *dev)
> >  	/* KMS EnterVT equivalent */
> >  	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
> >  		mutex_lock(&dev->struct_mutex);
> > +
> > +		intel_init_clock_gating(dev);
> > +
> >  		dev_priv->mm.suspended = 0;
> >  
> >  		error = i915_gem_init_ringbuffer(dev);
> > diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> > index 60a94d2..b478d16 100644
> > --- a/drivers/gpu/drm/i915/i915_suspend.c
> > +++ b/drivers/gpu/drm/i915/i915_suspend.c
> > @@ -863,8 +863,6 @@ int i915_restore_state(struct drm_device *dev)
> >  		I915_WRITE(IMR, dev_priv->saveIMR);
> >  	}
> >  
> > -	intel_init_clock_gating(dev);
> > -
> >  	if (IS_IRONLAKE_M(dev)) {
> >  		ironlake_enable_drps(dev);
> >  		intel_init_emon(dev);
> > 
> 
> I haven't seen any comments as to whether this patch needs to be merged
> into the kernel. Has anyone tested this?

I have tested it, and it worked well on my system:

	http://marc.info/?l=linux-kernel&m=130817292323254&w=2

Alan Stern
Florian Mickler June 23, 2011, 4:52 p.m. UTC | #4
On Wed, 22 Jun 2011 15:04:56 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:

> On Wed, 22 Jun 2011, Keith Packard wrote:
> 
> > On Wed, 15 Jun 2011 13:32:56 -0700, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> > 
> > I haven't seen any comments as to whether this patch needs to be merged
> > into the kernel. Has anyone tested this?
> 
> I have tested it, and it worked well on my system:
> 
> 	http://marc.info/?l=linux-kernel&m=130817292323254&w=2
> 
> Alan Stern
> 
Some clock-gating patch was also proposed here:
https://bugzilla.kernel.org/show_bug.cgi?id=37252

Regards,
Flo
Alan Stern June 23, 2011, 5:11 p.m. UTC | #5
On Thu, 23 Jun 2011, Florian Mickler wrote:

> On Wed, 22 Jun 2011 15:04:56 -0400 (EDT)
> Alan Stern <stern@rowland.harvard.edu> wrote:
> 
> > On Wed, 22 Jun 2011, Keith Packard wrote:
> > 
> > > On Wed, 15 Jun 2011 13:32:56 -0700, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> > > 
> > > I haven't seen any comments as to whether this patch needs to be merged
> > > into the kernel. Has anyone tested this?
> > 
> > I have tested it, and it worked well on my system:
> > 
> > 	http://marc.info/?l=linux-kernel&m=130817292323254&w=2
> > 
> > Alan Stern
> > 
> Some clock-gating patch was also proposed here:
> https://bugzilla.kernel.org/show_bug.cgi?id=37252

That was a different fix for a different problem, although the symptoms 
were the same.

Alan Stern
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 0defd42..a1a28fb 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -429,6 +429,9 @@  static int i915_drm_thaw(struct drm_device *dev)
 	/* KMS EnterVT equivalent */
 	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
 		mutex_lock(&dev->struct_mutex);
+
+		intel_init_clock_gating(dev);
+
 		dev_priv->mm.suspended = 0;
 
 		error = i915_gem_init_ringbuffer(dev);
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 60a94d2..b478d16 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -863,8 +863,6 @@  int i915_restore_state(struct drm_device *dev)
 		I915_WRITE(IMR, dev_priv->saveIMR);
 	}
 
-	intel_init_clock_gating(dev);
-
 	if (IS_IRONLAKE_M(dev)) {
 		ironlake_enable_drps(dev);
 		intel_init_emon(dev);