From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: sudhakar <sudhakar@fb.com>
Cc: linux-serial@vger.kernel.org, alan@linux.intel.com,
gregkh@linuxfoundation.org, dan.j.williams@intel.com,
nhan.h.mai@intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] serial/8250_pci: Need to clear FIFOs for KT serial on BI
Date: Tue, 3 Apr 2012 21:03:45 +0100 [thread overview]
Message-ID: <20120403210345.624bd7ba@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <4F7B53C9.4040509@fb.com>
On Tue, 3 Apr 2012 12:47:21 -0700
sudhakar <sudhakar@fb.com> wrote:
>
> From: Sudhakar Mamillapalli <sudhakar@fb.com>
>
> When using SOL thru a KT serial device and Intel ME gets reset
> the serial FIFOs need to be cleared for sane SOL output. On
Acronym failure.
Please remember that people looking at a patch and even more so people in
future maintaining the code will not have any idea wtf you are talking
about !
Expand the acronyms in a patch and include a bit of context.
> @@ -1385,6 +1393,16 @@ serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr)
> lsr |= up->lsr_saved_flags;
> up->lsr_saved_flags = 0;
>
> + if ((up->port.type == PORT_KT_SERIAL) && (lsr & UART_LSR_BI)) {
> + /*
> + * For KT serial device if break interrupt then got
> + * to clear the fifos for sane SOL output.
> + */
> + serial8250_clear_fifos(up);
> + fcr = uart_config[up->port.type].fcr;
> + serial_port_out(port, UART_FCR, fcr);
> + }
> +
This wants to be some kind of call back handled case not more stuff in
the core 8250.c which we are trying to drive all the special cases back
out of.
> if (unlikely(lsr & UART_LSR_BRK_ERROR_BITS)) {
> /*
> * For statistics only
> @@ -1729,7 +1747,12 @@ static void serial8250_backup_timeout(unsigned long data)
> * based handler.
> */
> if (up->port.irq) {
> - ier = serial_in(up, UART_IER);
> + /*
> + * Get the ier value from up->ier rather than reading the
> + * register, since some SOL uarts(for e.g. KT serial) it
> + * goes to 0 momentarily on BMC reset.
> + */
> + ier = up->ier;
> serial_out(up, UART_IER, 0);
Surely you do this fixup in your own private serial_in method as various
other chips do for all sorts of brain damage.
> }
>
> @@ -1896,8 +1919,12 @@ static void serial8250_put_poll_char(struct uart_port *port,
>
> /*
> * First save the IER then disable the interrupts
> + *
> + * Get the ier value from up->ier rather than reading the
> + * register, since some SOL uarts(for e.g. KT serial) it
> + * goes to 0 momentarily on BMC reset.
> */
> - ier = serial_port_in(port, UART_IER);
> + ier = up->ier;
> if (up->capabilities & UART_CAP_UUE)
Ditto
> serial_port_out(port, UART_IER, UART_IER_UUE);
> else
> @@ -2818,8 +2845,12 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
>
> /*
> * First save the IER then disable the interrupts
> + *
> + * Get the ier value from up->ier rather than reading the
> + * register, since some SOL uarts(for e.g. KT serial) it
> + * goes to 0 momentarily on BMC reset.
> */
> - ier = serial_port_in(port, UART_IER);
> + ier = up->ier;
>
Ditto
In fact as far as I can see this boils down to
- a private serial_in method
- possibly adding a callback for special break handling. You may even be
able to hide that in serial_in methods, but its probably better
explicit.
Alan
prev parent reply other threads:[~2012-04-03 20:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-03 19:47 [PATCH 2/2] serial/8250_pci: Need to clear FIFOs for KT serial on BI sudhakar
2012-04-03 20:03 ` Alan Cox [this message]
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=20120403210345.624bd7ba@pyramind.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=alan@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=nhan.h.mai@intel.com \
--cc=sudhakar@fb.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).