public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>,
	linux-serial@vger.kernel.org, torvalds@linux-foundation.org
Subject: Wrong GIT author ? also bugs: serial: Add uart driver for i.MX23/28
Date: Fri, 18 Mar 2011 11:29:20 +0000	[thread overview]
Message-ID: <20110318112920.07148450@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <201103180302.p2I326tA020159@hera.kernel.org>

>     serial: Add auart driver for i.MX23/28
>     
>     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

You have a few things that need fixing, one of which is quite nasty

> + * Freescale STMP37XX/STMP378X Application UART driver
> + *
> + * Author: dmitry pervushin <dimka@embeddedalley.com>

So its signed off by one person and without a signature from the author ?
Is that intentional

And it git we have

Author:     Sascha Hauer <s.hauer@pengutronix.de>

which from the header block appears to be untrue ?

> +static void mxs_auart_rx_chars(struct mxs_auart_port *s)
> +{
> +	struct tty_struct *tty = s->port.state->port.tty;
> +	u32 stat = 0;

tty may be NULL at this point, in which case your code will try and push
bits through a NULL pointer and crash

A user can seek to make tty NULL at the right moment by judicious use of
vhangup, and a remote device can use carrier signals and bit timing to
mount an attack. See tty_port_tty_get() and/or hold the port lock over
the IRQ as other drivers do. For the uart stuff I'd hold the port lock as
the rest of the code in the uart layer sort of assumes that


> +static void mxs_auart_settermios(struct uart_port *u,
> +				 struct ktermios *termios,
> +				 struct ktermios *old)

Minor things here
- You need to set the termios bits to reflect the mode you actually set.
  So as you don't seem to support mark/space you need to clear the bit,
  ditto h/w flow control if not supported

- You also need to report back the actual baud rate


> +static irqreturn_t mxs_auart_irq_handle(int irq, void *context)
> +{
> +	u32 istatus, istat;
> +	struct mxs_auart_port *s = context;
> +	u32 stat = readl(s->port.membase + AUART_STAT);

Your IRQ handler either needs to take the port lock or have the
underlying methods do that or their own full locking, you aren't doing
that.


       reply	other threads:[~2011-03-18 11:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201103180302.p2I326tA020159@hera.kernel.org>
2011-03-18 11:29 ` Alan Cox [this message]
2011-03-18 13:39   ` Wrong GIT author ? also bugs: serial: Add uart driver for i.MX23/28 Sascha Hauer
2011-03-18 13:49     ` Alan Cox
2011-03-29  9:14   ` Uwe Kleine-König
2011-03-29  9:33     ` Alan Cox
2011-04-12  7:28       ` Uwe Kleine-König

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=20110318112920.07148450@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=torvalds@linux-foundation.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