linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 03/10] Partially revert "serial: sh-sci: console Runtime PM support"
Date: Fri, 16 Nov 2012 01:51:24 +0000	[thread overview]
Message-ID: <50A59C1C.9020904@renesas.com> (raw)
In-Reply-To: <50A59B9B.2010501@renesas.com>

This partially reverts commit 1ba7622094 (serial: sh-sci: console
Runtime PM support, from Magnus Damm <damm@opensource.se>, 2011-08-03).

The generic 'serial_core' can take care of console PM maintenance,
so all (or at least the first thing) we have to do to get console PM
work properly, is to implement uart_ops ->pm() operation in the sh-sci
serial client driver.

This patch partially reverts the commit above, but leaving sci_reset()
change in place, because sci_reset() is already part of another commit
(73c3d53f38 serial: sh-sci: Avoid FIFO clear for MCE toggle.).

A revised version of console PM support follows next.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
---
 drivers/tty/serial/sh-sci.c | 53 +--------------------------------------------
 1 file changed, 1 insertion(+), 52 deletions(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 9abe977..e9e8883 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -99,12 +99,6 @@ struct sci_port {
 #endif
 
 	struct notifier_block		freq_transition;
-
-#ifdef CONFIG_SERIAL_SH_SCI_CONSOLE
-	unsigned short saved_smr;
-	unsigned short saved_fcr;
-	unsigned char saved_brr;
-#endif
 };
 
 /* Function prototypes */
@@ -2247,8 +2241,7 @@ static int __devinit serial_console_setup(struct console *co, char *options)
 	if (options)
 		uart_parse_options(options, &baud, &parity, &bits, &flow);
 
-	sci_port_disable(sci_port);
-
+	/* TODO: disable clock */
 	return uart_set_options(port, co, baud, parity, bits, flow);
 }
 
@@ -2291,46 +2284,6 @@ static int __devinit sci_probe_earlyprintk(struct platform_device *pdev)
 	return 0;
 }
 
-#define uart_console(port)	((port)->cons->index = (port)->line)
-
-static int sci_runtime_suspend(struct device *dev)
-{
-	struct sci_port *sci_port = dev_get_drvdata(dev);
-	struct uart_port *port = &sci_port->port;
-
-	if (uart_console(port)) {
-		struct plat_sci_reg *reg;
-
-		sci_port->saved_smr = serial_port_in(port, SCSMR);
-		sci_port->saved_brr = serial_port_in(port, SCBRR);
-
-		reg = sci_getreg(port, SCFCR);
-		if (reg->size)
-			sci_port->saved_fcr = serial_port_in(port, SCFCR);
-		else
-			sci_port->saved_fcr = 0;
-	}
-	return 0;
-}
-
-static int sci_runtime_resume(struct device *dev)
-{
-	struct sci_port *sci_port = dev_get_drvdata(dev);
-	struct uart_port *port = &sci_port->port;
-
-	if (uart_console(port)) {
-		sci_reset(port);
-		serial_port_out(port, SCSMR, sci_port->saved_smr);
-		serial_port_out(port, SCBRR, sci_port->saved_brr);
-
-		if (sci_port->saved_fcr)
-			serial_port_out(port, SCFCR, sci_port->saved_fcr);
-
-		serial_port_out(port, SCSCR, sci_port->cfg->scscr);
-	}
-	return 0;
-}
-
 #define SCI_CONSOLE	(&serial_console)
 
 #else
@@ -2340,8 +2293,6 @@ static inline int __devinit sci_probe_earlyprintk(struct platform_device *pdev)
 }
 
 #define SCI_CONSOLE	NULL
-#define sci_runtime_suspend	NULL
-#define sci_runtime_resume	NULL
 
 #endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */
 
@@ -2459,8 +2410,6 @@ static int sci_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops sci_dev_pm_ops = {
-	.runtime_suspend = sci_runtime_suspend,
-	.runtime_resume = sci_runtime_resume,
 	.suspend	= sci_suspend,
 	.resume		= sci_resume,
 };
