From: Stephen Warren <swarren@wwwdotorg.org>
To: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Stephen Warren <swarren@nvidia.com>,
Alan <gnomes@lxorguk.ukuu.org.uk>,
Jingoo Han <jg1.han@samsung.com>,
linux-kernel@vger.kernel.org,
Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>,
linux-serial@vger.kernel.org, yrl.pp-manager.tt@hitachi.com,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Aaron Sierra <asierra@xes-inc.com>, Jiri Slaby <jslaby@suse.cz>
Subject: Re: [PATCH V5.1] serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers
Date: Wed, 16 Apr 2014 11:04:03 -0600 [thread overview]
Message-ID: <534EB803.5030101@wwwdotorg.org> (raw)
In-Reply-To: <534DE62C.3090300@hitachi.com>
On 04/15/2014 08:08 PM, Yoshihiro YUNOMAE wrote:
> Hi Stephen,
>
> Thank you for your review.
>
> (2014/04/16 2:39), Stephen Warren wrote:
>> On 04/15/2014 02:06 AM, Yoshihiro YUNOMAE wrote:
>>> /* I found a bug in V5, so I resend this as V5.1. Please do not
>>> review V5. */
>>>
>>> Add tunable RX interrupt trigger I/F of FIFO buffers.
>>> Serial devices are used as not only message communication devices but
>>> control
>>> or sending communication devices. For the latter uses, normally small
>>> data
>>> will be exchanged, so user applications want to receive data unit as
>>> soon as
>>> possible for real-time tendency. If we have a sensor which sends a 1
>>> byte data
>>> each time and must control a device based on the sensor feedback, the RX
>>> interrupt should be triggered for each data.
>>>
>>> According to HW specification of serial UART devices, RX interrupt
>>> trigger
>>> can be changed, but the trigger is hard-coded. For example, RX
>>> interrupt trigger
>>> in 16550A can be set to 1, 4, 8, or 14 bytes for HW, but current
>>> driver sets
>>> the trigger to only 8bytes.
>>> diff --git a/drivers/tty/serial/8250/8250_core.c
>>> b/drivers/tty/serial/8250/8250_core.c
>>
>>> @@ -2275,10 +2276,9 @@ serial8250_do_set_termios(struct uart_port
>>> *port, struct ktermios *termios,
>>
>>> if (up->capabilities & UART_CAP_FIFO && port->fifosize > 1) {
>>> - fcr = uart_config[port->type].fcr;
>>> - if ((baud < 2400 && !up->dma) || fifo_bug) {
>>> - fcr &= ~UART_FCR_TRIGGER_MASK;
>>> - fcr |= UART_FCR_TRIGGER_1;
>>> + /* NOTE: If fifo_bug is not set, a uaser can set RX_trigger. */
>>> + if ((baud < 2400 && !up->dma &&
>>> + (up->fcr == uart_config[port->type].fcr)) ||
>>> up->fifo_bug) {
>>> + up->fcr &= ~UART_FCR_TRIGGER_MASK;
>>> + up->fcr |= UART_FCR_TRIGGER_1;
>>> }
>>> }
>>
>> Does the "(up->fcr == uart_config[port->type].fcr)" term prevent the
>> user from changing the trigger level multiple times? Perhaps this is
>> intended?
>
> No, this means that if a user changed FCR value before setting termios,
> use the changed value because the user think changed value is always
> set. But, I thought this is not straightforward and it cannot help
> when the user want to use default FCR value.
> Could I add FCR changed flag(user_changed_fcr) in uart_8250_port
> structure and check the flag here?
> Or shouldn't the driver check the user changing?
Oh, I wasn't aware that the user could change FCR directly. To be
honest, I'm not sure of the best way to resolve that kind of conflict...
next prev parent reply other threads:[~2014-04-16 17:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-15 5:52 [PATCH V5] serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers Yoshihiro YUNOMAE
2014-04-15 8:06 ` [PATCH V5.1] " Yoshihiro YUNOMAE
2014-04-15 10:10 ` One Thousand Gnomes
2014-04-16 1:06 ` Yoshihiro YUNOMAE
2014-04-15 17:39 ` Stephen Warren
2014-04-16 2:08 ` Yoshihiro YUNOMAE
2014-04-16 17:04 ` Stephen Warren [this message]
2014-04-17 2:38 ` Yoshihiro YUNOMAE
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=534EB803.5030101@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=asierra@xes-inc.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=jg1.han@samsung.com \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=swarren@nvidia.com \
--cc=yoshihiro.yunomae.ez@hitachi.com \
--cc=yrl.pp-manager.tt@hitachi.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