linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Changbin Du <changbin.du@gmail.com>
To: sean@mess.org
Cc: mchehab@infradead.org, paul.gortmaker@windriver.com,
	sfr@canb.auug.org.au, srinivas.kandagatla@st.com,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] [media] rc: filter out not allowed protocols when decoding
Date: Tue, 4 Sep 2012 11:06:07 +0800	[thread overview]
Message-ID: <CABgQ-TjrXbqKaOd9fDptV2fUiyVTpzZ31K_iZ+HQ+3PGmWoHRw@mail.gmail.com> (raw)
In-Reply-To: <CABgQ-ThYGdvhmpf+=GcLpE-qFAhrDUc1j07+XqohDNRa9bStiw@mail.gmail.com>

> >               mutex_lock(&ir_raw_handler_lock);
> > -             list_for_each_entry(handler, &ir_raw_handler_list, list)
> > -                     handler->decode(raw->dev, ev);
> > +             list_for_each_entry(handler, &ir_raw_handler_list, list) {
> > +                     /* use all protocol by default */
> > +                     if (raw->dev->allowed_protos == RC_TYPE_UNKNOWN ||
> > +                         raw->dev->allowed_protos & handler->protocols)
> > +                             handler->decode(raw->dev, ev);
> > +             }
>
> Each IR protocol decoder already checks whether it is enabled or not;
> should it not be so that only allowed protocols can be enabled rather
> than checking both enabled_protocols and allowed_protocols?
>
> Just from reading store_protocols it looks like decoders which aren't
> in allowed_protocols can be enabled, which makes no sense. Also
> ir_raw_event_register all protocols are enabled rather than the
> allowed ones.
>
>
> Lastely I don't know why raw ir drivers should dictate which protocols
> can be enabled. Would it not be better to remove it entirely?


I agree with you. I just thought that the only thing a decoder should care
is its decoding logic, but not including decoder management. My idaea is:
     1) use enabled_protocols to select decoders in ir_raw.c, but not
placed in decoders to do the judgement.
     2) remove  allowed_protocols or just use it to set the default
decoder (also should rename allowed_protocols  to default_protocol).

I also have a question:
     Is there a requirement that one more decoders are enabled for a
IR device at the same time?
    And if that will lead to a issue that each decoder may decode a
same pulse sequence to different evnets since their protocol is
different?

[Du, Changbin]
>
>
> >               raw->prev_ev = ev;
> >               mutex_unlock(&ir_raw_handler_lock);
> >       }
> > --
> > 1.7.9.5
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-media" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2012-09-04  3:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-01  1:57 [RFC PATCH] [media] rc: filter out not allowed protocols when decoding Du, Changbin
2012-09-03 13:03 ` Sean Young
     [not found]   ` <CABgQ-ThYGdvhmpf+=GcLpE-qFAhrDUc1j07+XqohDNRa9bStiw@mail.gmail.com>
2012-09-04  3:06     ` Changbin Du [this message]
2012-09-04 12:21       ` Sean Young
2012-09-06  9:36         ` Changbin Du

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=CABgQ-TjrXbqKaOd9fDptV2fUiyVTpzZ31K_iZ+HQ+3PGmWoHRw@mail.gmail.com \
    --to=changbin.du@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=sean@mess.org \
    --cc=sfr@canb.auug.org.au \
    --cc=srinivas.kandagatla@st.com \
    /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).