• D
    drm/irq: remove cargo-culted locking from irq_install/uninstall · e090c53b
    Daniel Vetter 提交于
    The dev->struct_mutex locking in drm_irq.c only protects
    dev->irq_enabled. Which isn't really much at all and only prevents
    especially nasty ums userspace from concurrently installing the
    interrupt handling a few times. Or at least trying.
    
    There are tons of unlocked readers of dev->irqs_enabled in the vblank
    wait code (and by extension also in the pageflip code since that uses
    the same vblank timestamp engine).
    
    Real modesetting drivers should ensure that nothing can go haywire
    with a sane setup teardown sequence. So we only really need this for
    the drm_control ioctl, everywhere else this will just paper over
    nastiness.
    
    Note that drm/i915 is a bit specially due to the gem+ums combination.
    So there we also need to properly protect the entervt and leavevt
    ioctls. But it's definitely saner to do everything in one go than to
    drop the lock in-between.
    
    Finally there's the gpu reset code in drm/i915. That one's just race
    (concurrent userspace calls to for vblank waits of pageflips could
    spuriously fail). So wrap it up in with a nice comment since fixing
    this is more involved.
    
    v2: Rebase and fix commit message (Thierry)
    Reviewed-by: NThierry Reding <treding@nvidia.com>
    Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
    e090c53b
i915_drv.c 29.1 KB