1. 19 Dec, 2013 3 commits
    • Mauro Carvalho Chehab's avatar
      [media] dib8000: Don't let tuner hang due to a call to get_frontend() · 70315b3e
      Mauro Carvalho Chehab authored
      Both dvbv5-scan and dvbv5-zap tools call FE_GET_PROPERTY inside the
      loop that checks for stats. If the frontend doesn't support DVBv5, it
      falls back to call the DVBv5 stats APIs(FE_READ_BER, FE_READ_SIGNAL,
      FE_READ_SNR and FE_READ_UNCORRECTED_BLOCKS).
      
      A call to FE_GET_PROPERTY makes dvb-frontend core to call get_frontend().
      
      However, due to a race condition on dib8000 between dib8000_get_frontend
      and dib8000_tune, if get_frontend occurs too early, it causes the
      tune state machine to fail and not get any lock.
      
      This patch adds a workaround code that makes get_frontend() to just
      return if none of the frontends have a SYNC. This change fixed the issue
      with dvbv5-scan/dvbv5-zap, but a fine-tuned logic might be needed in
      the future, when we implement DVBv5 stats on this frontend.
      
      The procedure to test the bug and the fix is the one below:
      
      1) tune into a non-existing frequency with:
      
      	$ dvbv5-zap -I dvbv5 -c non_existing_freqs -m 679142857 -t3
      
      2) tune/lock into an existing frequency with:
      
      	$ dvbv5-zap -I dvbv5 -c isdb-test -m 479142857
          or
      	$ dvbv5-scan isdb-test
      
      In this case, 679 MHz carrier doesn't exist. Only 479 MHz does.
      Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
      Acked-by: default avatarPatrick Boettcher <pboettcher@kernellabs.com>
      70315b3e
    • Mauro Carvalho Chehab's avatar
      [media] dib8000: make 32 bits read atomic · 5ac64ba1
      Mauro Carvalho Chehab authored
      As the dvb-frontend kthread can be called anytime, it can race
      with some get status ioctl. So, it seems better to avoid one to
      race with the other while reading a 32 bits register.
      I can't see any other reason for having a mutex there at I2C, except
      to provide such kind of protection, as the I2C core already has a
      mutex to protect I2C transfers.
      
      Note: instead of this approach, it could eventually remove the dib8000
      specific mutex for it, and either group the 4 ops into one xfer or
      to manually control the I2C mutex. The main advantage of the current
      approach is that the changes are smaller and more puntual.
      Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
      Acked-by: default avatarPatrick Boettcher <pboettcher@kernellabs.com>
      5ac64ba1
    • Olivier Grenie's avatar
      [media] dib8000: fix regression with dib807x · d67350f8
      Olivier Grenie authored
      Commit 173a64cb broke support for some dib807x versions.
      
      Fix it by providing backward compatibility with the older versions.
      
      [mkrufky@linuxtv.org: conflict handling and CodingStyle fixes]
      Signed-off-by: default avatarOlivier Grenie <olivier.grenie@parrot.com>
      Acked-by: default avatarPatrick Boettcher <pboettcher@kernellabs.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
      d67350f8
  2. 18 Dec, 2013 37 commits