From: Srinivas KANDAGATLA <srinivas.kandagatla@st.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org,
Andrew Morton <akpm@linux-foundation.org>,
Arnd Bergmann <arnd@arndb.de>,
"David S. Miller" <davem@davemloft.net>,
devicetree-discuss@lists.ozlabs.org,
Grant Likely <grant.likely@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
John Stultz <john.stultz@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org, Mark Brown <broonie@kernel.org>,
Mauro Carvalho Chehab <mchehab@redhat.com>,
Olof Johansson <olof@lixom.net>,
Rob Herring <rob.herring@calxeda.com>,
Rob Landley <rob@landley.net>,
Samuel Ortiz <sameo@linux.intel.com>,
Stephen Gallimore <stephen.gallimore@st.com>,
Stuart Menefy <stuart.menefy@st.com>,
Thomas Gleixner <tglx@linutronix.de>,
Tony Prisk <linux@prisktech.co.nz>
Subject: Re: [PATCH v2 01/11] serial:st-asc: Add ST ASC driver.
Date: Mon, 10 Jun 2013 12:53:55 +0100 [thread overview]
Message-ID: <51B5BE53.2000105@st.com> (raw)
In-Reply-To: <20130610093511.GT18614@n2100.arm.linux.org.uk>
Thankyou for your comment and suggestion,
I will fix the POSIX compliant issue.
On 10/06/13 10:35, Russell King - ARM Linux wrote:
> On Mon, Jun 10, 2013 at 10:21:00AM +0100, Srinivas KANDAGATLA wrote:
>> This patch adds support to ASC (asynchronous serial controller)
>> driver, which is basically a standard serial driver. This IP is common
>> across all the ST parts for settop box platforms.
>>
>> ASC is embedded in ST COMMS IP block. It supports Rx & Tx functionality.
>> It support all industry standard baud rates.
>
> Your driver is not POSIX compliant.
>
>> + for (; count != 0; count--) {
>> + c = asc_in(port, ASC_RXBUF);
>> + flag = TTY_NORMAL;
>> + port->icount.rx++;
>> +
>> + if (unlikely(c & ASC_RXBUF_FE)) {
>> + if (c == ASC_RXBUF_FE) {
>> + port->icount.brk++;
>> + if (uart_handle_break(port))
>> + continue;
>> + flag = TTY_BREAK;
>> + } else {
>> + port->icount.frame++;
>> + flag = TTY_FRAME;
>> + }
>> + } else if (ascport->check_parity &&
>> + unlikely(c & ASC_RXBUF_PE)) {
>> + port->icount.parity++;
>> + flag = TTY_PARITY;
>> + }
>> +
>> + if (uart_handle_sysrq_char(port, c))
>> + continue;
>> + tty_insert_flip_char(tport, c & 0xff, flag);
>> + }
>> + if (overrun) {
>> + port->icount.overrun++;
>> + tty_insert_flip_char(tport, 0, TTY_OVERRUN);
>> + }
>
> No support for ignoring error conditions. No support for ignoring all
> input... and:
>
>> +static void asc_set_termios(struct uart_port *port, struct ktermios *termios,
>> + struct ktermios *old)
>> +{
>> + struct asc_port *ascport = to_asc_port(port);
>> + unsigned int baud;
>> + u32 ctrl_val;
>> + tcflag_t cflag;
>> + unsigned long flags;
>> +
>> + port->uartclk = clk_get_rate(ascport->clk);
>> +
>> + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
>> + cflag = termios->c_cflag;
>> +
>> + spin_lock_irqsave(&port->lock, flags);
>> +
>> + /* read control register */
>> + ctrl_val = asc_in(port, ASC_CTL);
>> +
>> + /* stop serial port and reset value */
>> + asc_out(port, ASC_CTL, (ctrl_val & ~ASC_CTL_RUN));
>> + ctrl_val = ASC_CTL_RXENABLE | ASC_CTL_FIFOENABLE;
>> +
>> + /* reset fifo rx & tx */
>> + asc_out(port, ASC_TXRESET, 1);
>> + asc_out(port, ASC_RXRESET, 1);
>> +
>> + /* set character length */
>> + if ((cflag & CSIZE) == CS7) {
>> + ctrl_val |= ASC_CTL_MODE_7BIT_PAR;
>> + } else {
>> + ctrl_val |= (cflag & PARENB) ? ASC_CTL_MODE_8BIT_PAR :
>> + ASC_CTL_MODE_8BIT;
>> + }
>> +
>> + ascport->check_parity = (cflag & PARENB) ? 1 : 0;
>> +
>> + /* set stop bit */
>> + ctrl_val |= (cflag & CSTOPB) ? ASC_CTL_STOP_2BIT : ASC_CTL_STOP_1BIT;
>> +
>> + /* odd parity */
>> + if (cflag & PARODD)
>> + ctrl_val |= ASC_CTL_PARITYODD;
>> +
>> + /* hardware flow control */
>> + if ((cflag & CRTSCTS) && ascport->hw_flow_control)
>> + ctrl_val |= ASC_CTL_CTSENABLE;
>
> This doesn't reflect those facts back into the termios structure to
> indicate that they aren't supported.
>
> Consider using uart_port's ignore and read status masks to implement
> the break, framing, parity and overrun checking in your interrupt
> handler using the same methodology as drivers like 8250, amba-pl011
> etc. That will help you get these code sequences correct.
>
>
next prev parent reply other threads:[~2013-06-10 11:53 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <yes>
2013-06-10 9:17 ` [PATCH v2 00/11] ARM:STixxxx: Add STixxxx platform and board support Srinivas KANDAGATLA
2013-06-10 9:21 ` [PATCH v2 01/11] serial:st-asc: Add ST ASC driver Srinivas KANDAGATLA
2013-06-10 9:35 ` Russell King - ARM Linux
2013-06-10 11:53 ` Srinivas KANDAGATLA [this message]
[not found] ` <1370855828-5318-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-06-10 9:21 ` [PATCH v2 02/11] clocksource:global_timer: Add ARM global timer support Srinivas KANDAGATLA
[not found] ` <1370856087-6452-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-06-10 13:13 ` Linus Walleij
[not found] ` <CACRpkdbQCRKBzRF4HzNsXHwXCLJJcFZ9T36GPmmYsnX1OfgGRg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-10 13:41 ` Srinivas KANDAGATLA
2013-06-11 14:05 ` Srinivas KANDAGATLA
[not found] ` <51B72E9A.6070006-qxv4g6HH51o@public.gmane.org>
2013-06-11 20:13 ` Linus Walleij
2013-06-12 10:45 ` Srinivas KANDAGATLA
2013-06-10 9:21 ` [PATCH v2 03/11] regmap: Add regmap_field APIs Srinivas KANDAGATLA
[not found] ` <1370856118-6503-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-06-11 10:48 ` Mark Brown
2013-06-11 11:36 ` Srinivas KANDAGATLA
2013-06-10 9:27 ` [PATCH v2 08/11] ARM:stixxxx: Add DEBUG_LL console support Srinivas KANDAGATLA
2013-06-10 9:28 ` [PATCH v2 10/11] ARM:stih41x: Add B2000 board support Srinivas KANDAGATLA
2013-06-10 9:22 ` [PATCH v2 04/11] mfd:stixxxx-syscfg: Add ST System Configuration support Srinivas KANDAGATLA
[not found] ` <1370856147-6552-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-06-10 13:16 ` Linus Walleij
2013-06-10 13:52 ` Srinivas KANDAGATLA
2013-06-10 14:02 ` Arnd Bergmann
2013-06-10 15:51 ` Srinivas KANDAGATLA
2013-06-11 7:41 ` Srinivas KANDAGATLA
2013-06-10 9:22 ` [PATCH v2 05/11] pinctrl:stixxxx: Add pinctrl and pinconf support Srinivas KANDAGATLA
[not found] ` <1370856161-6600-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-06-16 12:17 ` Linus Walleij
2013-06-17 13:31 ` Srinivas KANDAGATLA
[not found] ` <51BF0FC2.4000601-qxv4g6HH51o@public.gmane.org>
2013-06-17 16:27 ` Linus Walleij
2013-06-10 9:26 ` =?yes?q?=5BPATCH=20v2=2006/11=5D=20ARM=3Astixxxx=3A=20Add=20STiH415=20SOC=20support?= Srinivas KANDAGATLA
2013-06-10 9:55 ` [PATCH v2 06/11] ARM:stixxxx: Add STiH415 SOC support Michal Simek
2013-06-10 11:08 ` Michal Simek
[not found] ` <CAHTX3d+dk3W_9b7SVUokWq4KYXnj=Z1=WPj5zJ-gUvJqqwE=+Q@mail.gmail.com>
2013-06-10 11:46 ` Srinivas KANDAGATLA
2013-06-10 23:19 ` Russell King - ARM Linux
2013-06-11 6:50 ` Srinivas KANDAGATLA
2013-06-13 11:56 ` Russell King - ARM Linux
2013-06-13 12:41 ` Srinivas KANDAGATLA
2013-06-13 12:47 ` Linus Walleij
[not found] ` <1370856381-6644-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-06-10 12:43 ` Linus Walleij
[not found] ` <CACRpkdZ-xnDO+bte4tyKDWwY4A_qWUhLru3dUmuY9MQwseP3uQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-10 16:38 ` Srinivas KANDAGATLA
[not found] ` <51B6011E.1060909-qxv4g6HH51o@public.gmane.org>
2013-06-14 7:31 ` Srinivas KANDAGATLA
[not found] ` <51BAC6EC.8000703-qxv4g6HH51o@public.gmane.org>
2013-06-19 18:59 ` Linus Walleij
2013-06-10 9:27 ` [PATCH v2 07/11] ARM:stixxxx: Add STiH416 " Srinivas KANDAGATLA
2013-06-10 13:52 ` Arnd Bergmann
2013-06-10 16:17 ` Srinivas KANDAGATLA
2013-06-14 7:12 ` Srinivas KANDAGATLA
2013-06-19 18:34 ` Linus Walleij
2013-06-10 9:27 ` [PATCH v2 09/11] ARM:stixxxx: Add stixxxx options to multi_v7_defconfig Srinivas KANDAGATLA
2013-06-10 10:40 ` Mark Rutland
2013-06-10 10:58 ` Srinivas KANDAGATLA
2013-06-10 13:15 ` Mark Rutland
2013-06-13 9:24 ` Srinivas KANDAGATLA
2013-06-17 9:32 ` Mark Rutland
2013-06-10 9:28 ` [PATCH v2 11/11] ARM:stih41x: Add B2020 board support Srinivas KANDAGATLA
2014-10-29 20:28 ` [PATCH v2 0/4] Enable PCI controller for Keystone SoCs Murali Karicheri
2014-10-29 20:28 ` [PATCH v2 3/4] ARM: dts: keystone: add DT bindings for PCI controller for port 0 Murali Karicheri
2014-10-29 20:28 ` [PATCH v2 4/4] ARM: dts: keystone-k2e: add DT bindings for PCI controller for port 1 Murali Karicheri
2014-10-29 21:10 ` [PATCH v2 0/4] Enable PCI controller for Keystone SoCs santosh shilimkar
2015-02-12 7:56 ` [PATCH] pinctrl: mediatek: Fix build error in Mediatek pinctrl driver Hongzhou Yang
2015-02-20 10:04 ` Linus Walleij
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=51B5BE53.2000105@st.com \
--to=srinivas.kandagatla@st.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=john.stultz@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=linux@prisktech.co.nz \
--cc=mchehab@redhat.com \
--cc=olof@lixom.net \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=sameo@linux.intel.com \
--cc=stephen.gallimore@st.com \
--cc=stuart.menefy@st.com \
--cc=tglx@linutronix.de \
/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).