From: Srinivas KANDAGATLA <srinivas.kandagatla@st.com>
To: Sean Young <sean@mess.org>
Cc: linux-media@vger.kernel.org,
Mauro Carvalho Chehab <m.chehab@samsung.com>,
linux-doc@vger.kernel.org, devicetree@vger.kernel.org,
Rob Herring <rob.herring@calxeda.com>,
Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Ian Campbell <ian.campbell@citrix.com>,
Rob Landley <rob@landley.net>,
Grant Likely <grant.likely@linaro.org>
Subject: Re: [PATCH] media: st-rc: Add ST remote control driver
Date: Fri, 16 Aug 2013 13:17:01 +0100 [thread overview]
Message-ID: <520E183D.701@st.com> (raw)
In-Reply-To: <20130816114035.GA1978@pequod.mess.org>
On 16/08/13 12:40, Sean Young wrote:
> On Fri, Aug 16, 2013 at 11:53:48AM +0100, Srinivas KANDAGATLA wrote:
>> Thanks Sean for the comments.
>> On 16/08/13 09:38, Sean Young wrote:
>>> On Wed, Aug 14, 2013 at 06:27:01PM +0100, Srinivas KANDAGATLA wrote:
>> [...]
>>>> + /* discard the entire collection in case of errors! */
>>>> + dev_info(dev->dev, "IR RX overrun\n");
>>>> + writel(IRB_RX_OVERRUN_INT,
>>>> + dev->rx_base + IRB_RX_INT_CLEAR);
>>>> + continue;
>>>> + }
>>>> +
>>>> + symbol = readl(dev->rx_base + IRB_RX_SYS);
>>>> + mark = readl(dev->rx_base + IRB_RX_ON);
>>>> +
>>>> + if (symbol == IRB_TIMEOUT)
>>>> + last_symbol = 1;
>>>> +
>>>> + /* Ignore any noise */
>>>> + if ((mark > 2) && (symbol > 1)) {
>>>> + symbol -= mark;
>>>> + if (dev->overclocking) { /* adjustments to timings */
>>>> + symbol *= dev->sample_mult;
>>>> + symbol /= dev->sample_div;
>>>> + mark *= dev->sample_mult;
>>>> + mark /= dev->sample_div;
>>>> + }
>>>> +
>>>> + ev.duration = US_TO_NS(mark);
>>>> + ev.pulse = true;
>>>> + ir_raw_event_store(dev->rdev, &ev);
>>>> +
>>>> + if (!last_symbol) {
>>>> + ev.duration = US_TO_NS(symbol);
>>>> + ev.pulse = false;
>>>> + ir_raw_event_store(dev->rdev, &ev);
>>>
>>> Make sure you call ir_raw_event_handle() once a while (maybe every time
>>> the interrupt handler is called?) to prevent the ir kfifo from
>>> overflowing in case of very long IR. ir_raw_event_store() just adds
>>> new edges to the kfifo() but does not flush them to the decoders or
>>> lirc.
>> I agree, but Am not sure it will really help in this case because, we
>> are going to stay in this interrupt handler till we get a
>> last_symbol(full key press/release event).. So calling
>> ir_raw_event_store mulitple times might not help because the
>> ir_raw_event kthread(which is clearing kfifo) which is only scheduled
>> after returning from this interrupt.
>
> If I read it correctly, then this is only true if the fifo contains an
> IRB_TIMEOUT symbol. If not yet, then the interrupt handlers is not
> waiting around for those symbols to arrive.
Yes, as we are clearing the fifo and fifo size is 64 words its always
highly possible that It will contain IRB_TIMEOUT for that interrupt.
Thanks,
srini
>
> Thanks
> Sean
>
prev parent reply other threads:[~2013-08-16 12:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-14 17:27 [PATCH] media: st-rc: Add ST remote control driver Srinivas KANDAGATLA
2013-08-15 8:49 ` Mark Rutland
2013-08-15 12:57 ` Srinivas KANDAGATLA
2013-08-15 13:29 ` Mark Rutland
2013-08-15 14:06 ` Srinivas KANDAGATLA
2013-08-15 14:45 ` Mark Rutland
2013-08-15 13:30 ` Pawel Moll
2013-08-15 13:23 ` Srinivas KANDAGATLA
2013-08-16 8:38 ` Sean Young
2013-08-16 10:53 ` Srinivas KANDAGATLA
2013-08-16 11:40 ` Sean Young
2013-08-16 12:17 ` Srinivas KANDAGATLA [this message]
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=520E183D.701@st.com \
--to=srinivas.kandagatla@st.com \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=sean@mess.org \
--cc=swarren@wwwdotorg.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