Message ID | 20221229125957.45923-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:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2388320wrt; Thu, 29 Dec 2022 05:02:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXtqwfMbTsxQJclRRbRf5HQcwDr3hHdf+9aWLvaDALONPjr9Qb7TNX53ISDBq8Yk0+TkzAdU X-Received: by 2002:a05:6402:754:b0:485:9d0f:6193 with SMTP id p20-20020a056402075400b004859d0f6193mr10178491edy.38.1672318970039; Thu, 29 Dec 2022 05:02:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672318970; cv=none; d=google.com; s=arc-20160816; b=GU7lUoFK2Zf4dDhW4Qp3MdMLi+Te8c3HrLmQxZxDpmLVjanBia0+waRLpFZGWnQS4m zW+0sReZf3bZCNwBb0IT9mNDjCOzsnZB5c+jVxoLgDpPpYthYeludcUSE9fxrmCBhgvl 1d8aArXmBpgfoi2pX5rI+dJYTKgLwg7FxR5QABojjvaGpZNtsPP0M8vaCmu1LZ8hwWro AeiwgAfCKdo8uibNp2ONN6Y/PZT/VXSaA6JR/i9vq47IV5JrGomN8Lgc24MvHp6XDsIt 0iLtL7tp+wTF0VTxvd9IQfoq+j3u5KdlB5kJnxKNoBiA6x666HGe6Nj0uvNVO7XsWk2G ncCw== 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=4k1yORUEaLht6h5eK85MKc5WKJKPetwxkbB/iPkTpXY=; b=ZjdL/TcT11gIIIf68ELqoWEx+3lmwvs7tYjFUykDZ4yAevUTjuxQwrjfuWykYHJOe8 xrwRzzM1kGWAgXCpvUv23iPjW4VMUm/WpP89lhw5tEzDi5+04v1OXDPh63usAYIHrp53 Q7A5r4Ywrw7Y5vsvYArJtLCTdtJS0gBN0KxkcQOeKpix74l6AOY/rDDtkdVgPFuOdmO2 kejUxhq/sGx+wcGFXD4v2ZwAB80jebjtz0Rp8p8z6eF+lQX8ZSPzIVTV2sLMdmwBUlgs gkENkfqkfMrwHEVZ7Lord96czrcyf4etdtocDQV+zvgwDjmEQosYC4W61vMDaj+MWfhn HXGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Cu4eGI03; 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 d21-20020a05640208d500b0046aeb9d6223si14591056edz.158.2022.12.29.05.02.22; Thu, 29 Dec 2022 05:02:50 -0800 (PST) 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=Cu4eGI03; 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 S233332AbiL2M7i (ORCPT <rfc822;eddaouddi.ayoub@gmail.com> + 99 others); Thu, 29 Dec 2022 07:59:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233355AbiL2M7e (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 29 Dec 2022 07:59:34 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1008513DE9; Thu, 29 Dec 2022 04:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672318774; x=1703854774; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=34P7+7ieU5tbrjpB2CMgoEmWUxpnYkYbmhyOoY0g5QI=; b=Cu4eGI03S8f2zxWZle3muOnBDAQ4QlcQ24u51MyUvNY8yXoiu3jdK3nG 9DWsmUM/dfHSmPysFa2I8EpJWDd4LJF4SkKVfkiDUfu2E4IjVClO0Cr8x A7MER7j5tklenQybwvNBQisHw/sAweCmuWhVlR0I9HQNIJfcJDPpI7VbO Y8bsJpNBazmWhDEEGig+TGqh95hBJUFdvmHmuJOruFvg9YPPxQJPFmejA pXzdqZd+Qwveaj9d8M8V+klLiF2cuIg8kmccgCv5O0KEo2mTLFV4NEpYf GCwIHqGa7USVl2486BAo2YAwjk5vOQKGocYHKDRMCOZtCXBwcanzLeLEf A==; X-IronPort-AV: E=McAfee;i="6500,9779,10574"; a="348247462" X-IronPort-AV: E=Sophos;i="5.96,284,1665471600"; d="scan'208";a="348247462" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2022 04:59:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10574"; a="777691260" X-IronPort-AV: E=Sophos;i="5.96,284,1665471600"; d="scan'208";a="777691260" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 29 Dec 2022 04:59:30 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 52DE0F8; Thu, 29 Dec 2022 15:00:01 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Mika Westerberg <mika.westerberg@linux.intel.com>, "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>, Paul Cercueil <paul@crapouillou.net>, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Andy Shevchenko <andy@kernel.org>, Linus Walleij <linus.walleij@linaro.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz> Subject: [PATCH v1 1/3] pm: Introduce DEFINE_NOIRQ_DEV_PM_OPS() helper Date: Thu, 29 Dec 2022 14:59:55 +0200 Message-Id: <20221229125957.45923-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221229125957.45923-1-andriy.shevchenko@linux.intel.com> References: <20221229125957.45923-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753553536220860325?= X-GMAIL-MSGID: =?utf-8?q?1753553536220860325?= |
Series |
pinctrl: intel: Provide NOIRQ PM helper and use it
|
|
Commit Message
Andy Shevchenko
Dec. 29, 2022, 12:59 p.m. UTC
There are a few drivers and might be more in the future that
open code the functionality of proposed DEFINE_NOIRQ_DEV_PM_OPS()
helper. From now on they may switch to the new helper and save
a few lines of code.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
include/linux/pm.h | 5 +++++
1 file changed, 5 insertions(+)
Comments
On Thu, Dec 29, 2022 at 1:59 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > There are a few drivers and might be more in the future that > open code the functionality of proposed DEFINE_NOIRQ_DEV_PM_OPS() > helper. From now on they may switch to the new helper and save > a few lines of code. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > include/linux/pm.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/pm.h b/include/linux/pm.h > index 93cd34f00822..eba96822b1d9 100644 > --- a/include/linux/pm.h > +++ b/include/linux/pm.h > @@ -444,6 +444,11 @@ const struct dev_pm_ops __maybe_unused name = { \ > SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ > } > > +#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) \ > +} There is NOIRQ_SYSTEM_SLEEP_PM_OPS(), so why is the above needed in addition? > + > #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 Fri, Dec 30, 2022 at 8:43 PM Rafael J. Wysocki <rafael@kernel.org> wrote: > On Thu, Dec 29, 2022 at 1:59 PM Andy Shevchenko > <andriy.shevchenko@linux.intel.com> wrote: > > > > There are a few drivers and might be more in the future that > > open code the functionality of proposed DEFINE_NOIRQ_DEV_PM_OPS() > > helper. From now on they may switch to the new helper and save > > a few lines of code. ... > > +#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) \ > > +} > > There is NOIRQ_SYSTEM_SLEEP_PM_OPS(), so why is the above needed in addition? It defines the constant object of struct dev_pm_ops type with this included and as the commit message says, allows to save a few lines of code in each of the drivers that uses NOIRQ_SYSTEM_SLEEP_PM_OPS() currently. The examples on how to convert are provided in the patches 2 and 3.
On Fri, Dec 30, 2022 at 8:23 PM Andy Shevchenko <andy.shevchenko@gmail.com> wrote: > > On Fri, Dec 30, 2022 at 8:43 PM Rafael J. Wysocki <rafael@kernel.org> wrote: > > On Thu, Dec 29, 2022 at 1:59 PM Andy Shevchenko > > <andriy.shevchenko@linux.intel.com> wrote: > > > > > > There are a few drivers and might be more in the future that > > > open code the functionality of proposed DEFINE_NOIRQ_DEV_PM_OPS() > > > helper. From now on they may switch to the new helper and save > > > a few lines of code. > > ... > > > > +#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) \ > > > +} > > > > There is NOIRQ_SYSTEM_SLEEP_PM_OPS(), so why is the above needed in addition? > > It defines the constant object of struct dev_pm_ops type with this > included and as the commit message says, allows to save a few lines of > code in each of the drivers that uses NOIRQ_SYSTEM_SLEEP_PM_OPS() > currently. The examples on how to convert are provided in the patches > 2 and 3. So this is in analogy with _DEFINE_DEV_PM_OPS(), isn't it? It would be good to mention this in the changelog. IMO the changelog is rather hard to follow in general and it should not refer to the changes made in order to understand what's going on.
diff --git a/include/linux/pm.h b/include/linux/pm.h index 93cd34f00822..eba96822b1d9 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -444,6 +444,11 @@ const struct dev_pm_ops __maybe_unused name = { \ SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ } +#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))