From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E2B7EB64DC for ; Tue, 18 Jul 2023 09:57:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232447AbjGRJ5G (ORCPT ); Tue, 18 Jul 2023 05:57:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230126AbjGRJ4g (ORCPT ); Tue, 18 Jul 2023 05:56:36 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 653D810E0; Tue, 18 Jul 2023 02:55:47 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4R4vQf6KT9z6J6rL; Tue, 18 Jul 2023 17:53:14 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 18 Jul 2023 10:55:44 +0100 Date: Tue, 18 Jul 2023 10:55:43 +0100 From: Jonathan Cameron To: Andy Shevchenko CC: Mika Westerberg , Linus Walleij , Balsam CHIHI , "Claudiu Beznea" , Geert Uytterhoeven , Wolfram Sang , Thierry Reding , Paul Cercueil , , , , , , , , Andy Shevchenko , Andrew Lunn , Alexandre Belloni , Len Brown , "Rafael J. Wysocki" , Gregory Clement , Sean Wang , "Jonathan Hunter" , Ludovic Desroches , Pavel Machek , "Matthias Brugger" , Sebastian Hesselbarth , AngeloGioacchino Del Regno Subject: Re: [PATCH v2 01/10] pm: Introduce DEFINE_NOIRQ_DEV_PM_OPS() helper Message-ID: <20230718105543.00006395@Huawei.com> In-Reply-To: <20230717172821.62827-2-andriy.shevchenko@linux.intel.com> References: <20230717172821.62827-1-andriy.shevchenko@linux.intel.com> <20230717172821.62827-2-andriy.shevchenko@linux.intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Mon, 17 Jul 2023 20:28:12 +0300 Andy Shevchenko 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 Seems reasonable to me given it is fairly common Reviewed-by: Jonathan Cameron > --- > 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)) >