From: Daniel Scheller <d.scheller.oss@gmail.com>
To: Matthias Schwarzott <zzam@gentoo.org>
Cc: mchehab@kernel.org, linux-media@vger.kernel.org
Subject: Re: [PATCH v2 01/12] [media] dvb-frontends/stv0367: add flag to make i2c_gatectrl optional
Date: Sun, 26 Mar 2017 12:34:42 +0200 [thread overview]
Message-ID: <20170326123442.60c2752c@macbox> (raw)
In-Reply-To: <c90e92df-16e1-8693-c64d-fcb0fedee931@gentoo.org>
Am Sun, 26 Mar 2017 10:03:33 +0200
schrieb Matthias Schwarzott <zzam@gentoo.org>:
> Am 24.03.2017 um 19:23 schrieb Daniel Scheller:
> > From: Daniel Scheller <d.scheller@gmx.net>
> >
> > Some hardware and bridges (namely ddbridge) require that tuner
> > access is limited to one concurrent access and wrap i2c gate
> > control with a mutex_lock when attaching frontends. According to
> > vendor information, this is required as concurrent tuner
> > reconfiguration can interfere each other and at worst cause tuning
> > fails or bad reception quality.
> >
> > If the demod driver does gate_ctrl before setting up tuner
> > parameters, and the tuner does another I2C enable, it will deadlock
> > forever when gate_ctrl is wrapped into the mutex_lock. This adds a
> > flag and a conditional before triggering gate_ctrl in the
> > demodulator driver.
>
> If I get this right, the complete call to i2c_gate_ctrl should be
> disabled. Why not just overwrite the function-pointer i2c_gate_ctrl
> with NULL in the relevant attach function (stv0367ddb_attach) or not
> define it in stv0367ddb_ops?
This will make communication with the TDA18212 tuner chip impossible.
We need to open stv0367's I2C gate, thus need the function. But for the
overall hardware case, concurrent tuner reconfiguration must be avoided
due to the mentioned issues, thus after _attach the bridge driver
remaps the function pointer to wrap i2c_gate_ctrl with a lock to
accomplish this - see [1] and [2]. As the demod AND the tuner driver
both open the I2C gate, this will lead to a dead lock. To not change or
break existing behaviour with other cards and tuner drivers, this
(flag, conditional) appears to be the best option.
Thanks,
Daniel
[1]
https://github.com/herrnst/dddvb-linux-kernel/blob/cfefdc71b25d8c135889971dc5735414d22003cf/drivers/media/pci/ddbridge/ddbridge-core.c#L646
[2]
https://github.com/herrnst/dddvb-linux-kernel/blob/cfefdc71b25d8c135889971dc5735414d22003cf/drivers/media/pci/ddbridge/ddbridge-core.c#L556
next prev parent reply other threads:[~2017-03-26 10:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-24 18:23 [PATCH v2 00/12] stv0367/ddbridge: support CTv6/FlexCT hardware Daniel Scheller
2017-03-24 18:23 ` [PATCH v2 01/12] [media] dvb-frontends/stv0367: add flag to make i2c_gatectrl optional Daniel Scheller
2017-03-26 8:03 ` Matthias Schwarzott
2017-03-26 10:34 ` Daniel Scheller [this message]
2017-03-28 5:37 ` Matthias Schwarzott
2017-03-24 18:23 ` [PATCH v2 02/12] [media] dvb-frontends/stv0367: print CPAMP status only if stv_debug is enabled Daniel Scheller
2017-03-24 18:23 ` [PATCH v2 03/12] [media] dvb-frontends/stv0367: refactor defaults table handling Daniel Scheller
2017-03-24 18:24 ` [PATCH v2 04/12] [media] dvb-frontends/stv0367: move out tables, support multiple tab variants Daniel Scheller
2017-03-24 18:24 ` [PATCH v2 05/12] [media] dvb-frontends/stv0367: make PLLSETUP a function, add 58MHz IC speed Daniel Scheller
2017-03-24 18:24 ` [PATCH v2 06/12] [media] dvb-frontends/stv0367: make full reinit on set_frontend() optional Daniel Scheller
2017-03-24 18:24 ` [PATCH v2 07/12] [media] dvb-frontends/stv0367: support reading if_khz from tuner config Daniel Scheller
2017-03-24 18:24 ` [PATCH v2 08/12] [media] dvb-frontends/stv0367: selectable QAM FEC Lock status register Daniel Scheller
2017-03-24 18:24 ` [PATCH v2 09/12] [media] dvb-frontends/stv0367: fix symbol rate conditions in cab_SetQamSize() Daniel Scheller
2017-03-24 18:24 ` [PATCH v2 10/12] [media] dvb-frontends/stv0367: add defaults for use w/DD-branded devices Daniel Scheller
2017-03-24 18:24 ` [PATCH v2 11/12] [media] dvb-frontends/stv0367: add Digital Devices compatibility Daniel Scheller
2017-03-24 18:24 ` [PATCH v2 12/12] [media] ddbridge: support STV0367-based cards and modules Daniel Scheller
2017-03-25 18:13 ` Daniel Scheller
2017-03-26 16:46 ` kbuild test robot
2017-03-26 22:20 ` Daniel Scheller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170326123442.60c2752c@macbox \
--to=d.scheller.oss@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=zzam@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).