From patchwork Tue May 19 09:41:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erwan Le Ray X-Patchwork-Id: 186974 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp364726ilb; Wed, 20 May 2020 00:34:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYE1JM8LRjEiOI42mGEeOlPuNd7t49OuFkDWf5sTmbXBakEtAPdOrlnSp7egrd/3LVrMhk X-Received: by 2002:a63:c601:: with SMTP id w1mr2976678pgg.263.1589960097042; Wed, 20 May 2020 00:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589960097; cv=none; d=google.com; s=arc-20160816; b=yHM1wF7ApEobmEwPQzFZyBhOfOs/tyv4qLWwECW/TSRNvernmYqKLuJ9vjPloBu+N9 NNhjtgW/DUr37tjx5BCwXk4UOAhvI6GaalNq1j38ysKPsGKMqiXPsu6JyJCecw/w08qG Mcf2WocM5yF30odzCDv3SrQStzV4o27Cr8AruSYzY9LwAW7w/+UKNh3m1aiAn7aplZId KQAG59YE/bIKEltREvhDOuFM8Kwun15Tyvx4jdFl+IQoKGd56JQHokyO908egGspGBfH Q4F0vlXCU3OMKXz/hZhUuG47PbQ7gA4SenVL96L3kWe2h7fxkxH17OgDT6wFBJdlNG4R Pq4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=BsoV/3OZo90mNN549hZY201ueck+wsjky8iohoSgSAA=; b=hNVZfdq/TmbFmreOVavCm0MUahinA4iO1P3ky2iNYPS106aclh60qgMagmviR6Zj1A aASU2jMs3LOUzBJMYEXt+Q5BP3dn88UQZWIXUMn9zGY7d2Qbnoy+drbTyeX1F5y5h+ia kokrm/xy29QiXzud8sDysrMiMgI6gu92BNnnPm9Uz6yxMEesUXGrPKrmd0lYbYMz/Vhn khMNRV5WmNf1KtoD67rjQHm/C6xq4llh8NRtKD1/nSbvpL3+ulCs+e+VhNRh59Gbw3IL z7xp9qDHxCMKPx0lizw7VnKX3m+tQowZ0VguhA0I+LQ+dDG3ckzI/SXuXm/8AjWFbZq7 9hiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@st.com header.s=STMicroelectronics header.b=CjcChveg; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id l18si1484650pgc.452.2020.05.20.00.34.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 00:34:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@st.com header.s=STMicroelectronics header.b=CjcChveg; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=st.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D3C756E58E; Wed, 20 May 2020 07:34:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 2355 seconds by postgrey-1.36 at gabe; Tue, 19 May 2020 10:20:36 UTC Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by gabe.freedesktop.org (Postfix) with ESMTPS id 455EB6E530 for ; Tue, 19 May 2020 10:20:35 +0000 (UTC) Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04J9bCoK002859; Tue, 19 May 2020 11:41:13 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=8umFBsqpXSyvV7P7Pt39jOOMGvMU9GE2G14TF8W9jgU=; b=CjcChvegMRR43kcF7VLmveYY3LeTbNP17nhluegroU/5+HEvQtGYduaZa4aBSWaz6hbm jZkaPjuVERGrfu3I5Yzf2SpMK08NSarRsty9Ffp1fxTff6Y9ykpSKjGNjQ+Fm1gsk5JX a5r0LvSOqXWI6MVOOIv45q9zV1YlsTKD6p5udChBW/fCXtow3Arj7pG2JAAlDk1wZopb g+ZOGREMtPrvN2goEFx4njwzqBHI12NAb5+vQVcm2rm1xKbqJrHKVRV09x8D1HHetv6r nzHbked10gKBadtATbbVKu2HXMNM1edJW6VQxNNNvfdTBXoB+UQa8Uv1wz3xLmcvikNB 8A== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 3125xxs1b2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 May 2020 11:41:13 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D257310002A; Tue, 19 May 2020 11:41:10 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id BD9F12B1881; Tue, 19 May 2020 11:41:10 +0200 (CEST) Received: from localhost (10.75.127.47) by SFHDAG3NODE1.st.com (10.75.127.7) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 19 May 2020 11:41:10 +0200 From: Erwan Le Ray To: Greg Kroah-Hartman , Jiri Slaby , Maxime Coquelin , Alexandre Torgue , Sumit Semwal Subject: [PATCH 1/1] serial: stm32: add no_console_suspend support Date: Tue, 19 May 2020 11:41:04 +0200 Message-ID: <20200519094104.27082-1-erwan.leray@st.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG5NODE3.st.com (10.75.127.15) To SFHDAG3NODE1.st.com (10.75.127.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-19_03:2020-05-19, 2020-05-19 signatures=0 X-Mailman-Approved-At: Wed, 20 May 2020 07:34:33 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Erwan Le Ray , linux-serial@vger.kernel.org, Fabrice Gasnier , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to display console messages in low power mode, console pins must be kept active after suspend call. --- Initial patch "serial: stm32: add support for no_console_suspend" was part of "STM32 usart power improvement" series, but as dependancy to console_suspend pinctl state has been removed to fit with Rob comment [1], this patch has no more dependancy with any other patch of this series. [1] https://lkml.org/lkml/2019/7/9/451 Signed-off-by: Erwan Le Ray -- 2.17.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 9cfcf355567a..5afd29162f6c 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1425,7 +1425,18 @@ static int __maybe_unused stm32_serial_suspend(struct device *dev) else stm32_serial_enable_wakeup(port, false); - pinctrl_pm_select_sleep_state(dev); + /* + * When "no_console_suspend" is enabled, keep the pinctrl default state + * and rely on bootloader stage to restore this state upon resume. + * Otherwise, apply the idle or sleep states depending on wakeup + * capabilities. + */ + if (console_suspend_enabled || !uart_console(port)) { + if (device_may_wakeup(dev)) + pinctrl_pm_select_idle_state(dev); + else + pinctrl_pm_select_sleep_state(dev); + } return 0; }