Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1256962lqd; Thu, 25 Apr 2024 09:59:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVaMNKpHXsYjXrsNIrvpUUdoLQvdN7ZRdZ6T6BFgZ0EcrB5lsjTyXqYG2VBmocFXYXGBVaQzKNjlm0YQE008Uzw60595o6maYPvdhE85Q== X-Google-Smtp-Source: AGHT+IFqfHgWrvF0h0CCs7hmV9ekPUO1lPjHucRconI6YeDMXIW5h7N3E7j5/hmgofqJzw1CCLDB X-Received: by 2002:a05:6a21:3a86:b0:1ab:82fe:910b with SMTP id zv6-20020a056a213a8600b001ab82fe910bmr173200pzb.58.1714064365757; Thu, 25 Apr 2024 09:59:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714064365; cv=pass; d=google.com; s=arc-20160816; b=Dwa9h4tIH9714Kh8pPf+oDiFzpUbpdcdDz7H2HM2oHfh3vjOukb340QGAyHkYiDza5 JkBTkzUuizMD/99MEuxBjl0BdbEUUwkFYpnG22IjVG9LtPtPqdNjBf9XN8VAH8SNiorx HTNHc4cj+2akrdwa93mwkG/hoM7J+xBFz9KuuzFV9vKnuqYjEl1xrolqP4gW5NXOTF3b ULRhUToY2mWAYtgssDxJBqy9pIzaeyY9IQkGGO9ykVHyDRlU/geHJ3C0JfCCA2CmuRX7 MeHkUc5T+oZE9KWboy2JKjS5yWNNFzuWWEwx4b0xkf/hhNG1JfWrzPUCmDf0JxfQhB0I t/lg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=on0OXtQXZAF4hN5oeel24iXAsrlaEJyKDQRWWo0Y57k=; fh=qYmP2ZHG2hMxbovHoq445rzRDGaohlsAnv4k1UNzYz4=; b=gice8RYp+v2GhRuviu50Q83jFIgkbrrng4TR5L8A1SN2Jdjq0ANkUgqn5V7xR9QbgK OLNqj7W4AZXI+ZOb2d68/ELZXdYrZDwCq7iwK25WD8qH1W0/0zMVSTJXd5PIrTpuU6Sr YvlGJtteLFF8JVvkSWKNFBzV8WFQGBZS1z1jjxcjdeF8rwPeH7P3iSpd/G7BsEVkR2Tq 2X4lukFl2nYq7L78QIU83QkD1DqgWB2f+oCZbNwjm5tRumsfW4dSba/rCSaxv3Rjs+Gj /Bh1QuzZGzqm13dlynm/1i1/SoUJU5uz4CZI20DGK1XkZ6Bwv4aR2QRmxG5ODM4liSO0 IacA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jeCTfEM1; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-158918-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158918-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id f15-20020a056a00228f00b006eaa98c88c3si13840676pfe.161.2024.04.25.09.59.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 09:59:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158918-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jeCTfEM1; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-158918-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158918-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AD8F5B27B31 for ; Thu, 25 Apr 2024 16:40:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0420C149C62; Thu, 25 Apr 2024 16:40:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jeCTfEM1" Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 661CC133991 for ; Thu, 25 Apr 2024 16:40:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714063234; cv=none; b=np001qd7yj3CKKyogep7tb7Ho00eDEMZ2AWv+CwmcUJRhie+qYT05lcX2T3wKY0A5ru5qnGcaZUxtMijwyP/uuKNCTl4MGZ9WoopiTi21dvT9z4tDBLPoquPlv9kWJ/8SUtZr/8BUk/O6rUS47Pgg3POaCsKLViSJXL+0KUSpEw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714063234; c=relaxed/simple; bh=I0I9OjDY6ZUYLhQWHYC4HdS5DXN9XX3/1jiMOmIL9iY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=rbwAjACNNXCPUuWcqeBLHCVlxJK8s2S8WN3JA4GFHHV2DBJAMXGSNtNxWaTS6Ta094reBGMJFenTCho0zBbcD76ATsKB+WWNp85nWuGNqa4tTnfC9vL1f+c7TgwCH6tbhDj2zC10s740EVf4GU+vtygX3u49JdbTQDEHErh9NO0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jeCTfEM1; arc=none smtp.client-ip=209.85.219.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f171.google.com with SMTP id 3f1490d57ef6-de5809cd7b0so1360105276.0 for ; Thu, 25 Apr 2024 09:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714063231; x=1714668031; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=on0OXtQXZAF4hN5oeel24iXAsrlaEJyKDQRWWo0Y57k=; b=jeCTfEM1GEAUxWddBeDx90ztJGb4g+1SI+T7H7M2QRs4ek4l2GN3Ucg2XM5HCPZY51 /aWjYM82FgiJH5QgsUXgi/30l+wWyYduud93Y6YqoZe+p0P/ktHmrXuGxtUEwTvq8HFV ksT6YGcUo/2tjliuDR5HbqpGn69Kr6DysGp2zuSw3jYJfAXwLQRK7CJ9lenzG61ceSKs zDmpvGZ4KwxRIXEjkjGXCbqR7KnFic0iesolCCgRSSfc8FurxfNkbmy2d5fZcuUpg7bz vScelWXfdXjRbwv/v8bmjo9nUdr0CyAgr2NDtZf104gAPsP7M/m1TEKdmV5Rqismtvh5 5LAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714063231; x=1714668031; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=on0OXtQXZAF4hN5oeel24iXAsrlaEJyKDQRWWo0Y57k=; b=RhIarkUK3ESigMhwkIH+MjwE/XxqevxdYFO8w2fsh31cxH2ixhbhDUCLeO5EFG/xmr RR6HS9tUmKdQfBG6fl74XLebgrhzobvOow2ZHTSBJT/HfLa1kH1KAteSPZE8+rRJjon2 UFmHcDTXEiBbT/LQiO4R+4P+W9KE8zu6f+Cmap71TYTJ2+9pggjnFyk3DvJpVzMwe12P Jlc9o3N1HaPzGCEoxknYVYkukd5Yu7yUBi2X4fDoftDCm8iG518p0MAagvjPoH3GVpP4 v34NBlPTypxBpaV4cnORTVZe588e/or2ubX+p7bto0qf65EgTTllabybFRGtkZ171QDC MoAg== X-Forwarded-Encrypted: i=1; AJvYcCUd6/9NpkNSvkzHJxdrXzY8eXiai5jhQW5noUTgcz0qFBYHCIaOPdc/xFcsq7SU7iAYIyTdVAgan12T4qEKYC8Q+0S4aiX8y1uDEF7B X-Gm-Message-State: AOJu0YwtTmbQbbWtDgp6ntu2xwdsDFNDlsU5l06IaZRSRc5dPNk0RexV p2dTZON0Gbn7S52vfVn3srULICSI1nBCzI6YFL0aXJDRxWEgR/o9KKQUqo1cGbBpJr7jwE1K0f3 VXakFUS8a7fNkKoDB1OXT5KU7uOoQTPhh4c9hUu9RylZhEbFX X-Received: by 2002:a05:6902:2413:b0:dcc:2f09:4742 with SMTP id dr19-20020a056902241300b00dcc2f094742mr166378ybb.51.1714063231005; Thu, 25 Apr 2024 09:40:31 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240425070936.547100-1-claudiu.beznea.uj@bp.renesas.com> In-Reply-To: <20240425070936.547100-1-claudiu.beznea.uj@bp.renesas.com> From: Ulf Hansson Date: Thu, 25 Apr 2024 18:39:55 +0200 Message-ID: Subject: Re: [RFT PATCH v2] serial: core: Call device_set_awake_path() for console port To: Claudiu Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org, tony@atomide.com, andriy.shevchenko@linux.intel.com, l.sanfilippo@kunbus.com, tglx@linutronix.de, geert+renesas@glider.be, peng.fan@nxp.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-pm@vger.kernel.org, Claudiu Beznea , Geert Uytterhoeven Content-Type: text/plain; charset="UTF-8" On Thu, 25 Apr 2024 at 09:09, Claudiu wrote: > > From: Claudiu Beznea > > In case the UART port is used as a console, no_console_suspend is > available in bootargs and UART port is part of a software-controlled power > domain we need to call device_set_awake_path(). This lets the power > domain core code know that this domain should not be powered off > during system suspend. Otherwise, the UART port power domain is turned off, > nothing is printed while suspending and the suspend/resume process is > blocked. This was detected on the Renesas RZ/G3S SoC while adding support > for power domains. > > Based on code investigation, this issue is present on other SoCs (e.g., > Renesas R-Mobile A1 [1], IMX8QXP [2]) and different SoCs have particular > implementation to handle it. Due to this the patch added the call of > device_set_awake_path() in uart_suspend_port() instead of having it in > the platform specific UART driver. > > [1] https://elixir.bootlin.com/linux/v6.9-rc5/source/drivers/pmdomain/renesas/rmobile-sysc.c#L116 > [2] https://elixir.bootlin.com/linux/v6.9-rc5/source/drivers/pmdomain/imx/scu-pd.c#L357 > > Suggested-by: Ulf Hansson > Suggested-by: Geert Uytterhoeven > Signed-off-by: Claudiu Beznea At least conceptually this makes perfect sense to me. If it's the correct place to put it, I trust others to know. Nevertheless, feel free to add: Reviewed-by: Ulf Hansson Kind regards Uffe > --- > > Changes in v2: > - used device_set_awake_path() instead of device_set_wakeup_path() > - moved the support in uart_suspend_port() to make it generic for > other drivers > - fixed typos in commit description > - updated the commit description to reflect the new changes and the fact > that support may be applied to other SoCs > - added Suggested-by tag; this was initially proposed by Ulf to move it > in the serial driver then Geert propose to have it more generic in > uart_suspend_port() > > > drivers/tty/serial/serial_core.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c > index d8d797a7a1e3..6270baab668c 100644 > --- a/drivers/tty/serial/serial_core.c > +++ b/drivers/tty/serial/serial_core.c > @@ -2409,6 +2409,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) > uport->ops->stop_rx(uport); > uart_port_unlock_irq(uport); > } > + device_set_awake_path(uport->dev); > goto unlock; > } > > -- > 2.39.2 >