From: Heiner Kallweit <hkallweit1@gmail.com>
To: Sean Young <sean@mess.org>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
linux-media@vger.kernel.org
Subject: Re: [PATCH] media: rc: nuvoton: decrease size of raw event fifo
Date: Tue, 5 Jul 2016 08:05:16 +0200 [thread overview]
Message-ID: <6d3a95cb-c082-d3f2-6e91-dfadafedf631@gmail.com> (raw)
In-Reply-To: <20160704210650.GA29388@gofer.mess.org>
Am 04.07.2016 um 23:06 schrieb Sean Young:
> On Mon, Jul 04, 2016 at 10:51:50PM +0200, Heiner Kallweit wrote:
>> Am 04.07.2016 um 22:13 schrieb Sean Young:
>>> On Wed, May 18, 2016 at 10:29:41PM +0200, Heiner Kallweit wrote:
>>>> This chip has a 32 byte HW FIFO only. Therefore the default fifo size
>>>> of 512 raw events is not needed and can be significantly decreased.
>>>>
>>>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>>>
>>> The 32 byte hardware queue is read from an interrupt handler and added
>>> to the kfifo. The kfifo is read by the decoders in a seperate kthread
>>> (in ir_raw_event_thread). If we have a long IR (e.g. nec which has
>>> 66 edges) and the kthread is not scheduled in time (e.g. high load), will
>>> we not end up with an overflow in the kfifo and unable to decode it?
>>>
>> The interrupt handler is triggered latest when 24 bytes have been read.
>> (at least that's how the chip gets configured at the moment)
>> This gives the decoder thread at least 8 bytes time to process the
>> kfifo. This should be sufficient even under high load.
>
> No, it gives the interrupt handler at least 8 bytes time to read the
> hardware fifo (and add it to the kfifo). There are no guarantees about
> when the decoder kthread runs (which reads the kfifo).
>
> To put it another way, in the nuvoton interrupt handler, you call
> ir_raw_event_handle() which does a wake_up_process(). That puts the
> decoder process (it has a pid) in a runnable state and it will run at
> some future time.
>
You're right, that's the more precise description.
These 8 bytes time give the decoder process few msec's to start.
(Not sure wheter there's any protocol resulting in much shorter time.)
At least during my tests this was always sufficient.
However if you think 32 bytes might be too small as kfifo size I'd
also be fine with increasing it. The result should still be better
than the default size of 512.
Heiner
>
> Sean
>
next prev parent reply other threads:[~2016-07-05 6:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-18 20:29 [PATCH] media: rc: nuvoton: decrease size of raw event fifo Heiner Kallweit
2016-07-04 20:13 ` Sean Young
2016-07-04 20:51 ` Heiner Kallweit
2016-07-04 21:06 ` Sean Young
2016-07-05 6:05 ` Heiner Kallweit [this message]
2016-07-05 9:17 ` Sean Young
2016-07-05 17:48 ` Heiner Kallweit
2016-07-06 9:37 ` Sean Young
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=6d3a95cb-c082-d3f2-6e91-dfadafedf631@gmail.com \
--to=hkallweit1@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=sean@mess.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