• Mauro Carvalho Chehab's avatar
    [media] dvb_frontend: Don't let drivers to trash data at cache · bb31d238
    Mauro Carvalho Chehab authored
    GET_FRONTEND and G_PROPERTY can be called anytime, even when the
    tuner/demod is not fully locked. However, several parameters
    returned by those calls are available only after the demod get
    VITERBI lock.
    
    While several drivers do the right thing by checking the status before
    returning the parameter, some drivers simply blindly update the
    DTV properties cache without checking if the registers at the
    hardware contain valid values.
    
    Due to that, programs that call G_PROPERTY (or GET_FRONTEND)
    before having a tuner lock may interfere at the zigzag logic,
    as the DVB kthread calls the set_frontend() callback several
    times, to fine tune the frequency and to identify if the signal
    is inverted or not.
    
    While the drivers should be fixed to report the right status,
    we should prevent that such bugs would actually interfere at the
    device operation.
    
    So, let's use a separate var for userspace calls to get frontend.
    
    As we copy the content of the cache, this should not cause any
    troubles.
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
    bb31d238
dvb_frontend.c 77 KB