Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5885999rwp; Mon, 17 Jul 2023 11:00:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlFQ+Wze7FammTfkYikxGJ/se/iN5GHVRymQw4c8PM+J+4xHy64LNhDLBgQD0tQUatKGXdOV X-Received: by 2002:a17:902:a511:b0:1b8:8069:d432 with SMTP id s17-20020a170902a51100b001b88069d432mr9665433plq.16.1689616821711; Mon, 17 Jul 2023 11:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689616821; cv=none; d=google.com; s=arc-20160816; b=a6YSLGGguMCjhdreJbewLbfbSBn7qRp5xFT4q486yD5u8suy90ocISfbaJZ0ZA9jX3 oIVsoUZr2SKwoLPOO1JBlwt7vXnLLVJCXCFRW0shYKlEGgWlcDmv+N8hkMaigiF5cAwr xiBInlXiDNsfQoqmICm+eqypveych4BLTKCh6+xuW/nlQ6nIdSAdo5UrIsAT9WUURqZz uFJghrnd0y6T+YGgkG3GBPGChGEhLaMCd5c1ex2oCsCj454yfNoOT8GVZcCigSgGHvCc mMzC7cn6SS8IJDeMklyMbxFtCjUEbATKy1+vHCTA0iJ+nsHsoY5FfLpzEBUVAviNBhSv PePA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a170902eb8f00b001b9d2659694si179689plg.270.2023.07.17.11.00.05; Mon, 17 Jul 2023 11:00:21 -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 S230008AbjGQR30 (ORCPT + 99 others); Mon, 17 Jul 2023 13:29:26 -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 ); 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 To: Andy Shevchenko , Mika Westerberg , Linus Walleij , Balsam CHIHI , Claudiu Beznea , Geert Uytterhoeven , Wolfram Sang , Thierry Reding , Paul Cercueil , 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 , 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 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: X-Mailing-List: linux-kernel@vger.kernel.org _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 --- 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