All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Guillermo Rodriguez Garcia <guille.rodriguez@gmail.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: Fwd: Issues with parity error handling in s3c2410 serial driver
Date: Thu, 8 May 2014 21:55:10 +0200	[thread overview]
Message-ID: <20140508195510.GA8479@kroah.com> (raw)
In-Reply-To: <CABDcavZyCDPpt1MTGpJfgaYnG=oaHcmB-Sqe=PC1SWuQhf-iTg@mail.gmail.com>

On Thu, May 08, 2014 at 01:31:10PM +0200, Guillermo Rodriguez Garcia wrote:
> Hello all,
> 
> I think I have found some issues with the handling of parity errors in the
> s3c2410 serial driver (drivers/tty/serial/samsung.c)
> 
> 1.
> The driver defines S3C2410_UERSTAT_PARITY as 0x1000
> (see http://lxr.free-electrons.com/source/drivers/tty/serial/samsung.c#L265)
> 
> However, at least in the S3C2440, the correct value should be 0x02.
> This matches the definition in include/linux/serial_s3c.h for the S3C2443 (see
> http://lxr.free-electrons.com/source/include/linux/serial_s3c.h#L165)
> 
> 2.
> The driver currently contains code to detect parity errors, but this code is
> guarded by the following check:
> 
> if (unlikely(uerstat & S3C2410_UERSTAT_ANY)) {
> ...
> }
> 
> And the definition of S3C2410_UERSTAT_ANY in include/linux/serial_s3c.h
> does not include the parity bit.
> 
> This means that the code that currently checks for parity errors in the serial
> driver won't actually be run when a parity error occurs. I think that this is a
> bug and that S3C2410_UERSTAT_ANY should also contain the parity bit
> 
> 3.
> The code that detects parity errors does not increment the parity error
> counter in the serial_icounter_struct structure. Other errors (framing and
> overrun) are accounted for -- it is just the parity error that is not traced
> (see http://lxr.free-electrons.com/source/drivers/tty/serial/samsung.c#L277).
> 
> This means that parity errors will not be reported via the TIOCGICOUNT
> ioctl call.
> 
> 
> Can someone comment on the above?

Can you make up a patch to resolve these and be sure to cc: the driver
authors and this list?

thanks,

greg k-h

  reply	other threads:[~2014-05-08 19:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABDcavZnY8-uNhYZkvCEy5sdbAQB2vgcYq1PFiNwpvxj32Xn2Q@mail.gmail.com>
2014-05-08 11:31 ` Fwd: Issues with parity error handling in s3c2410 serial driver Guillermo Rodriguez Garcia
2014-05-08 19:55   ` Greg Kroah-Hartman [this message]
2014-05-09  7:25     ` Guillermo Rodriguez

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=20140508195510.GA8479@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=guille.rodriguez@gmail.com \
    --cc=linux-serial@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.