Message ID | 20230717172821.62827-2-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1262492vqt; Mon, 17 Jul 2023 11:01:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlFuu7FA8hzAP6HiaJOKr9avSrkBCz0PcJoQuq7jIefY3+summnMqs8UMjDOeMapFiw5Qo+i X-Received: by 2002:a05:6512:1045:b0:4f9:cb8f:3182 with SMTP id c5-20020a056512104500b004f9cb8f3182mr9415979lfb.25.1689616915619; Mon, 17 Jul 2023 11:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689616915; cv=none; d=google.com; s=arc-20160816; b=iLKa5xgbk3Bfwuq71Ngoph43tDGKCSHoeLjvAl6c0MoxoteqEQkPtKCiYqT8BJg9ac yz/ByjjXbcVLaK654OGwYWSjh41yPrYnX7upOIMkmWxLvakiIxoTb5YJG8LUHBdmZTLJ PfGLkhhcjVLY6VwbvJQalg3oSQItqDoHOvXtQrkV/nSaoJ9u6UCUBlkaZ/d7msAjs4Je x25EK9DPDIqtVzowLwaQZyoUhSfv1M6VGgXKYwe6RbA64i0jxl3UFiBHW30K9PHqaUW/ EW1/GhQt2ODcHP/iBfqCa07V55a2NFQFPzQGkhIIAjX5/2TPgsNH4r8UpGlIZX7Oyosn jj0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MWl78HpyLZ82ZOMM9xwmW3pliXTeUNZqmd1w6je73XQ=; fh=BB0GY8bRtFrF5EQ7S2W7nc4ojj3WvWGP74FS8Jyyj9E=; b=t7tBrkkNLeDBv+yW3bEssMj7pnI5rMN5hWuxNyfux+oiykL0Sh/6poeRX60tJwWXP2 JBavpdg7yhTaHrUziEX5sSlLYWAh9shOMMYQl3VVo+k9NGFbTKWE3BL7erL22nW0j4rj k1zHK88u1pwm6Rw62zOMuLQjF12DR/Nv/vBSKPRrtpwWt8FYcNIRYzZTzpqSU9wSOY+B +PVZXyaouF8YzZ2aM5YAX0hHkWUAzgu+OKr87rS1TuFWu5wX6usKWEEYhixzuJiftmGi y0aucqtL5gioigloMz8akXFXzzWYKx0YzZlma2ip3SZYLJF8ehqf5XDFVNStVqCYwVAR +Iew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KUQxD30d; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020aa7df8e000000b005218c27b193si2298607edy.501.2023.07.17.11.01.21; Mon, 17 Jul 2023 11:01:55 -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=@intel.com header.s=Intel header.b=KUQxD30d; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230384AbjGQR31 (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Mon, 17 Jul 2023 13:29:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbjGQR3Z (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Jul 2023 13:29:25 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B260D1989; Mon, 17 Jul 2023 10:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689614942; x=1721150942; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zaKwe1xeE0MC6urnhJKPL5m7n74tZLwG88asISfLaWc=; b=KUQxD30dU4icNkpJcqOBEKvwL0+CIE/ujp8yeKwO/ZUAYxRn1t3DHM6W Zc4EuYAvt6CWJ9xiWwW1uis23uEC9wCXKrfp5CyzXpKXPiQJhoELi1CGQ G8F4WrnQidL9Phoq1J9AgCtwVjWYtwvc1K6zLb8FNLDFH2VGzJogkIWas KLOVcS0O3jgi1fvuCt5CVgQq8l6TPxAkgrLyPV/oLqYAicKQue7XPB61T rSj3CDK7/snr/K8HFGrD5TKxZkGqF220ExhBcWmGvGsCbH/K43OxSgX6m WSl1K/1K2tunNr/1zCG5qdDZtMh4rzU33UBmcKUPxzynbVLNhDZ4tOGLf g==; X-IronPort-AV: E=McAfee;i="6600,9927,10774"; a="350854467" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="350854467" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2023 10:28:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10774"; a="813426651" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="813426651" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 17 Jul 2023 10:28:33 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id DA2B524F; Mon, 17 Jul 2023 20:28:39 +0300 (EEST) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Mika Westerberg <mika.westerberg@linux.intel.com>, Linus Walleij <linus.walleij@linaro.org>, Balsam CHIHI <bchihi@baylibre.com>, Claudiu Beznea <claudiu.beznea@microchip.com>, Geert Uytterhoeven <geert+renesas@glider.be>, Wolfram Sang <wsa+renesas@sang-engineering.com>, Thierry Reding <thierry.reding@gmail.com>, Paul Cercueil <paul@crapouillou.net>, 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 Cc: Andy Shevchenko <andy@kernel.org>, Sean Wang <sean.wang@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Andrew Lunn <andrew@lunn.ch>, Gregory Clement <gregory.clement@bootlin.com>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Ludovic Desroches <ludovic.desroches@microchip.com>, Nicolas Ferre <nicolas.ferre@microchip.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Jonathan Hunter <jonathanh@nvidia.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz> Subject: [PATCH v2 01/10] pm: Introduce DEFINE_NOIRQ_DEV_PM_OPS() helper Date: Mon, 17 Jul 2023 20:28:12 +0300 Message-Id: <20230717172821.62827-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230717172821.62827-1-andriy.shevchenko@linux.intel.com> References: <20230717172821.62827-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771691746880594538 X-GMAIL-MSGID: 1771691746880594538 |
Series |
pinctrl: Provide NOIRQ PM helper and use it
|
|
Commit Message
Andy Shevchenko
July 17, 2023, 5:28 p.m. UTC
_DEFINE_DEV_PM_OPS() helps to define PM operations for the system sleep
and/or runtime PM cases. Some of the existing users want to have _noirq()
variants to be set. For that purpose introduce a new helper which sets
up _noirq() callbacks to be set and struct dev_pm_ops be provided.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
include/linux/pm.h | 9 +++++++++
1 file changed, 9 insertions(+)
Comments
Hi Andy, Le lundi 17 juillet 2023 à 20:28 +0300, Andy Shevchenko a écrit : > _DEFINE_DEV_PM_OPS() helps to define PM operations for the system > sleep > and/or runtime PM cases. Some of the existing users want to have > _noirq() > variants to be set. For that purpose introduce a new helper which > sets > up _noirq() callbacks to be set and struct dev_pm_ops be provided. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > include/linux/pm.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/include/linux/pm.h b/include/linux/pm.h > index badad7d11f4f..0f19af8d5493 100644 > --- a/include/linux/pm.h > +++ b/include/linux/pm.h > @@ -448,6 +448,15 @@ const struct dev_pm_ops __maybe_unused name = { > \ > SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ > } > > +/* > + * Use this if you want to have the suspend and resume callbacks be > called > + * with disabled IRQs. with disabled IRQs -> with IRQs disabled? I'm not really sure that we need this macro, but I don't really object either. As long as it has callers I guess it's fine, I just don't want <linux/pm.h> to become too bloated and confusing. Anyway: Reviewed-by: Paul Cercueil <paul@crapouillou.net> Cheers, -Paul > + */ > +#define DEFINE_NOIRQ_DEV_PM_OPS(name, suspend_fn, resume_fn) \ > +const struct dev_pm_ops name = { \ > + NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ > +} > + > #define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr)) > #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), > (_ptr)) >
On Mon, Jul 17, 2023 at 10:19 PM Paul Cercueil <paul@crapouillou.net> wrote: > Le lundi 17 juillet 2023 à 20:28 +0300, Andy Shevchenko a écrit : ... > I'm not really sure that we need this macro, but I don't really object > either. As long as it has callers I guess it's fine, I just don't want > <linux/pm.h> to become too bloated and confusing. Isn't theidea behind all helpers to simplify life of the users by the cost of bloaring up (a bit) the common file (header and/or C file)? As cover letter shows, despite having several LoCs added to the pm.h we saved already a few dozens of LoCs. And this it not the end, there are more users can come. Moreover, there are some deprecated macros and those that starts with SET_*(). Removing them can make balance go too negative for the pm.h (in terms of +- LoCs). So I can't really consider above as argument. > Anyway: > Reviewed-by: Paul Cercueil <paul@crapouillou.net> Thank you!
On Mon, Jul 17, 2023 at 7:28 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > _DEFINE_DEV_PM_OPS() helps to define PM operations for the system sleep > and/or runtime PM cases. Some of the existing users want to have _noirq() > variants to be set. For that purpose introduce a new helper which sets > up _noirq() callbacks to be set and struct dev_pm_ops be provided. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Gr{oetje,eeting}s, Geert
On Mon, Jul 17, 2023 at 7:28 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > _DEFINE_DEV_PM_OPS() helps to define PM operations for the system sleep > and/or runtime PM cases. Some of the existing users want to have _noirq() > variants to be set. For that purpose introduce a new helper which sets > up _noirq() callbacks to be set and struct dev_pm_ops be provided. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Rafael J. Wysocki <rafael@kernel.org> and please feel free to route this how you see fit. > --- > include/linux/pm.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/include/linux/pm.h b/include/linux/pm.h > index badad7d11f4f..0f19af8d5493 100644 > --- a/include/linux/pm.h > +++ b/include/linux/pm.h > @@ -448,6 +448,15 @@ const struct dev_pm_ops __maybe_unused name = { \ > SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ > } > > +/* > + * Use this if you want to have the suspend and resume callbacks be called > + * with disabled IRQs. > + */ > +#define DEFINE_NOIRQ_DEV_PM_OPS(name, suspend_fn, resume_fn) \ > +const struct dev_pm_ops name = { \ > + NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ > +} > + > #define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr)) > #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr)) > > -- > 2.40.0.1.gaa8946217a0b >
diff --git a/include/linux/pm.h b/include/linux/pm.h index badad7d11f4f..0f19af8d5493 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -448,6 +448,15 @@ const struct dev_pm_ops __maybe_unused name = { \ SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ } +/* + * Use this if you want to have the suspend and resume callbacks be called + * with disabled IRQs. + */ +#define DEFINE_NOIRQ_DEV_PM_OPS(name, suspend_fn, resume_fn) \ +const struct dev_pm_ops name = { \ + NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ +} + #define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr)) #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr))