From patchwork Fri Apr 13 17:00:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 10340603 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C81C960153 for ; Fri, 13 Apr 2018 17:01:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B606328947 for ; Fri, 13 Apr 2018 17:01:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF84F28965; Fri, 13 Apr 2018 17:01:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AC5228952 for ; Fri, 13 Apr 2018 17:01:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752574AbeDMRBC (ORCPT ); Fri, 13 Apr 2018 13:01:02 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:40879 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751160AbeDMRBB (ORCPT ); Fri, 13 Apr 2018 13:01:01 -0400 Received: by mail-wr0-f196.google.com with SMTP id v60so5928819wrc.7; Fri, 13 Apr 2018 10:01:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8DXrUl0ON3JZW2lM5JWfhSmgYF0vEs1/iBoCeHsDTtU=; b=hqHVwwt1UV2OOrvP4A28LD5NUUH5aTByib93TEhzaQi+Hp6LolDr8QL/Yw2PQbpa3n vHYpCRkGc+y4eHD+5ghWRbrrvO2QfuIm6ptcYx7SuIfND2ZIdGrGafFhJaJ7wDb96m5L B8rdb5Im5qTno4UqVKLNA05BGi2C90TLUIBb/e5GXdT+5mnQN0wfhKEq7UgoRzH05Hed RdebhniDT4iUK4uU21v3yk7dFvY3QEdXMcGZCN7pJP57n7tJUirmO0qYI1Jm+MXz4yrY f7624tDKTvp0WK3RBpVL0YPNPEWtGbqbeNkzI+JcjSXToPGTMvmP7hcYyWGB4DtBD62g DBlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=8DXrUl0ON3JZW2lM5JWfhSmgYF0vEs1/iBoCeHsDTtU=; b=iycN66RNpYKPGMeK96HLmnyPEDIylcOxzE1QIQVMMy0n4E+NFb5Ivhr7xm8p8wSM1E qBpgmI0TuN+CPPSIXoRC0CKART/dAS2pwTlBeZo5GyNtbCY7qpcNgzB9oPbTkg7zC1Sp HpBzowo+lwDzpfY5isBn0PSeKjpUKCvV7mCCJH8mKkRqqEc6m3LzP6Iwuln067djssrm X0fpfvhqP4f3vju62vpUstkQ04o921ClTl/Jp1Q8uYwS4+YOy59ErGO2a9c207klMI8r cfvaPTRP/Q2SCFVsFi5lLL2nD2ckD8GLXay5ayZ7XVhAVIrVw7pJr7/cItqBOiZlhTEM /bcA== X-Gm-Message-State: ALQs6tC9kXtf47kI6fJ1fVfeTY3HWAjGgGG1cgHDsPeclHSX734J5KpX eqcOIztd70xSB6KD2xsHkN2XrdE= X-Google-Smtp-Source: AIpwx4+RTdCn8YeogGaUo/fYz4Rhv55tZ8ahiKsgc4hYPlscpXu09rnJeEOY3Cia9mcWQyh3aXrYyA== X-Received: by 10.223.163.68 with SMTP id d4mr2420580wrb.103.1523638860267; Fri, 13 Apr 2018 10:01:00 -0700 (PDT) Received: from groucho.site (ipbcc0ce2f.dynamic.kabel-deutschland.de. [188.192.206.47]) by smtp.gmail.com with ESMTPSA id q71sm2712082wmd.41.2018.04.13.10.00.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Apr 2018 10:00:59 -0700 (PDT) From: Ulrich Hecht 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 , Hiromitsu Yamasaki , Ulrich Hecht Subject: [PATCH 1/2] serial: sh-sci: Use pm_runtime_get_sync()/put() on suspend Date: Fri, 13 Apr 2018 19:00:53 +0200 Message-Id: <1523638854-21804-2-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523638854-21804-1-git-send-email-ulrich.hecht+renesas@gmail.com> References: <1523638854-21804-1-git-send-email-ulrich.hecht+renesas@gmail.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hien Dang Since commit '39dd0f234fc37d ("PM / Domains: Allow runtime PM during system PM phases")', runtime PM may be in suspended state when the module registers are backed up. It is therefore necessary to ensure the device is on during suspend by using pm_runtime_get_sync()/pm_runtime_put(). Signed-off-by: Hien Dang Signed-off-by: Hiromitsu Yamasaki [uli: edited description for clarity] Signed-off-by: Ulrich Hecht --- 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 fdbbff5..22d7a78 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3246,8 +3246,11 @@ static __maybe_unused int sci_suspend(struct device *dev) { struct sci_port *sport = dev_get_drvdata(dev); - if (sport) + if (sport) { + pm_runtime_get_sync(sport->port.dev); uart_suspend_port(&sci_uart_driver, &sport->port); + pm_runtime_put(sport->port.dev); + } return 0; }