All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Felipe Balbi <balbi@ti.com>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 5/5] tty: serial: Add 8250-core based omap driver
Date: Mon, 21 Jul 2014 02:35:28 -0700	[thread overview]
Message-ID: <20140721093528.GS18374@atomide.com> (raw)
In-Reply-To: <20140718062456.GJ18374@atomide.com>

* Tony Lindgren <tony@atomide.com> [140717 23:28]:
> * Sebastian Andrzej Siewior <bigeasy@linutronix.de> [140717 03:09]:
> > On 07/17/2014 10:12 AM, Tony Lindgren wrote:
> > > Hmm it could be that it works for a while because the clocks are on
> > > from the bootloader and pm_runtime calls won't do anything. This
> > > could happen if the interconnect data based on the ti,hwmods entry
> > > is not getting matched to the new driver. This gets initialized when
> > > the device entry gets created in omap_device_build_from_dt().
> > > 
> > > Or maybe something now affects the clock aliases? It seems that we
> > > are still missing the clocks entries in the .dtsi files, see the
> > > mappings with $ git grep uart drivers/clk/ti/
> > 
> > I've been looking for something completely different while I noticed
> > this:
> > 
> > in drivers/tty/serial/omap-serial.c
> > | static struct platform_driver serial_omap_driver = {
> > |         .driver         = {
> > |                 .name   = DRIVER_NAME,
> > |         },
> > | };
> > |
> > 
> > and DRIVER_NAME should come from include/linux/platform_data/serial-omap.h
> > Looking further, I've found arch/arm/mach-omap2/serial.c:
> > | void __init omap_serial_init_port(struct omap_board_data *bdata,
> > |                         struct omap_uart_port_info *info)
> > | {
> > |         char *name
> > …
> > |	name = DRIVER_NAME;
> > …
> > |	pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size);
> > …
> > |
> > 
> > Would this explain it?
> 
> That would explain it for legacy booting, but not for device tree
> based booting. I can try to debug it further on Monday.

Looks like the following is needed to avoid the error, no idea why..
But this is what we also do in omap-serial.c. It may be needed in
other places too?

Also, no luck yet on runtime PM. If the console is enabled omap won't
idle, and if no serial console is enabled, it just hangs. Will try
to debug this part further, it may be also related to the above.

Regards,

Tony

--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -2066,8 +2066,8 @@ int serial8250_do_startup(struct uart_port *port)
 	/*
 	 * Clear the interrupt registers.
 	 */
-	serial_port_in(port, UART_LSR);
-	serial_port_in(port, UART_RX);
+	if (serial_port_in(port, UART_LSR) & UART_LSR_DR)
+		serial_port_in(port, UART_RX);
 	serial_port_in(port, UART_IIR);
 	serial_port_in(port, UART_MSR);
 
@@ -2228,8 +2228,8 @@ dont_test_tx_en:
 	 * saved flags to avoid getting false values from polling
 	 * routines or the previous session.
 	 */
-	serial_port_in(port, UART_LSR);
-	serial_port_in(port, UART_RX);
+	if (serial_port_in(port, UART_LSR) & UART_LSR_DR)
+		serial_port_in(port, UART_RX);
 	serial_port_in(port, UART_IIR);
 	serial_port_in(port, UART_MSR);
 	up->lsr_saved_flags = 0;

WARNING: multiple messages have this Message-ID (diff)
From: Tony Lindgren <tony@atomide.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Felipe Balbi <balbi@ti.com>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 5/5] tty: serial: Add 8250-core based omap driver
Date: Mon, 21 Jul 2014 02:35:28 -0700	[thread overview]
Message-ID: <20140721093528.GS18374@atomide.com> (raw)
In-Reply-To: <20140718062456.GJ18374@atomide.com>

