All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
To: linux-renesas-soc@vger.kernel.org
Cc: wsa@the-dreams.de, geert@linux-m68k.org,
	linux-serial@vger.kernel.org, magnus.damm@gmail.com,
	Hien Dang <hien.dang.eb@renesas.com>,
	Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>,
	Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Subject: [PATCH 2/2] serial: sh-sci: Use pm_runtime_get_sync()/put() on resume
Date: Fri, 13 Apr 2018 19:00:54 +0200	[thread overview]
Message-ID: <1523638854-21804-3-git-send-email-ulrich.hecht+renesas@gmail.com> (raw)
In-Reply-To: <1523638854-21804-1-git-send-email-ulrich.hecht+renesas@gmail.com>

From: Hien Dang <hien.dang.eb@renesas.com>

Since commit '39dd0f234fc37d ("PM / Domains: Allow runtime PM during system
PM phases")', runtime PM may be in suspended state during the system
suspend phase. It is therefore necessary to call pm_runtime_get_sync()/
pm_runtime_put() when accessing the hardware.

This modification is the counterpart for the resume case. It ensures
stability of the system, should the kernel allow the devices's runtime
suspend state to change during the system resume phase as well.

Signed-off-by: Hien Dang <hien.dang.eb@renesas.com>
Signed-off-by: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>
[uli: edited description for clarity]
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 drivers/tty/serial/sh-sci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 22d7a78..d5a1acb 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -3259,8 +3259,11 @@ static __maybe_unused int sci_resume(struct device *dev)
 {
 	struct sci_port *sport = dev_get_drvdata(dev);
 
-	if (sport)
+	if (sport) {
+		pm_runtime_get_sync(sport->port.dev);
 		uart_resume_port(&sci_uart_driver, &sport->port);
+		pm_runtime_put(sport->port.dev);
+	}
 
 	return 0;
 }
-- 
2.7.4

  parent reply	other threads:[~2018-04-13 17:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-13 17:00 [PATCH 0/2] serial: sh-sci: Use pm_runtime_get_sync()/put() Ulrich Hecht
2018-04-13 17:00 ` [PATCH 1/2] serial: sh-sci: Use pm_runtime_get_sync()/put() on suspend Ulrich Hecht
2018-04-13 17:00 ` Ulrich Hecht [this message]
2018-04-13 17:27 ` [PATCH 0/2] serial: sh-sci: Use pm_runtime_get_sync()/put() Geert Uytterhoeven
2018-06-20  5:52   ` Wolfram Sang
2018-07-12  9:00   ` Wolfram Sang
2018-09-20  6:32   ` Ulrich Hecht
2018-10-03 11:50     ` Wolfram Sang

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=1523638854-21804-3-git-send-email-ulrich.hecht+renesas@gmail.com \
    --to=ulrich.hecht+renesas@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=hien.dang.eb@renesas.com \
    --cc=hiromitsu.yamasaki.ym@renesas.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=wsa@the-dreams.de \
    /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.