Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp627891rdb; Mon, 15 Jan 2024 08:17:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvNjE1angCacunE43Z4U9DewFguLWc4wWEpsSyZbSVZuwIFfp1C/4GdEvWWnvJpxfwn448 X-Received: by 2002:a17:906:38c2:b0:a28:b021:abe5 with SMTP id r2-20020a17090638c200b00a28b021abe5mr2657535ejd.126.1705335468439; Mon, 15 Jan 2024 08:17:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705335468; cv=none; d=google.com; s=arc-20160816; b=kzDMrUoMOQUATm2dvXfrro/LZcRtlxSDFZ9MoLQ4u5zUGN/Rm8q1nO2gpbIMlfYF0e g+9T+Na+gfl5aRcAgIgeYySrEkTn2+2ttXPBbJHqeGuBgTQ9YNPWrWenKs2UrrUdbVRb 6YVmBC33RSOfyysASu/AuqDCrxkooc4A7RI5JhESMi/KTb+GQlUEWULCqLDx2Kg9AJau yZhlJmMMH12FG8CST5RbglvxCH1fb1l+tZ4ki3caqnqRP24FAyyE4/hv600+qAh7p007 mZelll+icHnSAPgQeeT5HX9KRnxjXregMCqBQlbCjLNsuZSraPI+owxVCRA2mJGV+iMq WRaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=1mtR7io+GXcxCNgtcR6WdMbs4r9dsHCXx4WfnCMzH5I=; fh=ihwxVJW8DyodhmdJo1IfhLUDNDWeXh+49SpWXYbpL2Y=; b=QHomcqds0PjdQ0YnAR74vZ3CLaeaGwdGrM8P2R39zE9F8KdFj2BRsScwNDkA4NDS1T yqBNeEYKh7qrhr04wucnb5VQuF4EUPr9RGdDabr7WY+Sah+vshMYKxLPoT2rqgs3h3Z/ YPW9+yGJLvMH0vwz2ffPUo75zFVKM4WwC1ot09zbC66zAuU4ee7nQR7nFc7k4r+P4ecA /OEZUgACr09KEVbTJDSM3FXIVczFzgZ3wSWU8EGbDrzCGzF3t/kGJ8U7q0Fw7vd5jJbI WXIshg0eZc9gV2g/BI41GmJR7+mmA0V5GBpKIbXTRiaiFL9to8nr9P0IKFDkJEWQ1beh QzlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MF2pnLzV; spf=pass (google.com: domain of linux-kernel+bounces-26237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gw18-20020a170906f15200b00a28fe1894bfsi3892640ejb.150.2024.01.15.08.17.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 08:17:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MF2pnLzV; spf=pass (google.com: domain of linux-kernel+bounces-26237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id CB31A1F227E9 for ; Mon, 15 Jan 2024 16:17:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EFAD1862A; Mon, 15 Jan 2024 16:16:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="MF2pnLzV" Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA527179BE; Mon, 15 Jan 2024 16:16:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 5BDB9C0009; Mon, 15 Jan 2024 16:16:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705335377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1mtR7io+GXcxCNgtcR6WdMbs4r9dsHCXx4WfnCMzH5I=; b=MF2pnLzV5ERkgaPFDMVpO9L/ap+ntfbAdlwCxqnW9WBDAlKlU5rGdhan0Y1J2sXjvZUQsv bAKBoXOObsbZEFEyxFagqyS4Ive4NF7RRGHKAChFmsLbY8+Tipsrai2ZGas++CrOvtaj1e hx5zPYubHf27pxZ1kSCe6mPbOtrjvPIZ3PB2nAWZEahvIoxXa9wZ7XrJaKH7HJnWZITSMD Rq1IjF+vmaNTQ/of7m/qZrrZn06agVzaPGeVGr4h3ISwIT59aDgsrBV4HpylpNpHxA4Lyl giZvssdEom/0NkTgNPRuDjqno0MS2QSyrRruEsiUjoWJ/+PQRK9PsaqBM6/RqA== From: Thomas Richard Date: Mon, 15 Jan 2024 17:14:43 +0100 Subject: [PATCH 02/14] pinctrl: pinctrl-single: move suspend/resume to suspend_noirq/resume_noirq Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240102-j7200-pcie-s2r-v1-2-84e55da52400@bootlin.com> References: <20240102-j7200-pcie-s2r-v1-0-84e55da52400@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v1-0-84e55da52400@bootlin.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Tom Joseph , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com, Thomas Richard X-Mailer: b4 0.12.0 X-GND-Sasl: thomas.richard@bootlin.com The goal is to extend the active period of pinctrl. Some devices may need active pinctrl after suspend and/or before resume. So move suspend/resume to suspend_noirq/resume_noirq to have active pinctrl until suspend_noirq (included), and from resume_noirq (included). The deprecated API has been removed to use the new one (dev_pm_ops struct). Signed-off-by: Thomas Richard --- drivers/pinctrl/pinctrl-single.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 19cc0db771a5..4ad0f66cf42a 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1690,12 +1690,11 @@ static void pcs_restore_context(struct pcs_device *pcs) } } -static int pinctrl_single_suspend(struct platform_device *pdev, - pm_message_t state) +static int pinctrl_single_suspend_noirq(struct device *dev) { struct pcs_device *pcs; - pcs = platform_get_drvdata(pdev); + pcs = dev_get_drvdata(dev); if (!pcs) return -EINVAL; @@ -1710,11 +1709,11 @@ static int pinctrl_single_suspend(struct platform_device *pdev, return pinctrl_force_sleep(pcs->pctl); } -static int pinctrl_single_resume(struct platform_device *pdev) +static int pinctrl_single_resume_noirq(struct device *dev) { struct pcs_device *pcs; - pcs = platform_get_drvdata(pdev); + pcs = dev_get_drvdata(dev); if (!pcs) return -EINVAL; @@ -1723,6 +1722,11 @@ static int pinctrl_single_resume(struct platform_device *pdev) return pinctrl_force_default(pcs->pctl); } + +static const struct dev_pm_ops pinctrl_single_pm_ops = { + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pinctrl_single_suspend_noirq, + pinctrl_single_resume_noirq) +}; #endif /** @@ -1986,11 +1990,8 @@ static struct platform_driver pcs_driver = { .driver = { .name = DRIVER_NAME, .of_match_table = pcs_of_match, + .pm = pm_ptr(&pinctrl_single_pm_ops), }, -#ifdef CONFIG_PM - .suspend = pinctrl_single_suspend, - .resume = pinctrl_single_resume, -#endif }; module_platform_driver(pcs_driver); -- 2.39.2