* Tony Lindgren <tony@atomide.com> [140717 23:28]:
> * Sebastian Andrzej Siewior <bigeasy@linutronix.de> [140717 03:09]:
> > On 07/17/2014 10:12 AM, Tony Lindgren wrote:
> > > Hmm it could be that it works for a while because the clocks are on
> > > from the bootloader and pm_runtime calls won't do anything. This
> > > could happen if the interconnect data based on the ti,hwmods entry
> > > is not getting matched to the new driver. This gets initialized when
> > > the device entry gets created in omap_device_build_from_dt().
> > > 
> > > Or maybe something now affects the clock aliases? It seems that we
> > > are still missing the clocks entries in the .dtsi files, see the
> > > mappings with $ git grep uart drivers/clk/ti/
> > 
> > I've been looking for something completely different while I noticed
> > this:
> > 
> > in drivers/tty/serial/omap-serial.c
> > | static struct platform_driver serial_omap_driver = {
> > |         .driver         = {
> > |                 .name   = DRIVER_NAME,
> > |         },
> > | };
> > |
> > 
> > and DRIVER_NAME should come from include/linux/platform_data/serial-omap.h
> > Looking further, I've found arch/arm/mach-omap2/serial.c:
> > | void __init omap_serial_init_port(struct omap_board_data *bdata,
> > |                         struct omap_uart_port_info *info)
> > | {
> > |         char *name
> > …
> > |	name = DRIVER_NAME;
> > …
> > |	pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size);
> > …
> > |
> > 
> > Would this explain it?
> 
> That would explain it for legacy booting, but not for device tree
> based booting. I can try to debug it further on Monday.

Looks like the following is needed to avoid the error, no idea why..
But this is what we also do in omap-serial.c. It may be needed in
other places too?

Also, no luck yet on runtime PM. If the console is enabled omap won't
idle, and if no serial console is enabled, it just hangs. Will try
to debug this part further, it may be also related to the above.

Regards,

Tony

--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -2066,8 +2066,8 @@ int serial8250_do_startup(struct uart_port *port)
 	/*
 	 * Clear the interrupt registers.
 	 */
-	serial_port_in(port, UART_LSR);
-	serial_port_in(port, UART_RX);
+	if (serial_port_in(port, UART_LSR) & UART_LSR_DR)
+		serial_port_in(port, UART_RX);
 	serial_port_in(port, UART_IIR);
 	serial_port_in(port, UART_MSR);
 
@@ -2228,8 +2228,8 @@ dont_test_tx_en:
 	 * saved flags to avoid getting false values from polling
 	 * routines or the previous session.
 	 */
-	serial_port_in(port, UART_LSR);
-	serial_port_in(port, UART_RX);
+	if (serial_port_in(port, UART_LSR) & UART_LSR_DR)
+		serial_port_in(port, UART_RX);
 	serial_port_in(port, UART_IIR);
 	serial_port_in(port, UART_MSR);
 	up->lsr_saved_flags = 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] tty: serial: Add 8250-core based omap driver
Date: Mon, 21 Jul 2014 02:35:28 -0700	[thread overview]
Message-ID: <20140721093528.GS18374@atomide.com> (raw)
In-Reply-To: <20140718062456.GJ18374@atomide.com>

