• Ming Qian's avatar
    media: amphion: fix a bug that vpu core may not resume after suspend · 0202a665
    Ming Qian authored
    driver will enable the vpu core when request the first instance
    on the core.
    one vpu core can only support 8 streaming instances in the same
    time, the instance won't be added to core's list before streamon.
    
    so the actual instance count may be greater then the number in
    the core's list.
    
    in pm resume callback, driver will resume the core immediately if
    core's list is not empty.
    but this check is not accurate,
    if suspend during one instance is requested, but not streamon,
    then after suspend, the core won't be resume, and led to instance failure.
    
    use the request_count instead of the core's list to check
    whether is the core needed to resume immediately after suspend.
    
    And it can make the pm suspend and resume callback more clear.
    
    Fixes: 9f599f35 ("media: amphion: add vpu core driver")
    Signed-off-by: default avatarMing Qian <ming.qian@nxp.com>
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
    0202a665
vpu.h 8.35 KB