Skip to content

Commit fa2a6c5

Browse files
committed
drm/i915: Don't request GMBUS to generate irqs when called while irqs are off
We will need to do some i2c poking from the encoder->shutdown() hook. Currently that gets called after irqs have been turned off. We still poll the gmbus status bits even if the interrupt never arrives so things will work just fine. But seems like asking gmbus to generate interrupts we will never see is a bit pointless, so don't. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Stanislav Lisovskiy <[email protected]>
1 parent f2787d8 commit fa2a6c5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/gpu/drm/i915/display/intel_gmbus.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,15 @@ intel_gpio_setup(struct intel_gmbus *bus, unsigned int pin)
334334
algo->data = bus;
335335
}
336336

337+
static bool has_gmbus_irq(struct drm_i915_private *i915)
338+
{
339+
/*
340+
* encoder->shutdown() may want to use GMBUS
341+
* after irqs have already been disabled.
342+
*/
343+
return HAS_GMBUS_IRQ(i915) && intel_irqs_enabled(i915);
344+
}
345+
337346
static int gmbus_wait(struct drm_i915_private *dev_priv, u32 status, u32 irq_en)
338347
{
339348
DEFINE_WAIT(wait);
@@ -344,7 +353,7 @@ static int gmbus_wait(struct drm_i915_private *dev_priv, u32 status, u32 irq_en)
344353
* we also need to check for NAKs besides the hw ready/idle signal, we
345354
* need to wake up periodically and check that ourselves.
346355
*/
347-
if (!HAS_GMBUS_IRQ(dev_priv))
356+
if (!has_gmbus_irq(dev_priv))
348357
irq_en = 0;
349358

350359
add_wait_queue(&dev_priv->gmbus_wait_queue, &wait);
@@ -375,7 +384,7 @@ gmbus_wait_idle(struct drm_i915_private *dev_priv)
375384

376385
/* Important: The hw handles only the first bit, so set only one! */
377386
irq_enable = 0;
378-
if (HAS_GMBUS_IRQ(dev_priv))
387+
if (has_gmbus_irq(dev_priv))
379388
irq_enable = GMBUS_IDLE_EN;
380389

381390
add_wait_queue(&dev_priv->gmbus_wait_queue, &wait);

0 commit comments

Comments
 (0)