-- 
1.7.12.4


  parent reply	other threads:[~2012-11-16  1:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07  6:57 [PATCH 00/10] serial: sh-sci fixes - console PM, SCIFB, SMP lockup, etc Shinya Kuribayashi
2012-11-07  6:58 ` [PATCH 01/10] Revert "sh-sci / PM: Avoid deadlocking runtime PM" Shinya Kuribayashi
2012-11-07  6:58 ` [PATCH 02/10] Revert "sh-sci / PM: Use power.irq_safe" Shinya Kuribayashi
2012-11-07  6:58 ` [PATCH 03/10] Partially revert "serial: sh-sci: console Runtime PM support" Shinya Kuribayashi
2012-11-07  6:59 ` [PATCH 04/10] serial: sh-sci: console runtime PM support (revisit) Shinya Kuribayashi
2012-11-07  6:59 ` [PATCH 05/10] serial: sh-sci: fix condition test to set SCBRR Shinya Kuribayashi
2012-11-07  6:59 ` [PATCH 06/10] serial: sh-sci: support lower baud rate Shinya Kuribayashi
2012-11-07  7:00 ` [PATCH 07/10] serial: sh-sci: mask SCTFDR/RFDR according to fifosize Shinya Kuribayashi
2012-11-07  7:00 ` [PATCH 08/10] serial: sh-sci: fix common SCIFB regmap definition Shinya Kuribayashi
2012-11-07  7:00 ` [PATCH 09/10] serial: sh-sci: add locking to console write function to avoid SMP lockup Shinya Kuribayashi
2012-11-07  7:01 ` [PATCH 10/10] serial: sh-sci: fix possible race cases on SCSCR register accesses Shinya Kuribayashi
2012-11-07  7:18 ` [PATCH 00/10] serial: sh-sci fixes - console PM, SCIFB, SMP lockup, etc Shinya Kuribayashi
2012-11-16  1:01   ` Greg KH
2012-11-16  1:49     ` [PATCH v2 " Shinya Kuribayashi
2012-11-16  1:50       ` [PATCH v2 01/10] Revert "sh-sci / PM: Avoid deadlocking runtime PM" Shinya Kuribayashi
2012-11-16  1:51       ` [PATCH v2 02/10] Revert "sh-sci / PM: Use power.irq_safe" Shinya Kuribayashi
2012-11-16  1:51       ` Shinya Kuribayashi [this message]
2012-11-16  1:51       ` [PATCH v2 04/10] serial: sh-sci: console runtime PM support (revisit) Shinya Kuribayashi
2012-11-16  1:52       ` [PATCH v2 05/10] serial: sh-sci: fix condition test to set SCBRR Shinya Kuribayashi
2012-11-16  1:52       ` [PATCH v2 06/10] serial: sh-sci: support lower baud rate Shinya Kuribayashi
2012-11-16  1:53       ` [PATCH v2 07/10] serial: sh-sci: mask SCTFDR/RFDR according to fifosize Shinya Kuribayashi
2012-11-16  1:53       ` [PATCH v2 08/10] serial: sh-sci: fix common SCIFB regmap definition Shinya Kuribayashi
2012-11-16  1:54       ` [PATCH v2 09/10] serial: sh-sci: add locking to console write function to avoid SMP lockup Shinya Kuribayashi
2012-11-16  1:54       ` [PATCH v2 10/10] serial: sh-sci: fix possible race cases on SCSCR register accesses Shinya Kuribayashi
2012-11-16  2:04       ` [PATCH v2 00/10] serial: sh-sci fixes - console PM, SCIFB, SMP lockup, etc Greg KH

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=50A59C1C.9020904@renesas.com \
    --to=shinya.kuribayashi.px@renesas.com \
    --cc=linux-arm-kernel@lists.infradead.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 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).