All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: Vikram Pandita <vikram.pandita@ti.com>
Cc: linux-omap@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH v2 1/1] omap: serial: fix non-empty uart fifo read abort
Date: Tue, 17 Nov 2009 16:30:39 -0800	[thread overview]
Message-ID: <87iqd8fzdc.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1258501151-30866-1-git-send-email-vikram.pandita@ti.com> (Vikram Pandita's message of "Tue\, 17 Nov 2009 17\:39\:11 -0600")

Vikram Pandita <vikram.pandita@ti.com> writes:

> OMAP3630 and OMAP4430 UART IP blocks have a restriction wrt RX FIFO.
> Empty RX fifo read causes an abort. OMAP1/2/3 do not have this restriction.
>
> Overrigt the default 8250 read handler: mem_serial_in()
> by a custom handler: serial_in_8250()
>
> serial_in_8250() makes sure that RX fifo is not read when empty,
> on omap4 and 3630 silicons only
>
> tested on zoom3(3630) board
>
> Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> ---
> v1: initial implementation
> 	http://patchwork.kernel.org/patch/60785/
> 	http://patchwork.kernel.org/patch/60786/
>
> v2: incorporate review comments from Alan Cox
> 	http://patchwork.kernel.org/patch/60785/
> 	No 8250 driver change required now
>
>  arch/arm/mach-omap2/serial.c |   28 ++++++++++++++++++++++++++++
>  1 files changed, 28 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
> index 2e17b57..362cb82 100644
> --- a/arch/arm/mach-omap2/serial.c
> +++ b/arch/arm/mach-omap2/serial.c
> @@ -71,6 +71,30 @@ struct omap_uart_state {
>  
>  static LIST_HEAD(uart_list);
>  
> +static struct omap_uart_state omap_uart[];
> +static inline unsigned int serial_read_reg(struct plat_serial8250_port *, int);
> +
> +/*
> + * Overrigt the default 8250 read handler: mem_serial_in()
> + * Empty RX fifo read causes an abort on omap3630 and omap4
> + * This function makes sure that an empty rx fifo is not read on these silicons
> + * (OMAP1/2/3 are not affected)
> + */
> +static unsigned int serial_in_8250(struct uart_port *up, int offset)
> +{
> +	/* Do not read empty UART fifo on omap3630/44xx */
> +	if ((UART_RX == offset) &&
> +		(cpu_is_omap3630() || cpu_is_omap44xx())) {

Rather than the cpu_is_* here, why not just override the function 
for these platforms and leave the default for 34xx/35xx.

Kevin

  reply	other threads:[~2009-11-18  0:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17 23:39 [PATCH v2 1/1] omap: serial: fix non-empty uart fifo read abort Vikram Pandita
2009-11-18  0:30 ` Kevin Hilman [this message]
2009-11-18  0:31 ` Nishanth Menon
2009-11-18  1:00 ` Alan Cox
2009-11-18  1:07   ` Pandita, Vikram
2009-11-18  5:20   ` Gadiyar, Anand

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=87iqd8fzdc.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-omap@vger.kernel.org \
    --cc=vikram.pandita@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.