* Tony Lindgren <tony@atomide.com> [140717 23:28]:
> * Sebastian Andrzej Siewior <bigeasy@linutronix.de> [140717 03:09]:
> > On 07/17/2014 10:12 AM, Tony Lindgren wrote:
> > > Hmm it could be that it works for a while because the clocks are on
> > > from the bootloader and pm_runtime calls won't do anything. This
> > > could happen if the interconnect data based on the ti,hwmods entry
> > > is not getting matched to the new driver. This gets initialized when
> > > the device entry gets created in omap_device_build_from_dt().
> > > 
> > > Or maybe something now affects the clock aliases? It seems that we
> > > are still missing the clocks entries in the .dtsi files, see the
> > > mappings with $ git grep uart drivers/clk/ti/
> > 
> > I've been looking for something completely different while I noticed
> > this:
> > 
> > in drivers/tty/serial/omap-serial.c
> > | static struct platform_driver serial_omap_driver = {
> > |         .driver         = {
> > |                 .name   = DRIVER_NAME,
> > |         },
> > | };
> > |
> > 
> > and DRIVER_NAME should come from include/linux/platform_data/serial-omap.h
> > Looking further, I've found arch/arm/mach-omap2/serial.c:
> > | void __init omap_serial_init_port(struct omap_board_data *bdata,
> > |                         struct omap_uart_port_info *info)
> > | {
> > |         char *name
> > ?
> > |	name = DRIVER_NAME;
> > ?
> > |	pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size);
> > ?
> > |
> > 
> > Would this explain it?
> 
> That would explain it for legacy booting, but not for device tree
> based booting. I can try to debug it further on Monday.

Looks like the following is needed to avoid the error, no idea why..
But this is what we also do in omap-serial.c. It may be needed in
other places too?

Also, no luck yet on runtime PM. If the console is enabled omap won't
idle, and if no serial console is enabled, it just hangs. Will try
to debug this part further, it may be also related to the above.

Regards,

Tony

--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -2066,8 +2066,8 @@ int serial8250_do_startup(struct uart_port *port)
 	/*
 	 * Clear the interrupt registers.
 	 */
-	serial_port_in(port, UART_LSR);
-	serial_port_in(port, UART_RX);
+	if (serial_port_in(port, UART_LSR) & UART_LSR_DR)
+		serial_port_in(port, UART_RX);
 	serial_port_in(port, UART_IIR);
 	serial_port_in(port, UART_MSR);
 
@@ -2228,8 +2228,8 @@ dont_test_tx_en:
 	 * saved flags to avoid getting false values from polling
 	 * routines or the previous session.
 	 */
