aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2017-04-27 12:02:22 -0400
committerJani Nikula <jani.nikula@intel.com>2017-05-26 04:51:18 -0400
commit9bd9590997b92fbd79fd028f704f6c584b4439d7 (patch)
tree68a9d0604c9c74bd2f838f49907ce3e3fcaf577f
parent12ea39f8daf206eaaf926adf8f162b2f230bfb38 (diff)
drm/i915: Stop pretending to mask/unmask LPE audio interrupts
vlv_display_irq_postinstall() enables the LPE audio interrupts regardless of whether the LPE audio irq chip has masked/unmasked them. Also the irqchip masking/unmasking doesn't consider the state of the display power well or the device, and hence just leads to dmesg spew when it tries to access the hardware while it's powered down. If the current way works, then we don't need to do anything in the mask/unmask hooks. If it doesn't work, well, then we'd need to properly track whether the irqchip has masked/unmasked the interrupts when we enable display interrupts. And the mask/unmask hooks would need to check whether display interrupts are even enabled before frobbing with he registers. So let's just assume the current way works and neuter the mask/unmask hooks. Also clean up vlv_display_irq_postinstall() a bit and stop it from trying to unmask/enable the LPE C interrupt on VLV since it doesn't exist. Cc: Takashi Iwai <tiwai@suse.de> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-4-ville.syrjala@linux.intel.com Reviewed-by: Takashi Iwai <tiwai@suse.de> (cherry picked from commit ebf5f921478b9b55ed4e634b994571dd23a8fca3) Reference: http://mid.mail-archive.com/874cf6d3-4e45-d4cf-e662-eb972490d2ce@redhat.com Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c15
-rw-r--r--drivers/gpu/drm/i915/intel_lpe_audio.c36
2 files changed, 6 insertions, 45 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index fd97fe00cd0d..190f6aa5d15e 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -2953,7 +2953,6 @@ static void vlv_display_irq_postinstall(struct drm_i915_private *dev_priv)
2953 u32 pipestat_mask; 2953 u32 pipestat_mask;
2954 u32 enable_mask; 2954 u32 enable_mask;
2955 enum pipe pipe; 2955 enum pipe pipe;
2956 u32 val;
2957 2956
2958 pipestat_mask = PLANE_FLIP_DONE_INT_STATUS_VLV | 2957 pipestat_mask = PLANE_FLIP_DONE_INT_STATUS_VLV |
2959 PIPE_CRC_DONE_INTERRUPT_STATUS; 2958 PIPE_CRC_DONE_INTERRUPT_STATUS;
@@ -2964,18 +2963,16 @@ static void vlv_display_irq_postinstall(struct drm_i915_private *dev_priv)
2964 2963
2965 enable_mask = I915_DISPLAY_PORT_INTERRUPT | 2964 enable_mask = I915_DISPLAY_PORT_INTERRUPT |
2966 I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | 2965 I915_DISPLAY_PIPE_A_EVENT_INTERRUPT |
2967 I915_DISPLAY_PIPE_B_EVENT_INTERRUPT; 2966 I915_DISPLAY_PIPE_B_EVENT_INTERRUPT |
2967 I915_LPE_PIPE_A_INTERRUPT |
2968 I915_LPE_PIPE_B_INTERRUPT;
2969
2968 if (IS_CHERRYVIEW(dev_priv)) 2970 if (IS_CHERRYVIEW(dev_priv))
2969 enable_mask |= I915_DISPLAY_PIPE_C_EVENT_INTERRUPT; 2971 enable_mask |= I915_DISPLAY_PIPE_C_EVENT_INTERRUPT |
2972 I915_LPE_PIPE_C_INTERRUPT;
2970 2973
2971 WARN_ON(dev_priv->irq_mask != ~0); 2974 WARN_ON(dev_priv->irq_mask != ~0);
2972 2975
2973 val = (I915_LPE_PIPE_A_INTERRUPT |
2974 I915_LPE_PIPE_B_INTERRUPT |
2975 I915_LPE_PIPE_C_INTERRUPT);
2976
2977 enable_mask |= val;
2978
2979 dev_priv->irq_mask = ~enable_mask; 2976 dev_priv->irq_mask = ~enable_mask;
2980 2977
2981 GEN5_IRQ_INIT(VLV_, dev_priv->irq_mask, enable_mask); 2978 GEN5_IRQ_INIT(VLV_, dev_priv->irq_mask, enable_mask);
diff --git a/drivers/gpu/drm/i915/intel_lpe_audio.c b/drivers/gpu/drm/i915/intel_lpe_audio.c
index 668f00480d97..292fedf30b00 100644
--- a/drivers/gpu/drm/i915/intel_lpe_audio.c
+++ b/drivers/gpu/drm/i915/intel_lpe_audio.c
@@ -149,44 +149,10 @@ static void lpe_audio_platdev_destroy(struct drm_i915_private *dev_priv)
149 149
150static void lpe_audio_irq_unmask(struct irq_data *d) 150static void lpe_audio_irq_unmask(struct irq_data *d)
151{ 151{
152 struct drm_i915_private *dev_priv = d->chip_data;
153 unsigned long irqflags;
154 u32 val = (I915_LPE_PIPE_A_INTERRUPT |
155 I915_LPE_PIPE_B_INTERRUPT);
156
157 if (IS_CHERRYVIEW(dev_priv))
158 val |= I915_LPE_PIPE_C_INTERRUPT;
159
160 spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
161
162 dev_priv->irq_mask &= ~val;
163 I915_WRITE(VLV_IIR, val);
164 I915_WRITE(VLV_IIR, val);
165 I915_WRITE(VLV_IMR, dev_priv->irq_mask);
166 POSTING_READ(VLV_IMR);
167
168 spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
169} 152}
170 153
171static void lpe_audio_irq_mask(struct irq_data *d) 154static void lpe_audio_irq_mask(struct irq_data *d)
172{ 155{
173 struct drm_i915_private *dev_priv = d->chip_data;
174 unsigned long irqflags;
175 u32 val = (I915_LPE_PIPE_A_INTERRUPT |
176 I915_LPE_PIPE_B_INTERRUPT);
177
178 if (IS_CHERRYVIEW(dev_priv))
179 val |= I915_LPE_PIPE_C_INTERRUPT;
180
181 spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
182
183 dev_priv->irq_mask |= val;
184 I915_WRITE(VLV_IMR, dev_priv->irq_mask);
185 I915_WRITE(VLV_IIR, val);
186 I915_WRITE(VLV_IIR, val);
187 POSTING_READ(VLV_IIR);
188
189 spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
190} 156}
191 157
192static struct irq_chip lpe_audio_irqchip = { 158static struct irq_chip lpe_audio_irqchip = {
@@ -330,8 +296,6 @@ void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv)
330 296
331 desc = irq_to_desc(dev_priv->lpe_audio.irq); 297 desc = irq_to_desc(dev_priv->lpe_audio.irq);
332 298
333 lpe_audio_irq_mask(&desc->irq_data);
334
335 lpe_audio_platdev_destroy(dev_priv); 299 lpe_audio_platdev_destroy(dev_priv);
336 300
337 irq_free_desc(dev_priv->lpe_audio.irq); 301 irq_free_desc(dev_priv->lpe_audio.irq);