RE: [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd parity

2015-08-17 Thread Anirudha Sarangi
Hi,

> -Original Message-
> From: Peter Hurley [mailto:pe...@hurleysoftware.com]
> Sent: Monday, August 17, 2015 9:54 PM
> To: Anirudha Sarangi; Michal Simek
> Cc: linux-kernel@vger.kernel.org; mon...@monstr.eu; Soren Brinkmann; Jiri
> Slaby; linux-ser...@vger.kernel.org; Greg Kroah-Hartman; linux-arm-
> ker...@lists.infradead.org
> Subject: Re: [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd 
> parity
>
> On 08/17/2015 11:55 AM, Anirudha Sarangi wrote:
> > Hi,
> >
> >> -Original Message-
> >> From: Peter Hurley [mailto:pe...@hurleysoftware.com]
> >> Sent: Monday, August 17, 2015 9:09 PM
> >> To: Michal Simek
> >> Cc: linux-kernel@vger.kernel.org; mon...@monstr.eu; Anirudha Sarangi;
> >> Soren Brinkmann; Jiri Slaby; linux-ser...@vger.kernel.org; Greg
> >> Kroah-Hartman; linux- arm-ker...@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 
> >>>
> >>> 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."
>
>
Thanks a lot. I will incorporate the changes.
>
> > 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 
> >>> Signed-off-by: Michal Simek 
> >>> ---
> >>>
> >>>  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.
> >



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.



Re: [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd parity

2015-08-17 Thread Peter Hurley
On 08/17/2015 11:55 AM, Anirudha Sarangi wrote:
> Hi,
> 
>> -Original Message-
>> From: Peter Hurley [mailto:pe...@hurleysoftware.com]
>> Sent: Monday, August 17, 2015 9:09 PM
>> To: Michal Simek
>> Cc: linux-kernel@vger.kernel.org; mon...@monstr.eu; Anirudha Sarangi; Soren
>> Brinkmann; Jiri Slaby; linux-ser...@vger.kernel.org; Greg Kroah-Hartman; 
>> linux-
>> arm-ker...@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 
>>>
>>> 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 
>>> Signed-off-by: Michal Simek 
>>> ---
>>>
>>>  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.
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd parity

2015-08-17 Thread Anirudha Sarangi
Hi,

> -Original Message-
> From: Peter Hurley [mailto:pe...@hurleysoftware.com]
> Sent: Monday, August 17, 2015 9:09 PM
> To: Michal Simek
> Cc: linux-kernel@vger.kernel.org; mon...@monstr.eu; Anirudha Sarangi; Soren
> Brinkmann; Jiri Slaby; linux-ser...@vger.kernel.org; Greg Kroah-Hartman; 
> linux-
> arm-ker...@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 
> >
> > 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?
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 
> > Signed-off-by: Michal Simek 
> > ---
> >
> >  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.



Re: [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd parity

2015-08-17 Thread Peter Hurley
On 08/17/2015 03:22 AM, Michal Simek wrote:
> From: Anirudha Sarangi 
> 
> 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.

Regards,
Peter Hurley

> Signed-off-by: Anirudha Sarangi 
> Signed-off-by: Michal Simek 
> ---
> 
>  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)
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd parity

2015-08-17 Thread Anirudha Sarangi
Hi,

 -Original Message-
 From: Peter Hurley [mailto:pe...@hurleysoftware.com]
 Sent: Monday, August 17, 2015 9:54 PM
 To: Anirudha Sarangi; Michal Simek
 Cc: linux-kernel@vger.kernel.org; mon...@monstr.eu; Soren Brinkmann; Jiri
 Slaby; linux-ser...@vger.kernel.org; Greg Kroah-Hartman; linux-arm-
 ker...@lists.infradead.org
 Subject: Re: [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd 
 parity

 On 08/17/2015 11:55 AM, Anirudha Sarangi wrote:
  Hi,
 
  -Original Message-
  From: Peter Hurley [mailto:pe...@hurleysoftware.com]
  Sent: Monday, August 17, 2015 9:09 PM
  To: Michal Simek
  Cc: linux-kernel@vger.kernel.org; mon...@monstr.eu; Anirudha Sarangi;
  Soren Brinkmann; Jiri Slaby; linux-ser...@vger.kernel.org; Greg
  Kroah-Hartman; linux- arm-ker...@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.sara...@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.


Thanks a lot. I will incorporate the changes.

  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 anir...@xilinx.com
  Signed-off-by: Michal Simek michal.si...@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.
 



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.



Re: [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd parity

2015-08-17 Thread Peter Hurley
On 08/17/2015 11:55 AM, Anirudha Sarangi wrote:
 Hi,
 
 -Original Message-
 From: Peter Hurley [mailto:pe...@hurleysoftware.com]
 Sent: Monday, August 17, 2015 9:09 PM
 To: Michal Simek
 Cc: linux-kernel@vger.kernel.org; mon...@monstr.eu; Anirudha Sarangi; Soren
 Brinkmann; Jiri Slaby; linux-ser...@vger.kernel.org; Greg Kroah-Hartman; 
 linux-
 arm-ker...@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.sara...@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 anir...@xilinx.com
 Signed-off-by: Michal Simek michal.si...@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.
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd parity

2015-08-17 Thread Anirudha Sarangi
Hi,

 -Original Message-
 From: Peter Hurley [mailto:pe...@hurleysoftware.com]
 Sent: Monday, August 17, 2015 9:09 PM
 To: Michal Simek
 Cc: linux-kernel@vger.kernel.org; mon...@monstr.eu; Anirudha Sarangi; Soren
 Brinkmann; Jiri Slaby; linux-ser...@vger.kernel.org; Greg Kroah-Hartman; 
 linux-
 arm-ker...@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.sara...@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?
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 anir...@xilinx.com
  Signed-off-by: Michal Simek michal.si...@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.



Re: [PATCH 1/4] serial: xuartps: Fix termios issue for enabling odd parity

2015-08-17 Thread Peter Hurley
On 08/17/2015 03:22 AM, Michal Simek wrote:
 From: Anirudha Sarangi anirudha.sara...@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.

Regards,
Peter Hurley

 Signed-off-by: Anirudha Sarangi anir...@xilinx.com
 Signed-off-by: Michal Simek michal.si...@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)
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/