]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
drm/i2c: adv7511: Fix mutex deadlock when interrupts are disabled
authorArchit Taneja <architt@codeaurora.org>
Fri, 3 Jul 2015 06:11:10 +0000 (11:41 +0530)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 12 Sep 2017 16:19:06 +0000 (18:19 +0200)
commit8d350c3de0ebcf992c0b58272b02b898a93b4298
tree716d6d1f4b6c383264b8bd58bf0fa1d0ce4d7709
parentdeaf20ac64abf5fc6886021993d328e738048158
drm/i2c: adv7511: Fix mutex deadlock when interrupts are disabled

When the adv7511 i2c client doesn't have an interrupt line, we observe a
deadlock on caused by trying to lock drm device's mode_config.mutex twice
in the same context.

Here is the sequence that causes it:

ioctl DRM_IOCTL_MODE_GETCONNECTOR from userspace
  drm_mode_getconnector (acquires mode_config mutex)
    connector->fill_modes()
    drm_helper_probe_single_connector_modes
      connector_funcs->get_modes
adv7511_encoder_get_modes
  adv7511_get_edid_block
    adv7511_irq_process
      drm_helper_hpd_irq_event (acquires mode_config mutex again)

In adv7511_irq_process, don't call drm_helper_hpd_irq_event when not
called from interrupt context. It doesn't serve any purpose there anyway.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
drivers/gpu/drm/i2c/adv7511.c