• Laurent Pinchart's avatar
    drm: adv7511: Fix nested sleep when reading EDID · c8e22658
    Laurent Pinchart authored
    commit a5241289 upstream.
    
    The EDID read code waits for the read completion interrupt to occur
    using wait_event_interruptible(). The condition passed to the macro
    reads I2C registers. This results in sleeping with the task state set
    to TASK_INTERRUPTIBLE, triggering a WARN_ON() introduced in commit
    8eb23b9f ("sched: Debug nested sleeps").
    
    Fix this by reworking the EDID read code. Instead of checking whether
    the read is complete through I2C reads, handle the interrupt registers
    in the interrupt handler and update a new edid_read flag accordingly. As
    a side effect both the IRQ and polling code paths now process the
    interrupt sources through the same code path, simplifying the code.
    Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    c8e22658
adv7511.c 27.1 KB