• Laurent Pinchart's avatar
    [media] media: omap4iss: csi2: Fix IRQ handling when stopping module · 769161fd
    Laurent Pinchart authored
    When stopping the CSI2 receiver the s_stream handler will wait for the
    IRQ handler to notice the stop request. The receiver, automatically
    disabled by the hardware after each frame, is then not reenabled by the
    IRQ handler as it returns immediately.
    
    As the IRQ handler check is performed before handling the context IRQ,
    the context IRQ source isn't cleared, and the CSI2 IRQ is then fired
    again immediately. The IRQ handler then fails to notice that the module
    is being stopped, processes the IRQ normally and reenables the CSI2
    hardware.
    
    The problem goes unnoticed at stream stop time, but depending on the IRQ
    and s_stream scheduling timings, the CSI2 receiver can end up being
    hanged and will not produce any interrupt the next time it gets enabled,
    despite being soft-reset then.
    
    Fix this by checking for module stop after clearing the context IRQ
    source.
    Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
    769161fd
iss_csi2.c 36 KB