• Lyude Paul's avatar
    drm/nouveau: Handle fbcon suspend/resume in seperate worker · c7a29cf6
    Lyude Paul authored
    
    [ Upstream commit 15266ae3 ]
    
    Resuming from RPM can happen while already holding
    dev->mode_config.mutex. This means we can't actually handle fbcon in
    any RPM resume workers, since restoring fbcon requires grabbing
    dev->mode_config.mutex again. So move the fbcon suspend/resume code into
    it's own worker, and rely on that instead to avoid deadlocking.
    
    This fixes more deadlocks for runtime suspending the GPU on the ThinkPad
    W541. Reproduction recipe:
    
     - Get a machine with both optimus and a nvidia card with connectors
       attached to it
     - Wait for the nvidia GPU to suspend
     - Attempt to manually reprobe any of the connectors on the nvidia GPU
       using sysfs
     - *deadlock*
    
    [airlied: use READ_ONCE to address Hans's comment]
    Signed-off-by: default avatarLyude <lyude@redhat.com>
    Cc: Hans de Goede <hdegoede@redhat.com>
    Cc: Kilian Singer <kilian.singer@quantumtechnology.info>
    Cc: Lukas Wunner <lukas@wunner.de>
    Cc: David Airlie <airlied@redhat.com>
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    c7a29cf6
nouveau_drv.h 5.41 KB