public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Philippe Langlais <philippe.langlais@st.com>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	Hans-Peter Oeri <hp@oeri.ch>
Subject: Re: [PATCH] tty: serial: 8250: remove U6715 16550A auto-detection
Date: Thu, 21 Mar 2013 10:28:21 +0200	[thread overview]
Message-ID: <20130321082821.GA2862@xps8300> (raw)
In-Reply-To: <20130320172125.GB28605@kroah.com>

Hi guys,

On Wed, Mar 20, 2013 at 10:21:25AM -0700, Greg Kroah-Hartman wrote:
> On Tue, Mar 19, 2013 at 08:50:09PM +0100, Philippe Langlais wrote:
> > -	if (up->port.type == PORT_16550A && size_fifo(up) == 64) {
> > -		up->port.type = PORT_U6_16550A;
> > -		up->capabilities |= UART_CAP_AFE;
> > -	}
> 
> So you just broke this functionality for all of the other devices it
> does work properly for?  That's not nice, and not acceptable.
> 
> Please fix this properly.

Is there actually anything depending on this quirk? It looks like
U6715 support newer made it to upstream, and I believe the type
PORT_U6_16550A is designed for U6715 only.

In any case, replacing the type PORT_16550A with a type that has
custom capabilities based on fifosize alone feels dangerous to me. 64B
fifo for 16550 compatible UARTs is very common these days. 

Since we have this conditions in autoconfig_16550a(), then would it be
OK to replace it with something like:

-       /*
-        * We distinguish between 16550A and U6 16550A by counting
-        * how many bytes are in the FIFO.
-        */
-       if (up->port.type == PORT_16550A && size_fifo(up) == 64) {
-               up->port.type = PORT_U6_16550A;
-               up->capabilities |= UART_CAP_AFE;
-       }
+       if (up->port.type == PORT_16550A && size_fifo(up) == 64)
+               up->port.fifosize = 64;
+
+       if (up->port.type == PORT_16550A && size_fifo(up) == 128)
+               up->port.fifosize = 128;
 }


We set the port->up.fifosize for a few common fifo sizes, like 64 and
128, instead of replacing the type and capabilities?

Thanks,

-- 
heikki

  reply	other threads:[~2013-03-21  8:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19 19:50 [PATCH] tty: serial: 8250: remove U6715 16550A auto-detection Philippe Langlais
2013-03-20 17:21 ` Greg Kroah-Hartman
2013-03-21  8:28   ` Heikki Krogerus [this message]
2013-03-21  8:36   ` Philippe LANGLAIS

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=20130321082821.GA2862@xps8300 \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hp@oeri.ch \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=philippe.langlais@st.com \
    /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