[Intel-gfx] [PATCH] drm/i915: add hotplug activation period to hotplug update mask

Jani Nikula jani.nikula at intel.com
Thu Oct 22 05:43:08 PDT 2015


On Thu, 22 Oct 2015, Ville Syrjälä <ville.syrjala at linux.intel.com> wrote:
> On Thu, Oct 22, 2015 at 10:46:58AM +0300, Jani Nikula wrote:
>> On Wed, 21 Oct 2015, Ville Syrjälä <ville.syrjala at linux.intel.com> wrote:
>> > On Wed, Oct 21, 2015 at 05:22:43PM +0300, Jani Nikula wrote:
>> >> commit 0706f17c307b056ff6f1848320ba82d76945a6ff
>> >> Author: Egbert Eich <eich at suse.de>
>> >> Date:   Wed Sep 23 16:15:27 2015 +0200
>> >> 
>> >>     drm/i915: Avoid race of intel_crt_detect_hotplug() with HPD interrupt, v2
>> >> 
>> >> added a check with WARN to ensure only bits within the mask are
>> >> enabled. Turns out that doesn't hold for G4X, which spits out:
>> >> 
>> >> [    2.641439] ------------[ cut here ]------------
>> >> [    2.641444] WARNING: CPU: 0 PID: 1 at drivers/gpu/drm/i915/i915_irq.c:182 i915_hotplug_interrupt_update_locked+0x45/0x83()
>> >> [    2.641446] WARN_ON(bits & ~mask)
>> >> etc.
>> >> 
>> >> Add CRT_HOTPLUG_ACTIVATION_PERIOD_64 to the mask to fix the warning.
>> >> 
>> >> Reported-by: Oleksij Rempel <linux at rempel-privat.de>
>> >> References: https://bugzilla.kernel.org/show_bug.cgi?id=104991
>> >> Fixes: 0706f17c307b ("drm/i915: Avoid race of intel_crt_detect_hotplug() with HPD interrupt, v2")
>> >> Cc: Egbert Eich <eich at suse.de>
>> >> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
>> >> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
>> >> ---
>> >>  drivers/gpu/drm/i915/i915_irq.c | 7 ++++---
>> >>  1 file changed, 4 insertions(+), 3 deletions(-)
>> >> 
>> >> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
>> >> index 7f91f74961f4..5b9f63d4318b 100644
>> >> --- a/drivers/gpu/drm/i915/i915_irq.c
>> >> +++ b/drivers/gpu/drm/i915/i915_irq.c
>> >> @@ -4236,9 +4236,10 @@ static void i915_hpd_irq_setup(struct drm_device *dev)
>> >>  
>> >>  	/* Ignore TV since it's buggy */
>> >>  	i915_hotplug_interrupt_update_locked(dev_priv,
>> >> -				      (HOTPLUG_INT_EN_MASK
>> >> -				       | CRT_HOTPLUG_VOLTAGE_COMPARE_MASK),
>> >> -				      hotplug_en);
>> >> +					     HOTPLUG_INT_EN_MASK |
>> >> +					     CRT_HOTPLUG_VOLTAGE_COMPARE_MASK |
>> >> +					     CRT_HOTPLUG_ACTIVATION_PERIOD_64,
>> >> +					     hotplug_en);
>> >
>> > Or maybe just ~CRT_HOTPLUG_FORCE_DETECT ?
>> 
>> This patch already potentially changes behaviour by explicitly setting
>> the activation period to zero (CRT_HOTPLUG_ACTIVATION_PERIOD_32) on
>> non-g4x. Previously it was "don't care".
>
> It was already cleared in irq pre/postinstall.

Fair enough. Anyway I'd like the further change to simmer in dinq first;
the fix here was for drm-intel-next-fixes.

BR,
Jani.


>
>> Call me coward, but I am not
>> comfortable with setting the rest of the bits to zero, at least not in
>> the context of this fix, and risking regressions on old machines.
>> 
>> BR,
>> Jani.
>> 
>> 
>> >
>> >>  }
>> >>  
>> >>  static irqreturn_t i965_irq_handler(int irq, void *arg)
>> >> -- 
>> >> 2.1.4
>> >> 
>> >> _______________________________________________
>> >> Intel-gfx mailing list
>> >> Intel-gfx at lists.freedesktop.org
>> >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>> >
>> > -- 
>> > Ville Syrjälä
>> > Intel OTC
>> 
>> -- 
>> Jani Nikula, Intel Open Source Technology Center

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the Intel-gfx mailing list