linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: balbi@ti.com, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Vinod Koul <vinod.koul@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 15/15] tty: serial: 8250: omap: add dma support
Date: Thu, 28 Aug 2014 09:46:46 -0700	[thread overview]
Message-ID: <20140828164645.GG16006@atomide.com> (raw)
In-Reply-To: <20140828082348.GA5413@linutronix.de>

* Sebastian Andrzej Siewior <bigeasy@linutronix.de> [140828 01:24]:
> * Tony Lindgren | 2014-08-27 13:23:14 [-0700]:
> >
> >Do you mean just the OMAP_UART_SCR_DMAMODE_CTL related code, or
> >also the dmaengine calls?
> 
> dmaengine calls are unused because up.dma is not assigned. It is 
> basically like you wouldn't have the dma properties in the devicetree.
> And while in that non-DMA mode I just set and unset the DMAMODE_CTL + 
> DMAMODE_1 bits in the SCR register. Nothing else. Based on some testing
> I just did, DMAMODE_CTL does not make the difference. DMAMODE_CTL +
> DMAMODE_1 does.

OK
 
> >> However core-off with DMA won't work. I think we could document this in
> >> the binding document. What do you think?
> >
> >There should not be such a limitation though. Maybe dump out the values
> >of cm_idlest_per and cm_idlest1_core for working and failing off idle
> >cases and see what the difference is?
> 
> I can't follow here. This is the working case:
...
 
> so per_pwrdm and core_pwrdm remain on and I guess the former is where
> the UART sits.

That won't show the cm_idlest_per and cm_idlest1_core currently though.

Below is a test patch that allows you to dump those too. Then you
can see which bits show up as blockers. Sounds like it will be the
serial port with dma enabled based on your description.
 
> >It could be the either the dma or the uart hardware blocking. I guess
> >it could be also an issue with runtime pm use somewhere.
> 
> So I just toggle the two DMA bits in SCR and the UART seems to block
> since the DMA hw is not involved. Reading SCR back says that those bits
> are not set.

Oh that's interesting.

> To use DMA you don't have to enable it in SCR register you can also use
> the FCR register. The manual says that you can only write this DMA
> enable bit in the FCR register if the baud clock is not running. And
> guess what: same thing: I only *toggle* the DMA enable bit here (it
> remains 0 later) and the core won't hit idle.
> Same effect if I toggle this bit while the baud clock is running (the
> manual says that this bit can only be written if the baud clock is not
> running). Seems like the UART is following its own specification and it
> remains blocking once the DMA was enabled.
> It would be nice if someone from the UART-IP team could ACK this.

Sounds like there should be some way to clear that state.. I wonder
if omap-serial.c had something before it's DMA support was removed?

I'd assume when the UART is powered down by runtime PM it's state
is completetely reset and we could restore the non-DMA state?

Maybe post your current patches and a test patch to try to toggle
the DMA on and off?

> Bah. Does it make sense to use runtime-PM if we can't hit core-off? I'm
> thinking to add a printk once dma is enabled says that runtime-pm is
> switched off.

Well if we can't find a way to unset the DMA registers in the UART,
how about only enable it if a kernel cmdline option is specified?

We do have runtime PM working without it, and the serial console
super important for any kind of debugging no matter what idle
mode the SoC hits.. So let's not break that.

Regards,

Tony

8<-----------------
From: Tony Lindgren <tony@atomide.com>
Date: Tue, 26 Aug 2014 14:25:33 -0700
Subject: [PATCH] Test patch for dumping omap3 off idle blocking bits

Allows seeing the deeper idle state blockers in
/sys/kernel/debug/pm_debug/count. For example, when
off idle is working on beaglboard xm, this is what
i see:

# sleep 5; cat /sys/kernel/debug/pm_debug/count
...
0006ffff 48005020 (fa005020) cm_idlest_per blocking bits: 00010000
e7ffffbd 48004a20 (fa004a20) cm_idlest1_core blocking bits: 00000042
0000000d 48004a28 (fa004a28) cm_idlest3_core

--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -142,10 +142,76 @@ static int pwrdm_dbg_show_timer(struct powerdomain *pwrdm, void *user)
 	return 0;
 }
 
+#include "iomap.h"
+
+struct dregs {
+	const char	*desc;
+	u32		phys;
+	void __iomem	*virt;
+	u32		mask;
+};
+
+#define PER_CM_BASE	0x48005000
+#define PER_CM_REG(name, offset, mask)				\
+	{ name, PER_CM_BASE + offset,				\
+	OMAP2_L4_IO_ADDRESS(PER_CM_BASE + offset), mask, }
+
+static struct dregs cm_per[] = {
+	PER_CM_REG("cm_idlest_per", 0x20, 0xfff80000), /* p 513 */
+	{ NULL, },
+};
+
+#define CORE_CM_BASE	0x48004a00
+#define CORE_CM_REG(name, offset, mask)				\
+	{ name, CORE_CM_BASE + offset,				\
+	OMAP2_L4_IO_ADDRESS(CORE_CM_BASE + offset), mask, }
+
+static struct dregs cm_core[] = {
+	CORE_CM_REG("cm_idlest1_core", 0x20, 0x9c800109), /* p 467 */
+	CORE_CM_REG("cm_idlest3_core", 0x28, 0xfffffffb),
+	{ NULL, },
+};
+
+void __dregs_dump(struct dregs *dregs, struct seq_file *s)
+{
+	for (; dregs->desc; dregs++) {
+		u32 val, blockers;
+
+		val = __raw_readl(dregs->virt);
+
+		seq_printf(s, "%08x %08x (%p) %s",
+			   val, dregs->phys, dregs->virt,
+			   dregs->desc);
+
+		if (dregs->mask) {
+			blockers = ~val;
+			blockers &= ~dregs->mask;
+
+			if (blockers)
+				seq_printf(s, " blocking bits: %08x",
+					   blockers);
+		}
+
+		seq_printf(s, "\n");
+	}
+}
+
+void cm_per_dump(struct seq_file *s)
+{
+	__dregs_dump(cm_per, s);
+}
+
+void cm_core_dump(struct seq_file *s)
+{
+	__dregs_dump(cm_core, s);
+}
+
 static int pm_dbg_show_counters(struct seq_file *s, void *unused)
 {
 	pwrdm_for_each(pwrdm_dbg_show_counter, s);
 	clkdm_for_each(clkdm_dbg_show_counter, s);
+	cm_per_dump(s);
+	cm_core_dump(s);
 
 	return 0;
 }

  reply	other threads:[~2014-08-28 16:46 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-15 17:42 [PATCH v7] 8250-core based serial driver for OMAP + DMA Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 01/15] tty: serial: 8250_core: allow to overwrite & export serial8250_startup() Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 02/15] tty: serial: 8250_core: allow to set ->throttle / ->unthrottle callbacks Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 03/15] tty: serial: 8250_core: add run time pm Sebastian Andrzej Siewior
