From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Antti Palosaari <crope@iki.fi>
Cc: linux-media@vger.kernel.org, Hin-Tak Leung <htl10@users.sourceforge.net>
Subject: Re: [PATCH 3/5] dvb_frontend: do not allow statistic IOCTLs when sleeping
Date: Mon, 10 Sep 2012 11:27:33 -0300 [thread overview]
Message-ID: <504DF8D5.7050709@redhat.com> (raw)
In-Reply-To: <1345076921-9773-4-git-send-email-crope@iki.fi>
Em 15-08-2012 21:28, Antti Palosaari escreveu:
> Demodulator cannot perform statistic IOCTLs when it is not tuned.
> Return -EAGAIN in such case.
>
> Signed-off-by: Antti Palosaari <crope@iki.fi>
> ---
> drivers/media/dvb-core/dvb_frontend.c | 34 +++++++++++++++++++++++++---------
> 1 file changed, 25 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
> index 2bc80b1..7d079fb 100644
> --- a/drivers/media/dvb-core/dvb_frontend.c
> +++ b/drivers/media/dvb-core/dvb_frontend.c
> @@ -2132,27 +2132,43 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
> err = fe->ops.read_status(fe, status);
> break;
> }
> +
> case FE_READ_BER:
> - if (fe->ops.read_ber)
> - err = fe->ops.read_ber(fe, (__u32*) parg);
> + if (fe->ops.read_ber) {
> + if (fepriv->thread)
> + err = fe->ops.read_ber(fe, (__u32 *) parg);
> + else
> + err = -EAGAIN;
> + }
> break;
>
> case FE_READ_SIGNAL_STRENGTH:
> - if (fe->ops.read_signal_strength)
> - err = fe->ops.read_signal_strength(fe, (__u16*) parg);
> + if (fe->ops.read_signal_strength) {
> + if (fepriv->thread)
> + err = fe->ops.read_signal_strength(fe, (__u16 *) parg);
> + else
> + err = -EAGAIN;
> + }
> break;
This one doesn't look right, as the frontend can be able to get the signal strength
at the analog part (afaik, most DVB-S frontends do that). Also, some drivers just
map it to the tuner RF strength.
The proper approach for it is to break signal strength into two different statistics:
- analog RF strength;
- signal strength at the demod, after having demod locked.
It makes sense to return -EAGAIN for the second case, but doing it for the first case
is bad, as the RF strength can be used on DVB-S devices, in order to fine-adjust the
antenna position.
Regards,
Mauro.
next prev parent reply other threads:[~2012-09-10 14:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-16 0:28 [PATCH 0/5] dvb-frontend statistic IOCTL validation Antti Palosaari
2012-08-16 0:28 ` [PATCH 1/5] dvb_frontend: use Kernel dev_* logging Antti Palosaari
2012-08-16 0:28 ` [PATCH 2/5] dvb_frontend: return -ENOTTY for unimplement IOCTL Antti Palosaari
2012-08-16 0:28 ` [PATCH 3/5] dvb_frontend: do not allow statistic IOCTLs when sleeping Antti Palosaari
2012-09-10 14:27 ` Mauro Carvalho Chehab [this message]
2012-09-10 14:39 ` Antti Palosaari
2012-08-16 0:28 ` [PATCH 4/5] DocBook: update ioctl error codes Antti Palosaari
2012-09-10 14:31 ` Mauro Carvalho Chehab
2012-08-16 0:28 ` [PATCH 5/5] rtl2832: remove dummy callback implementations Antti Palosaari
2012-08-16 0:45 ` [PATCH 0/5] dvb-frontend statistic IOCTL validation Antti Palosaari
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=504DF8D5.7050709@redhat.com \
--to=mchehab@redhat.com \
--cc=crope@iki.fi \
--cc=htl10@users.sourceforge.net \
--cc=linux-media@vger.kernel.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).