From: peter@hurleysoftware.com (Peter Hurley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd parity
Date: Mon, 17 Aug 2015 12:24:20 -0400 [thread overview]
Message-ID: <55D20AB4.4030405@hurleysoftware.com> (raw)
In-Reply-To: <59506B47DEDD3943ABF9AC60020F4E2978D6E7EA@XAP-PVEXMBX02.xlnx.xilinx.com>
On 08/17/2015 11:55 AM, Anirudha Sarangi wrote:
> Hi,
>
>> -----Original Message-----
>> From: Peter Hurley [mailto:peter at hurleysoftware.com]
>> Sent: Monday, August 17, 2015 9:09 PM
>> To: Michal Simek
>> Cc: linux-kernel at vger.kernel.org; monstr at monstr.eu; Anirudha Sarangi; Soren
>> Brinkmann; Jiri Slaby; linux-serial at vger.kernel.org; Greg Kroah-Hartman; linux-
>> arm-kernel at lists.infradead.org
>> Subject: Re: [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd parity
>>
>> On 08/17/2015 03:22 AM, Michal Simek wrote:
>>> From: Anirudha Sarangi <anirudha.sarangi@xilinx.com>
>>>
>>> Existing set_termios does not handle the option for enabling odd
>>> parity. This patch fixes it.
>>
>> NAK. PARODD does not enable parity generation or detection.
>>
> What if someone is trying to change from even to odd parity?
If userspace wants odd parity, then c_cflag must have both
PARENB and PARODD set.
Just PARODD does nothing.
>From SUS v4, General Terminal Interface, 11.2.4 Control Modes;
"If PARENB is set, parity generation and detection shall be enabled
and a parity bit is added to each byte. If parity is enabled, PARODD
shall specify odd parity if set; otherwise, even parity shall be used."
> In this conditional case, we setup some register bit for the same.
> Is the above use case not a valid one?
>
> Regards
> Anirudha
>
>> Regards,
>> Peter Hurley
>>
>>> Signed-off-by: Anirudha Sarangi <anirudh@xilinx.com>
>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>> ---
>>>
>>> drivers/tty/serial/xilinx_uartps.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/tty/serial/xilinx_uartps.c
>>> b/drivers/tty/serial/xilinx_uartps.c
>>> index 009e0dbc12d2..a3020344ac9d 100644
>>> --- a/drivers/tty/serial/xilinx_uartps.c
>>> +++ b/drivers/tty/serial/xilinx_uartps.c
>>> @@ -723,7 +723,7 @@ static void cdns_uart_set_termios(struct uart_port
>> *port,
>>> else
>>> cval |= CDNS_UART_MR_STOPMODE_1_BIT; /* 1 STOP bit */
>>>
>>> - if (termios->c_cflag & PARENB) {
>>> + if ((termios->c_cflag & PARENB) || (termios->c_cflag & PARODD)) {
>>> /* Mark or Space parity */
>>> if (termios->c_cflag & CMSPAR) {
>>> if (termios->c_cflag & PARODD)
>>>
>
>
>
> This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
>
next prev parent reply other threads:[~2015-08-17 16:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-17 7:22 [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd parity Michal Simek
2015-08-17 7:22 ` [PATCH 2/4] serial: xuartps: Do not handle overrun errors under IGNPAR option Michal Simek
2015-08-17 15:49 ` Peter Hurley
2015-08-17 15:58 ` Anirudha Sarangi
2015-08-17 16:19 ` Peter Hurley
2015-08-17 18:07 ` Anirudha Sarangi
2015-08-17 7:22 ` [PATCH 3/4] serial: xuartps: Do not enable parity error interrupt Michal Simek
2015-08-17 7:22 ` [PATCH 4/4] serial: xuartps: Rewrite the interrupt handling logic Michal Simek
2015-08-17 15:55 ` Peter Hurley
2015-08-17 16:00 ` Anirudha Sarangi
2015-08-17 18:46 ` Peter Hurley
2015-08-17 15:39 ` [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd parity Peter Hurley
2015-08-17 15:55 ` Anirudha Sarangi
2015-08-17 16:24 ` Peter Hurley [this message]
2015-08-17 18:06 ` Anirudha Sarangi
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=55D20AB4.4030405@hurleysoftware.com \
--to=peter@hurleysoftware.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).