2014-08-20  9:23   ` Frans Klaver
2014-08-20  9:39     ` Frans Klaver
2014-09-01 14:48       ` Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 04/15] tty: serial: 8250_core: read only RX if there is something in the FIFO Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 05/15] tty: serial: Add 8250-core based omap driver Sebastian Andrzej Siewior
2014-08-15 18:37   ` Lennart Sorensen
2014-08-15 19:27     ` Sebastian Andrzej Siewior
2014-08-15 19:33       ` Lennart Sorensen
2014-08-15 20:20         ` Sebastian Andrzej Siewior
2014-08-15 21:07   ` Tony Lindgren
2014-08-15 22:44     ` Tony Lindgren
2014-08-29 15:49       ` Sebastian Andrzej Siewior
2014-08-29 16:08         ` Tony Lindgren
2014-08-21 11:00     ` Sebastian Andrzej Siewior
2014-08-21 18:38       ` Tony Lindgren
2014-08-18 13:46   ` Heikki Krogerus
2014-09-01 13:31     ` Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 06/15] tty: serial: 8250_dma: handle error on TX submit Sebastian Andrzej Siewior
2014-08-18 13:57   ` Heikki Krogerus
2014-09-01 14:38     ` Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 07/15] tty: serial: 8250_dma: enqueue RX dma again on completion Sebastian Andrzej Siewior
2014-08-18 10:52   ` One Thousand Gnomes
2014-08-29 15:52     ` Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 08/15] dmaengine: edma: fix two faults which happen with the 8250_dma user Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 09/15] dmaengine: omap-dma: complete the transfer on terminate_all Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 10/15] tty: serial: 8250_dma: Add a TX trigger workaround for AM33xx Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 11/15] tty: serial: 8250_dma: handle the when UART response while DMA remains idle Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 12/15] tty: serial: 8250_dma: add pm runtime Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 13/15] arm: dts: am33xx: add DMA properties for UART Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 14/15] arm: dts: dra7: " Sebastian Andrzej Siewior
2014-08-15 17:42 ` [PATCH 15/15] tty: serial: 8250: omap: add dma support Sebastian Andrzej Siewior
2014-08-15 21:02   ` Tony Lindgren
2014-08-21  8:34     ` Sebastian Andrzej Siewior
2014-08-21 18:44       ` Tony Lindgren
2014-08-27 19:54         ` Sebastian Andrzej Siewior
2014-08-27 20:23           ` Tony Lindgren
2014-08-28  8:23             ` Sebastian Andrzej Siewior
2014-08-28 16:46               ` Tony Lindgren [this message]
2014-08-28 19:37                 ` Sebastian Andrzej Siewior
2014-08-28 22:54                   ` Tony Lindgren
2014-08-29  9:32                     ` Sebastian Andrzej Siewior
2014-08-29 15:55                       ` Felipe Balbi
2014-08-29 16:12                       ` Tony Lindgren
2014-08-29 16:31                         ` Sebastian Andrzej Siewior
2014-09-01 17:47                         ` Sebastian Andrzej Siewior
2014-09-02  3:05                           ` Sebastian Reichel
2014-09-02 16:55                             ` Tony Lindgren
2014-09-02 18:39                           ` Sebastian Andrzej Siewior
2014-09-02 20:15                             ` Tony Lindgren
2014-09-02 20:38                               ` Sebastian Reichel
2014-09-03 16:46                               ` Sebastian Andrzej Siewior
2014-09-03 17:48                                 ` Tony Lindgren
2014-09-04 13:44                                   ` Sebastian Andrzej Siewior
2014-09-04 14:52                                     ` Tony Lindgren
2014-09-04 14:56                                       ` Sebastian Andrzej Siewior
2014-09-04 16:25                                         ` Tony Lindgren
2014-08-15 18:17 ` [PATCH v7] 8250-core based serial driver for OMAP + DMA Lennart Sorensen
2014-08-15 19:14   ` Sebastian Andrzej Siewior
2014-08-15 20:28     ` Tony Lindgren
2014-08-17 20:35       ` Sebastian Andrzej Siewior
2014-08-18 15:15       ` Peter Hurley
2014-08-18 16:37         ` 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=20140828164645.GG16006@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 \
    --cc=vinod.koul@intel.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).