Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6746806rwp; Tue, 18 Jul 2023 05:27:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlF7voFso6T0yu4hLXn1jSU75Z3jsnTIIy7Mnm/dCs3+/Hmd4ajOjH5IlqeufP0fiHv7S0sg X-Received: by 2002:a17:906:3404:b0:96f:d556:b926 with SMTP id c4-20020a170906340400b0096fd556b926mr10192766ejb.77.1689683277044; Tue, 18 Jul 2023 05:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689683277; cv=none; d=google.com; s=arc-20160816; b=Fa76ayVLSqRqISn/+rcbrTsfmgtqtojwzpVIzcHa0knh3s63SN+sG16VwS6Sgz/BjA H/f+eO+Yn4WkT7B6IX++jPxfxBxEpLS9WBUZjuEBW/q1U+7W/uJ93YYhAD2J3jO1Mb+J CPLsesT13GeOQuOQy7rlsoG8e636c7WEBEon8sBxSFVO64rOPtz0f+HbSHkDl6Rq8fRW nwClFUCkvE0UMYL6bJUPxtPovP7b8PEhHAnswRxK9hFDLMVHxEhMo8GDmfoThtPKMYiC AJRiIAwBbWT4S15iZ8xWEwsI62f46gECN0JzSOU9c4ByTCdb+jFwdnhCowrArttDIIhr 94TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=cUcNwMpkRou4HoWP59j29IOth9JECxsyonqdKzM916o=; fh=9B5y/k/P1yVMvWn/dPkBs8Pz+rpiI1PPkOIeASbKyyY=; b=XEfWN70+UDZ0jvDx7thtnViWzVdfz5ANROgo5lqTgVSVNST++ufPFMcuhXoQ09btpu neaZ7mzOp+QTI+BiT/nFE1HUOL2dcJsxVhad1Oj2BJW0kqr8jUchlvSOqGftme/7SX3y j9jlct3OWghhsZAON05Hk2rwaGR3tHmT0Uyd9U61GOnJTbKCzZg+0xAxDrSUbjB7pPMf xU1qOoFnsuHV42n160RvA+xjl9xk4uRd7cDihCk0RXxT5GyvHU7+2RQD9U4thubyTSyT 41HP+LTfbsNvcscc6/g/ZEj4NorEgavmJadHMynxPzkTOGAndrIg5PxigvPBiUPXmSby LkkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b="3Uf7/QWl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lf12-20020a170907174c00b00992bd9701f9si1140212ejc.798.2023.07.18.05.27.31; Tue, 18 Jul 2023 05:27:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b="3Uf7/QWl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232126AbjGRLzN (ORCPT + 99 others); Tue, 18 Jul 2023 07:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230457AbjGRLzM (ORCPT ); Tue, 18 Jul 2023 07:55:12 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB4171A5; Tue, 18 Jul 2023 04:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1689681308; 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=cUcNwMpkRou4HoWP59j29IOth9JECxsyonqdKzM916o=; b=3Uf7/QWlCCH5tyFroVybd1Qgx2JU1l06CTuA9m3ghJn+G0lPlIIF/07/Hxm/ZxptzHo46Z h2OZUg6m/lQhQJIB6Il4yacDOBHUwVFFbI50WGHrQQU43CQxBY24dhU5MIPMJCetRF/jeH v8qQUt4kIp37e6JvSTUVskqe2fHxiMw= Message-ID: <8f32cb8377808a073b043e0adf3ccf5ae5a84c92.camel@crapouillou.net> Subject: Re: [PATCH v2 10/10] pinctrl: tegra: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper From: Paul Cercueil To: Thierry Reding Cc: Andy Shevchenko , Mika Westerberg , Linus Walleij , Balsam CHIHI , Claudiu Beznea , Geert Uytterhoeven , Wolfram Sang , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, Andy Shevchenko , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Ludovic Desroches , Nicolas Ferre , Alexandre Belloni , Jonathan Hunter , "Rafael J. Wysocki" , Len Brown , Pavel Machek Date: Tue, 18 Jul 2023 13:55:05 +0200 In-Reply-To: References: <20230717172821.62827-1-andriy.shevchenko@linux.intel.com> <20230717172821.62827-11-andriy.shevchenko@linux.intel.com> <13f7153786cfcdc3c6185a3a674686f7fbf480dc.camel@crapouillou.net> <5e4b5bc23f3edb3ed30cb465420a51ffceceb53d.camel@crapouillou.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le mardi 18 juillet 2023 =C3=A0 13:41 +0200, Thierry Reding a =C3=A9crit=C2= =A0: > On Tue, Jul 18, 2023 at 10:42:47AM +0200, Paul Cercueil wrote: > > Hi Thierry, > >=20 > > Le mardi 18 juillet 2023 =C3=A0 09:45 +0200, Thierry Reding a =C3=A9cri= t=C2=A0: > > > On Mon, Jul 17, 2023 at 09:14:12PM +0200, Paul Cercueil wrote: > > > > Hi Andy, > > > >=20 > > > > Le lundi 17 juillet 2023 =C3=A0 20:28 +0300, Andy Shevchenko a > > > > =C3=A9crit=C2=A0: > > > > > Since pm.h provides a helper for system no-IRQ PM callbacks, > > > > > switch the driver to use it instead of open coded variant. > > > > >=20 > > > > > Signed-off-by: Andy Shevchenko > > > > > > > > > > --- > > > > > =C2=A0drivers/pinctrl/tegra/pinctrl-tegra.c | 5 +---- > > > > > =C2=A01 file changed, 1 insertion(+), 4 deletions(-) > > > > >=20 > > > > > diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c > > > > > b/drivers/pinctrl/tegra/pinctrl-tegra.c > > > > > index 4547cf66d03b..734c71ef005b 100644 > > > > > --- a/drivers/pinctrl/tegra/pinctrl-tegra.c > > > > > +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c > > > > > @@ -747,10 +747,7 @@ static int tegra_pinctrl_resume(struct > > > > > device > > > > > *dev) > > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return 0; > > > > > =C2=A0} > > > > > =C2=A0 > > > > > -const struct dev_pm_ops tegra_pinctrl_pm =3D { > > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.suspend_noirq =3D &te= gra_pinctrl_suspend, > > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.resume_noirq =3D &teg= ra_pinctrl_resume > > > > > -}; > > > > > +DEFINE_NOIRQ_DEV_PM_OPS(tegra_pinctrl_pm, > > > > > tegra_pinctrl_suspend, > > > > > tegra_pinctrl_resume); > > > > > =C2=A0 > > > > > =C2=A0static bool tegra_pinctrl_gpio_node_has_range(struct > > > > > tegra_pmx > > > > > *pmx) > > > > > =C2=A0{ > > > >=20 > > > > Another driver where using EXPORT_GPL_DEV_PM_OPS() would make > > > > more > > > > sense. > > >=20 > > > We don't currently export these PM ops because none of the Tegra > > > pinctrl > > > drivers can be built as a module. > >=20 > > This doesn't change anything. You'd want to use > > EXPORT_GPL_DEV_PM_OPS > > (or better, the namespaced version) so that the PM ops can be > > defined > > in one file and referenced in another, while still having them > > garbage- > > collected when CONFIG_PM is disabled. >=20 > Looking at the definition of EXPORT_GPL_DEV_PM_OPS(), it will cause > an > EXPORT_SYMBOL_GPL() to be added. So there very well is a change. And > it's a completely bogus change because no module is ever going to use > that symbol. If we were to ever support building the pinctrl driver > as > a module, then this would perhaps make sense, but we don't. In this particular case the EXPORT_SYMBOL_GPL() isn't really important, the rest of EXPORT_GPL_DEV_PM_OPS() is. I don't think having a symbol exported it is a big deal, TBH, if you use the namespaced version. If you really don't want that, we need a version of EXPORT_GPL_DEV_PM_OPS() that doesn't export the symbol. -Paul