mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Daniel Walker <dwalker@codeaurora.org>
Cc: linux-kernel@vger.kernel.org,
	"Hyok S. Choi" <hyok.choi@samsung.com>,
	Tony Lindgren <tony@atomide.com>,
	Jeff Ohlstein <johlstei@quicinc.com>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	Ben Dooks <ben-linux@fluff.org>, Alan Cox <alan@linux.intel.com>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Mike Frysinger <vapier@gentoo.org>,
	Feng Tang <feng.tang@intel.com>,
	Tobias Klauser <tklauser@distanz.ch>,
	Jason Wessel <jason.wessel@windriver.com>,
	Philippe Langlais <philippe.langlais@stericsson.com>
Subject: Re: [PATCH] serial: DCC(JTAG) serial and console emulation support
Date: Thu, 7 Oct 2010 21:50:19 +0100	[thread overview]
Message-ID: <20101007215019.17b4a34a@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <1286476616-3373-1-git-send-email-dwalker@codeaurora.org>


> +	  Say Y here if you want to install DCC driver as a normal serial port
> +	  /dev/ttyS0 (major 4, minor 64). Otherwise, it appears as /dev/ttyJ0
> +	  (major 4, minor 128) and can co-exist with other UARTs, such as
> +	  8250/16C550 compatibles.
> +

NAK to both

ttyJ0 is 204,186 for "JTAG1 DCC protocol based serial"

so there is an existing name and minor allocation, which as you won't be
using two of them should be quite usable.

If you want to be able to switch at runtime to pretend it is ttyS0 please
deal with that in your user space. The same rules apply to you as have
been applied to everyone else who has tried to implement this same crap
in their uart driver too (we'd have it in about 30 by now otherwise)

>
> +static inline void dcc_rx_chars(struct uart_port *port)
> +{
> +	unsigned char ch;
> +	struct tty_struct *tty = port->state->port.tty;

Not safe in the general case - you might get a hangup here then call
through a NULL pointer. Please use the proper tty_port helpers.


> +static inline void dcc_overrun_chars(struct uart_port *port)
> +{
> +	port->icount.overrun++;
> +}

Why make this a function?


> +static void
> +dcc_set_termios(struct uart_port *port, struct ktermios *termios,
> +		struct ktermios *old)
> +{
> +	unsigned int baud, quot;
> +
> +	/*
> +	 * We don't support parity, stop bits, or anything other
> +	 * than 8 bits, so clear these termios flags.
> +	 */
> +	termios->c_cflag &= ~(CSIZE | CSTOPB | PARENB | PARODD | CREAD);
> +	termios->c_cflag |= CS8;
> +
> +	/*
> +	 * We don't appear to support any error conditions either.
> +	 */
> +	termios->c_iflag &= ~(INPCK | IGNPAR | IGNBRK | BRKINT);

There is a helper function for keeping the hardware bits fixed. If your
hardware is fixed then please use it.

Alan

  parent reply	other threads:[~2010-10-07 20:26 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07 18:36 Daniel Walker
2010-10-07 19:25 ` Mike Frysinger
2010-10-07 19:39   ` Daniel Walker
2010-10-07 19:48     ` Mike Frysinger
2010-10-07 19:58       ` Daniel Walker
2010-10-07 20:02         ` Mike Frysinger
2010-10-07 20:06           ` Daniel Walker
2010-10-07 20:47             ` Mike Frysinger
2010-10-07 20:59               ` Daniel Walker
2010-10-07 21:05                 ` Mike Frysinger
2010-10-07 21:17                   ` Daniel Walker
2010-10-07 21:32                     ` Mike Frysinger
2010-10-07 21:50                       ` Daniel Walker
2010-10-07 20:52   ` Alan Cox
2010-10-07 20:37     ` Daniel Walker
2010-10-07 21:08       ` Alan Cox
2010-10-07 20:50 ` Alan Cox [this message]
2010-10-07 20:36   ` Daniel Walker
2010-10-07 21:05     ` Alan Cox
2010-10-07 20:51       ` Daniel Walker
2010-10-07 21:03         ` Mike Frysinger
2010-10-07 21:14           ` Daniel Walker
2010-10-08  8:13             ` Alan Cox
2010-10-08 15:23               ` Daniel Walker
2010-10-08 15:40                 ` Greg KH
2010-10-08 16:11                   ` Daniel Walker
2010-10-08 16:56                 ` Alan Cox
2010-10-08 16:45                   ` Daniel Walker
2010-10-08 18:38                     ` Mike Frysinger
2010-10-08 19:01                       ` Daniel Walker
2010-10-08 19:20                         ` Mike Frysinger
2010-10-08 19:50                           ` Daniel Walker
2010-10-08 22:02                             ` Mike Frysinger
2010-10-08 22:22                               ` Daniel Walker
2010-10-09  5:38                                 ` Mike Frysinger
2010-10-07 21:15         ` Greg KH
2010-10-07 21:47           ` Daniel Walker
2010-10-07 21:52             ` Greg KH
2010-10-07 22:11               ` Daniel Walker
2010-10-08  2:04                 ` Mike Frysinger
2010-10-07 21:38         ` Alan Cox
2010-10-07 21:41           ` Daniel Walker
2010-10-08  8:18             ` Alan Cox
2010-10-08 15:16               ` Daniel Walker
2010-10-08  4:59 Daniel Walker
2010-10-08  6:05 ` Mike Frysinger
2010-10-08 19:34 matthieu castet
2010-10-08 19:52 ` Daniel Walker
2010-10-08 19:55 ` Daniel Walker
2010-10-08 20:40   ` matthieu castet

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=20101007215019.17b4a34a@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=alan@linux.intel.com \
    --cc=ben-linux@fluff.org \
    --cc=dwalker@codeaurora.org \
    --cc=feng.tang@intel.com \
    --cc=gregkh@suse.de \
    --cc=hyok.choi@samsung.com \
    --cc=jason.wessel@windriver.com \
    --cc=johlstei@quicinc.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philippe.langlais@stericsson.com \
    --cc=tklauser@distanz.ch \
    --cc=tony@atomide.com \
    --cc=vapier@gentoo.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

all inboxes | Powered by JetHome®