diff mbox

[1/2] drm/i915: make sure south port interrupts are enabled properly

Message ID 1389387741-5384-1-git-send-email-jbarnes@virtuousgeek.org (mailing list archive)
State New, archived
Headers show

Commit Message

Jesse Barnes Jan. 10, 2014, 9:02 p.m. UTC
We were apparently relying on the defaults on BDW, which resulted in no
hotplug or AUX interrupts.

References: https://bugs.freedesktop.org/show_bug.cgi?id=72834
References: https://bugs.freedesktop.org/show_bug.cgi?id=72833
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/i915_irq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jesse Barnes Jan. 10, 2014, 9:05 p.m. UTC | #1
On Fri, 10 Jan 2014 13:02:20 -0800
Jesse Barnes <jbarnes@virtuousgeek.org> wrote:

> We were apparently relying on the defaults on BDW, which resulted in no
> hotplug or AUX interrupts.
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=72834
> References: https://bugs.freedesktop.org/show_bug.cgi?id=72833
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/i915_irq.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 261254a..f88e265 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -2763,13 +2763,15 @@ static void ibx_irq_postinstall(struct drm_device *dev)
>  		mask = SDE_GMBUS | SDE_AUX_MASK | SDE_TRANSB_FIFO_UNDER |
>  		       SDE_TRANSA_FIFO_UNDER | SDE_POISON;
>  	} else {
> -		mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT;
> +		mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT |
> +			SDE_HOTPLUG_MASK_CPT;
>  
>  		I915_WRITE(SERR_INT, I915_READ(SERR_INT));
>  	}
>  
>  	I915_WRITE(SDEIIR, I915_READ(SDEIIR));
>  	I915_WRITE(SDEIMR, ~mask);
> +	I915_WRITE(SDEIER, mask);
>  }
>  
>  static void gen5_gt_irq_postinstall(struct drm_device *dev)

Note we still don't handle port A interrupts.  Not sure if that's
important since we don't really use them yet, but if we want to add
that we'd probably need to add some new code to the hpd functions to
deal with walking both CPU and PCH masks.
Paulo Zanoni Jan. 10, 2014, 9:09 p.m. UTC | #2
2014/1/10 Jesse Barnes <jbarnes@virtuousgeek.org>:
> We were apparently relying on the defaults on BDW, which resulted in no
> hotplug or AUX interrupts.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=72834
> References: https://bugs.freedesktop.org/show_bug.cgi?id=72833
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/i915_irq.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 261254a..f88e265 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -2763,13 +2763,15 @@ static void ibx_irq_postinstall(struct drm_device *dev)
>                 mask = SDE_GMBUS | SDE_AUX_MASK | SDE_TRANSB_FIFO_UNDER |
>                        SDE_TRANSA_FIFO_UNDER | SDE_POISON;
>         } else {
> -               mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT;
> +               mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT |
> +                       SDE_HOTPLUG_MASK_CPT;
>
>                 I915_WRITE(SERR_INT, I915_READ(SERR_INT));
>         }
>
>         I915_WRITE(SDEIIR, I915_READ(SDEIIR));
>         I915_WRITE(SDEIMR, ~mask);
> +       I915_WRITE(SDEIER, mask);

ibx_irq_preinstall contains a nice comment explaining why SDEIER needs
to be 0xffffffff.

I think the proper solution to your bug is probably to call
ibx_irq_preinstall from gen8_irq_preinstall.

>  }
>
>  static void gen5_gt_irq_postinstall(struct drm_device *dev)
> --
> 1.8.3.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Paulo Zanoni Jan. 10, 2014, 9:10 p.m. UTC | #3
2014/1/10 Jesse Barnes <jbarnes@virtuousgeek.org>:
> On Fri, 10 Jan 2014 13:02:20 -0800
> Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
>
>> We were apparently relying on the defaults on BDW, which resulted in no
>> hotplug or AUX interrupts.
>>
>> References: https://bugs.freedesktop.org/show_bug.cgi?id=72834
>> References: https://bugs.freedesktop.org/show_bug.cgi?id=72833
>> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
>> ---
>>  drivers/gpu/drm/i915/i915_irq.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
>> index 261254a..f88e265 100644
>> --- a/drivers/gpu/drm/i915/i915_irq.c
>> +++ b/drivers/gpu/drm/i915/i915_irq.c
>> @@ -2763,13 +2763,15 @@ static void ibx_irq_postinstall(struct drm_device *dev)
>>               mask = SDE_GMBUS | SDE_AUX_MASK | SDE_TRANSB_FIFO_UNDER |
>>                      SDE_TRANSA_FIFO_UNDER | SDE_POISON;
>>       } else {
>> -             mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT;
>> +             mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT |
>> +                     SDE_HOTPLUG_MASK_CPT;
>>
>>               I915_WRITE(SERR_INT, I915_READ(SERR_INT));
>>       }
>>
>>       I915_WRITE(SDEIIR, I915_READ(SDEIIR));
>>       I915_WRITE(SDEIMR, ~mask);
>> +     I915_WRITE(SDEIER, mask);
>>  }
>>
>>  static void gen5_gt_irq_postinstall(struct drm_device *dev)
>
> Note we still don't handle port A interrupts.  Not sure if that's
> important since we don't really use them yet, but if we want to add
> that we'd probably need to add some new code to the hpd functions to
> deal with walking both CPU and PCH masks.

All the previous gens also lack this and things kinda work so far...
The BIOS sets some state, and we lose it after suspend. Of course, I'm
not suggesting we should keep it like this :)


>
> --
> Jesse Barnes, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 261254a..f88e265 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -2763,13 +2763,15 @@  static void ibx_irq_postinstall(struct drm_device *dev)
 		mask = SDE_GMBUS | SDE_AUX_MASK | SDE_TRANSB_FIFO_UNDER |
 		       SDE_TRANSA_FIFO_UNDER | SDE_POISON;
 	} else {
-		mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT;
+		mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT |
+			SDE_HOTPLUG_MASK_CPT;
 
 		I915_WRITE(SERR_INT, I915_READ(SERR_INT));
 	}
 
 	I915_WRITE(SDEIIR, I915_READ(SDEIIR));
 	I915_WRITE(SDEIMR, ~mask);
+	I915_WRITE(SDEIER, mask);
 }
 
 static void gen5_gt_irq_postinstall(struct drm_device *dev)