Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1099648rdb; Fri, 19 Jan 2024 08:08:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmWgXcyah0aOKBCSg5FXdo7dG0I0Yn6Y/B3+SJV9864gRVdBfsV+dme1XoOh+yyHg6zOwA X-Received: by 2002:a67:e24b:0:b0:468:910:87aa with SMTP id w11-20020a67e24b000000b00468091087aamr2525334vse.1.1705680531757; Fri, 19 Jan 2024 08:08:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705680531; cv=pass; d=google.com; s=arc-20160816; b=mJJ6LCBc5zTP56Pimak2ZKV6quyzqTopEsAft5CTXMb9f0TgJ4w2zXMRYjUOzgHylo Z63Q+fheSz21k4QxF6Uf4Mt9S2mJSrF6/sUoKpX9va9PVxV1lH6EpQM5lMnlG36ePfUm xjv0LanD0DudcLmwMbYwKimXv3wOLQRd3+xX/JBFtcjDnbOdfYbQDV+hjENaZ4BPzLTf qS8K4Yu4NBtlNVQmsSI7pUnePlJcpitFLoolPQ15oGeNmGc+yQ+X5047lXBWp9S5Hiui xi0f86VoLu2j5S9XUk6/PRY+vWhMyUYCnBGV+x4K6unOvHs/1V4qb61ZGRCr+6lhfNX9 R+iA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=/lcPvgWIm/QbVzXxcPjjQvz3cRLruCD/tBqEeHF3XX0=; fh=zJ6tyQPSPJtpNE1kDDjqZJNbBRQIRffCQQMnrzX3sgI=; b=U8L0pQRQ6DCOnCTdhw+IFJu7z/T+nBJdmnlUU8KQrcBvy4opydPPyZ8c1wC24vO0hr bY7e04VbzzJrPYgL+X2SwYThXUIf245RTGXz8wa5M0RIeLAtG5Yjs109WowvL4O19OfQ fkppPufSmvtiN9QE+I3W8OYDlOAMHA8qLlSfF+7hid6VJAgY4yoPgaPMcz7dyI2jHXXQ w267+1/Zj/4FpIRTxMScE/Bv2t0NQZ/N8yrNbuaq2ROYTAWQ9S0gzGG6/8Vs4YtjrVql 9vVjOd8nrCmN1v57fs2NORUXASzOMt7U1tY0nEXDXebJPCXEPwSldByweR5fKizWkknR 77Iw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WONIpkeF; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-31343-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31343-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jd12-20020a05610212cc00b00466f86a9f50si1772368vsb.584.2024.01.19.08.08.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 08:08:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31343-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WONIpkeF; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-31343-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31343-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7BA4D1C216FC for ; Fri, 19 Jan 2024 16:08:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6AAD55765; Fri, 19 Jan 2024 16:08:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="WONIpkeF" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 9E4D054FBB; Fri, 19 Jan 2024 16:08:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705680505; cv=none; b=m84GWfpJcHwEXujRuBCjRCDweTB6ZwfOFPhFU8mkdCobaAL9bhbm8wXRPzZKSpoKorVyA/Q/qyNXhcvz5pELYloeRY4WtqmvVj22GCC4RnLU1tG7GAo2L/eIIj4WH1gdyd7Mb4QZpaLth2/iLt8cG5cXSWGL6qazgH2GSqNari0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705680505; c=relaxed/simple; bh=f1NTbZpi6beXqIjw6g6+qGt7w9p6IgHNGpWIbTLSFgs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dxh05/nLCJwSqcpsrtgTcjV5t1tgpJ2Z+v4jWFSqv3mqLaluz+1ElzPkWTkGygPW7NRayKurHATPrx9IC7MMkXx1HyHkmD1lJj/0JaMFV7lCkwtgx50LaqDpdAZxGWC9rTbkq2xbIvPBIR5GqiqhSvkQLn/v5529gjcKLHbOwT8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=WONIpkeF; arc=none smtp.client-ip=217.70.183.193 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 65E85240008; Fri, 19 Jan 2024 16:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705680495; 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=/lcPvgWIm/QbVzXxcPjjQvz3cRLruCD/tBqEeHF3XX0=; b=WONIpkeF6OM+U5keRwkDYZGMolP5XktgDBB6mIAe8MUTsy79HiG6aPHFRUwt+zvQnJD1yV rhimS5Xv0eRylsTuhD2McG83J2YXfxvXNhUbjh/C+EXBuXMvv5+07L8LSuG0ozxWPYlwY/ aNSMECbf8FnizI8ADDg3l8yKMTxFLFAw5gxxCKPkDelc+OqObRloUw9fEpi35HIqKz+mBP wPtcYc/iRsKufncWrvdORBHBKi/t3Zi4ATWX3EAfBtizCbIK5XiiUMupEJBg9I+eWfq8I+ stz/4f2GuyfGsCnAIosFOmQIF5TolDLgz4bAPmE8Q0y3roHYchplOYTQKxUDog== Message-ID: <223422cc-2a1c-417b-8fa1-20d3b3eb41ef@bootlin.com> Date: Fri, 19 Jan 2024 17:08:11 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 02/14] pinctrl: pinctrl-single: move suspend/resume to suspend_noirq/resume_noirq Content-Language: en-US To: Andy Shevchenko Cc: 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 , 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 References: <20240102-j7200-pcie-s2r-v1-0-84e55da52400@bootlin.com> <20240102-j7200-pcie-s2r-v1-2-84e55da52400@bootlin.com> From: Thomas Richard In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: thomas.richard@bootlin.com On 1/15/24 21:02, Andy Shevchenko wrote: > On Mon, Jan 15, 2024 at 6:16 PM Thomas Richard > wrote: >> >> 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). > > ->...callback...() > (Same comment I have given for the first patch) fixed > > ... > >> struct pcs_device *pcs; >> >> - pcs = platform_get_drvdata(pdev); >> + pcs = dev_get_drvdata(dev); >> if (!pcs) >> return -EINVAL; > > Drop dead code. > This should be simple one line after your change. > > struct pcs_device *pcs = dev_get_drvdata(dev); > dead code dropped > ... > >> struct pcs_device *pcs; >> >> - pcs = platform_get_drvdata(pdev); >> + pcs = dev_get_drvdata(dev); >> if (!pcs) >> return -EINVAL; > > Ditto. > > ... dead code dropped > >> +static const struct dev_pm_ops pinctrl_single_pm_ops = { >> + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pinctrl_single_suspend_noirq, >> + pinctrl_single_resume_noirq) >> +}; > > Use proper / modern macro. fixed, use DEFINE_NOIRQ_DEV_PM_OPS now > > ... > >> #endif > > Why ifdeferry is needed (esp. taking into account pm_ptr() use below)? We may have an "unused variable" warning for pinctrl_single_pm_ops if CONFIG_PM is undefined (due to pm_ptr). -- Thomas Richard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com