-	serial_port_in(port, UART_LSR);
-	serial_port_in(port, UART_RX);
+	if (serial_port_in(port, UART_LSR) & UART_LSR_DR)
+		serial_port_in(port, UART_RX);
 	serial_port_in(port, UART_IIR);
 	serial_port_in(port, UART_MSR);
 	up->lsr_saved_flags = 0;

  reply	other threads:[~2014-07-21  9:36 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 14:44 [PATCH v4] 8250-core based serial driver for OMAP Sebastian Andrzej Siewior
2014-07-16 14:44 ` Sebastian Andrzej Siewior
2014-07-16 14:44 ` Sebastian Andrzej Siewior
2014-07-16 14:44 ` [PATCH 1/5] tty: serial: 8250 core: provide a function to export uart_8250_port Sebastian Andrzej Siewior
2014-07-16 14:44   ` Sebastian Andrzej Siewior
2014-07-16 14:45 ` [PATCH 2/5] tty: serial: 8250 core: allow to overwrite & export serial8250_startup() Sebastian Andrzej Siewior
2014-07-16 14:45   ` Sebastian Andrzej Siewior
2014-07-16 14:45   ` Sebastian Andrzej Siewior
2014-07-16 14:45 ` [PATCH 3/5] tty: serial: 8250 core: allow to set ->throttle / ->unthrottle callbacks Sebastian Andrzej Siewior
2014-07-16 14:45   ` Sebastian Andrzej Siewior
2014-07-16 14:45 ` [PATCH 4/5] tty: serial: 8250 core: add runtime pm Sebastian Andrzej Siewior
2014-07-16 14:45   ` Sebastian Andrzej Siewior
2014-07-16 15:16   ` Felipe Balbi
2014-07-16 15:16     ` Felipe Balbi
2014-07-16 15:16     ` Felipe Balbi
2014-07-16 15:54     ` Sebastian Andrzej Siewior
2014-07-16 15:54       ` Sebastian Andrzej Siewior
2014-07-16 16:06       ` Felipe Balbi
2014-07-16 16:06         ` Felipe Balbi
2014-07-16 16:06         ` Felipe Balbi
2014-07-16 16:40         ` Sebastian Andrzej Siewior
2014-07-16 16:40           ` Sebastian Andrzej Siewior
2014-07-16 16:40           ` Sebastian Andrzej Siewior
2014-07-16 16:46           ` Felipe Balbi
2014-07-16 16:46             ` Felipe Balbi
2014-07-16 16:46             ` Felipe Balbi
2014-07-17 15:31         ` Peter Hurley
2014-07-17 15:31           ` Peter Hurley
2014-07-17 15:43           ` Sebastian Andrzej Siewior
2014-07-17 15:43             ` Sebastian Andrzej Siewior
2014-07-17 16:02             ` Felipe Balbi
2014-07-17 16:02               ` Felipe Balbi
2014-07-17 16:02               ` Felipe Balbi
2014-07-17 16:06               ` Sebastian Andrzej Siewior
2014-07-17 16:06                 ` Sebastian Andrzej Siewior
2014-07-17 16:18                 ` Felipe Balbi
2014-07-17 16:18                   ` Felipe Balbi
2014-07-17 16:18                   ` Felipe Balbi
2014-07-18  8:35                   ` Sebastian Andrzej Siewior
2014-07-18  8:35                     ` Sebastian Andrzej Siewior
2014-07-18  8:35                     ` Sebastian Andrzej Siewior
2014-07-18 15:31                     ` Felipe Balbi
2014-07-18 15:31                       ` Felipe Balbi
2014-07-18 15:31                       ` Felipe Balbi
2014-07-18 15:53                       ` Peter Hurley
2014-07-18 15:53                         ` Peter Hurley
2014-07-18 16:02                         ` Felipe Balbi
2014-07-18 16:02                           ` Felipe Balbi
2014-07-18 16:02                           ` Felipe Balbi
2014-07-16 14:45 ` [PATCH 5/5] tty: serial: Add 8250-core based omap driver Sebastian Andrzej Siewior
2014-07-16 14:45   ` Sebastian Andrzej Siewior
2014-07-17  7:09   ` Tony Lindgren
2014-07-17  7:09     ` Tony Lindgren
2014-07-17  7:09     ` Tony Lindgren
2014-07-17  7:42     ` Sebastian Andrzej Siewior
2014-07-17  7:42       ` Sebastian Andrzej Siewior
2014-07-17  8:12       ` Tony Lindgren
2014-07-17  8:12         ` Tony Lindgren
2014-07-17 10:06         ` Sebastian Andrzej Siewior
2014-07-17 10:06           ` Sebastian Andrzej Siewior
2014-07-18  6:24           ` Tony Lindgren
2014-07-18  6:24             ` Tony Lindgren
2014-07-18  6:24             ` Tony Lindgren
2014-07-21  9:35             ` Tony Lindgren [this message]
2014-07-21  9:35               ` Tony Lindgren
2014-07-21  9:35               ` Tony Lindgren
2014-08-13 16:20               ` Sebastian Andrzej Siewior
2014-08-13 16:20                 ` Sebastian Andrzej Siewior
2014-08-13 16:37                 ` Tony Lindgren
2014-08-13 16:37                   ` Tony Lindgren
2014-07-17 14:54   ` Felipe Balbi
2014-07-17 14:54     ` Felipe Balbi
2014-07-17 14:54     ` Felipe Balbi
2014-07-17 15:11     ` Sebastian Andrzej Siewior
2014-07-17 15:11       ` Sebastian Andrzej Siewior
2014-07-17 16:04       ` Felipe Balbi
2014-07-17 16:04         ` Felipe Balbi
2014-07-17 16:04         ` Felipe Balbi

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=20140721093528.GS18374@atomide.com \
    --to=tony@atomide.com \
    --cc=balbi@ti.com \
    --cc=bigeasy@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.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 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.