lkml.org 
[lkml]   [2018]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3.16 008/410] media: dvb-usb-v2: lmedm04: move ts2020 attach to dm04_lme2510_tuner
    3.16.57-rc1 review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Malcolm Priestley <tvboxspy@gmail.com>

    commit 7bf7a7116ed313c601307f7e585419369926ab05 upstream.

    When the tuner was split from m88rs2000 the attach function is in wrong
    place.

    Move to dm04_lme2510_tuner to trap errors on failure and removing
    a call to lme_coldreset.

    Prevents driver starting up without any tuner connected.

    Fixes to trap for ts2020 fail.
    LME2510(C): FE Found M88RS2000
    ts2020: probe of 0-0060 failed with error -11
    ...
    LME2510(C): TUN Found RS2000 tuner
    kasan: CONFIG_KASAN_INLINE enabled
    kasan: GPF could be caused by NULL-ptr deref or user memory access
    general protection fault: 0000 [#1] PREEMPT SMP KASAN

    Reported-by: Andrey Konovalov <andreyknvl@google.com>
    Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
    Tested-by: Andrey Konovalov <andreyknvl@google.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    drivers/media/usb/dvb-usb-v2/lmedm04.c | 13 ++++++-------
    1 file changed, 6 insertions(+), 7 deletions(-)

    --- a/drivers/media/usb/dvb-usb-v2/lmedm04.c
    +++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c
    @@ -1115,8 +1115,6 @@ static int dm04_lme2510_frontend_attach(

    if (adap->fe[0]) {
    info("FE Found M88RS2000");
    - dvb_attach(ts2020_attach, adap->fe[0], &ts2020_config,
    - &d->i2c_adap);
    st->i2c_tuner_gate_w = 5;
    st->i2c_tuner_gate_r = 5;
    st->i2c_tuner_addr = 0x60;
    @@ -1179,17 +1177,18 @@ static int dm04_lme2510_tuner(struct dvb
    ret = st->tuner_config;
    break;
    case TUNER_RS2000:
    - ret = st->tuner_config;
    + if (dvb_attach(ts2020_attach, adap->fe[0],
    + &ts2020_config, &d->i2c_adap))
    + ret = st->tuner_config;
    break;
    default:
    break;
    }

    - if (ret)
    + if (ret) {
    info("TUN Found %s tuner", tun_msg[ret]);
    - else {
    - info("TUN No tuner found --- resetting device");
    - lme_coldreset(d);
    + } else {
    + info("TUN No tuner found");
    return -ENODEV;
    }

    \
     
     \ /
      Last update: 2018-06-07 18:16    [W:6.792 / U:0.128 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site