All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Rankin <rankincj@yahoo.com>
To: Andreas Oberritter <obi@linuxtv.org>
Cc: linux-media@vger.kernel.org
Subject: Re: Is DVB ioctl FE_SET_FRONTEND broken?
Date: Fri, 26 Aug 2011 01:50:48 -0700 (PDT)	[thread overview]
Message-ID: <1314348648.45073.YahooMailClassic@web121702.mail.ne1.yahoo.com> (raw)
In-Reply-To: <4E56DE32.6010809@linuxtv.org>

--- On Fri, 26/8/11, Andreas Oberritter <obi@linuxtv.org> wrote:
> can you please test whether https://patchwork.kernel.org/patch/1036132/
> restores the old behaviour?
> 
> These three pending patches are also related to frontend events:
>
> https://patchwork.kernel.org/patch/1036112/
> https://patchwork.kernel.org/patch/1036142/
> https://patchwork.kernel.org/patch/1036122/

Andreas,

I've only reviewed these patches so far, but I am concerned that we both have a different understanding of what the FE_SET_FRONTEND ioctl is supposed to do. According to the documentation:

"The result of this call will be successful if the parameters were valid and the tuning could be initiated. The result of the tuning operation in itself, however, will arrive asynchronously as an event."

However, your comment in your first patch reads:

"FE_SET_FRONTEND triggers an initial frontend event with status = 0, which copies output parameters to userspace."

To my mind, these are conflicting statements because how can there be such thing as "an initial frontend event"? I am not expecting the kernel to send any event until the tuning has finished and it can give me real information. I am *definitely* not expecting the kernel to send my input parameters straight back to me.

Given the documented description of this ioctl, I would write the following (pseudo)code in userspace:

int rc;

rc = ioctl(fd, FE_SET_FRONTEND, &args);
if (rc != 0) {
    printf("Error: could not start tuning.\n");
} else {
    struct pollfd  pfd;
    pfd.fd = fd;
    pfd.events = POLLIN;
    pfd.revents = 0;

    // Wait 5 seconds for tuning to finish.
    rc = poll(&pfd, 1, 5000);
    if (rc < 0) {
        printf("Error!\n");
    } else if (rc == 0) {
        printf("Still not tuned after 5 seconds - give up!\n");
    } else {
        printf("YAY! WE ARE TUNED!\n");
    }
}

But your code adds an event to the queue as the ioctl() exits, which means that my pseudocode is never going to print the "Still not tuned after 5 seconds" message but jump straight to "YAY! WE ARE TUNED!" instead while tuning is actually still in progress.

So I'm going to say "No", your patches don't restore the old behaviour.

Cheers,
Chris


  reply	other threads:[~2011-08-26  8:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 23:27 Is DVB ioctl FE_SET_FRONTEND broken? Chris Rankin
2011-08-25 23:43 ` Andreas Oberritter
2011-08-26  8:50   ` Chris Rankin [this message]
2011-08-26  9:49     ` Andreas Oberritter
2011-08-26 11:31       ` Chris Rankin
2011-08-26 12:13         ` Andreas Oberritter

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=1314348648.45073.YahooMailClassic@web121702.mail.ne1.yahoo.com \
    --to=rankincj@yahoo.com \
    --cc=linux-media@vger.kernel.org \
    --cc=obi@linuxtv.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.