From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: gregkh@suse.de, alan@linux.intel.com, galak@kernel.crashing.org,
scottwood@freescale.com
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org
Subject: [PATCH 1/3] serial: make bugs field not specific to 8250 type uarts.
Date: Thu, 1 Dec 2011 18:47:36 -0500 [thread overview]
Message-ID: <1322783258-20443-2-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1322783258-20443-1-git-send-email-paul.gortmaker@windriver.com>
There is a struct uart_8250_port that is private to 8250.c
itself, and it had a bugs field. But there is no reason to
assume that hardware bugs are unique to 8250 type UARTS.
Make the bugs field part of the globally visible struct
uart_port and remove the 8250 specific one.
The value in doing so is that it helps pave the way for
allowing arch or platform specific code to pass in information
to the specific uart drivers about uart bugs known to impact
certain platforms that would otherwise be hard to detect from
within the context of the driver itself.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/tty/serial/8250.c | 25 ++++++++++++-------------
include/linux/serial_core.h | 1 +
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index eeadf1b..7c94dbc 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -134,7 +134,6 @@ struct uart_8250_port {
struct timer_list timer; /* "no irq" timer */
struct list_head list; /* ports on this IRQ */
unsigned short capabilities; /* port capabilities */
- unsigned short bugs; /* port bugs */
unsigned int tx_loadsz; /* transmit fifo load size */
unsigned char acr;
unsigned char ier;
@@ -828,7 +827,7 @@ static void autoconfig_has_efr(struct uart_8250_port *up)
* when DLL is 0.
*/
if (id3 == 0x52 && rev == 0x01)
- up->bugs |= UART_BUG_QUOT;
+ up->port.bugs |= UART_BUG_QUOT;
return;
}
@@ -1102,7 +1101,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
spin_lock_irqsave(&up->port.lock, flags);
up->capabilities = 0;
- up->bugs = 0;
+ up->port.bugs = 0;
if (!(up->port.flags & UPF_BUGGY_UART)) {
/*
@@ -1337,7 +1336,7 @@ static void serial8250_start_tx(struct uart_port *port)
up->ier |= UART_IER_THRI;
serial_out(up, UART_IER, up->ier);
- if (up->bugs & UART_BUG_TXEN) {
+ if (port->bugs & UART_BUG_TXEN) {
unsigned char lsr;
lsr = serial_in(up, UART_LSR);
up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
@@ -1373,7 +1372,7 @@ static void serial8250_enable_ms(struct uart_port *port)
container_of(port, struct uart_8250_port, port);
/* no MSR capabilities */
- if (up->bugs & UART_BUG_NOMSR)
+ if (port->bugs & UART_BUG_NOMSR)
return;
up->ier |= UART_IER_MSI;
@@ -2089,7 +2088,7 @@ static int serial8250_startup(struct uart_port *port)
* kick the UART on a regular basis.
*/
if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) {
- up->bugs |= UART_BUG_THRE;
+ port->bugs |= UART_BUG_THRE;
pr_debug("ttyS%d - using backup timer\n",
serial_index(port));
}
@@ -2099,7 +2098,7 @@ static int serial8250_startup(struct uart_port *port)
* The above check will only give an accurate result the first time
* the port is opened so this value needs to be preserved.
*/
- if (up->bugs & UART_BUG_THRE) {
+ if (port->bugs & UART_BUG_THRE) {
up->timer.function = serial8250_backup_timeout;
up->timer.data = (unsigned long)up;
mod_timer(&up->timer, jiffies +
@@ -2162,13 +2161,13 @@ static int serial8250_startup(struct uart_port *port)
serial_outp(up, UART_IER, 0);
if (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT) {
- if (!(up->bugs & UART_BUG_TXEN)) {
- up->bugs |= UART_BUG_TXEN;
+ if (!(port->bugs & UART_BUG_TXEN)) {
+ port->bugs |= UART_BUG_TXEN;
pr_debug("ttyS%d - enabling bad tx status workarounds\n",
serial_index(port));
}
} else {
- up->bugs &= ~UART_BUG_TXEN;
+ port->bugs &= ~UART_BUG_TXEN;
}
dont_test_tx_en:
@@ -2323,7 +2322,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
/*
* Oxford Semi 952 rev B workaround
*/
- if (up->bugs & UART_BUG_QUOT && (quot & 0xff) == 0)
+ if (port->bugs & UART_BUG_QUOT && (quot & 0xff) == 0)
quot++;
if (up->capabilities & UART_CAP_FIFO && up->port.fifosize > 1) {
@@ -2390,7 +2389,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
* CTS flow control flag and modem status interrupts
*/
up->ier &= ~UART_IER_MSI;
- if (!(up->bugs & UART_BUG_NOMSR) &&
+ if (!(port->bugs & UART_BUG_NOMSR) &&
UART_ENABLE_MS(&up->port, termios->c_cflag))
up->ier |= UART_IER_MSI;
if (up->capabilities & UART_CAP_UUE)
@@ -2666,7 +2665,7 @@ static void serial8250_config_port(struct uart_port *port, int flags)
/* if access method is AU, it is a 16550 with a quirk */
if (up->port.type == PORT_16550A && up->port.iotype == UPIO_AU)
- up->bugs |= UART_BUG_NOMSR;
+ port->bugs |= UART_BUG_NOMSR;
if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
autoconfig_irq(up);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index eadf33d..791536c 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -323,6 +323,7 @@ struct uart_port {
unsigned int read_status_mask; /* driver specific */
unsigned int ignore_status_mask; /* driver specific */
+ unsigned short bugs; /* driver specific */
struct uart_state *state; /* pointer to parent state */
struct uart_icount icount; /* statistics */
--
1.7.7
next prev parent reply other threads:[~2011-12-01 23:47 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-01 23:47 [PATCH 0/3] RFC Fix Fsl 8250 BRK bug via letting plat code set bugs Paul Gortmaker
2011-12-01 23:47 ` Paul Gortmaker [this message]
2011-12-02 0:51 ` [PATCH 1/3] serial: make bugs field not specific to 8250 type uarts Alan Cox
2011-12-02 1:32 ` Paul Gortmaker
2011-12-02 11:49 ` Alan Cox
2011-12-01 23:47 ` [PATCH 2/3] serial: allow passing in hardware bug info via platform device Paul Gortmaker
2011-12-01 23:47 ` [PATCH 3/3] 8250: add workaround for MPC8[356]xx UART break IRQ storm Paul Gortmaker
2011-12-01 23:51 ` Scott Wood
2011-12-02 0:05 ` Paul Gortmaker
2011-12-02 0:17 ` Kumar Gala
2011-12-02 11:30 ` Alan Cox
2011-12-02 16:34 ` Paul Gortmaker
2011-12-02 17:27 ` Scott Wood
2011-12-02 0:57 ` Alan Cox
2011-12-02 1:42 ` Paul Gortmaker
2011-12-04 23:42 ` [PATCH 0/6] RFCv2 Fix Fsl 8250 BRK bug Paul Gortmaker
2011-12-04 23:42 ` [PATCH 1/6] serial: move struct uart_8250_port from 8250.c to 8250.h Paul Gortmaker
2011-12-04 23:42 ` [PATCH 2/6] serial: clean up parameter passing for 8250 Rx IRQ handling Paul Gortmaker
2011-12-04 23:42 ` [PATCH 3/6] serial: export the key functions for an 8250 IRQ handler Paul Gortmaker
2011-12-04 23:42 ` [PATCH 4/6] serial: make 8250 timeout use the specified " Paul Gortmaker
2011-12-04 23:42 ` [PATCH 5/6] serial: manually inline serial8250_handle_port Paul Gortmaker
2011-12-04 23:42 ` [PATCH 6/6] serial: add irq handler for Freescale 16550 errata Paul Gortmaker
2011-12-05 12:18 ` [PATCH 0/6] RFCv2 Fix Fsl 8250 BRK bug Alan Cox
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=1322783258-20443-2-git-send-email-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=alan@linux.intel.com \
--cc=galak@kernel.crashing.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=scottwood@freescale.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;
as well as URLs for NNTP newsgroup(s).