Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5990238rwp; Mon, 17 Jul 2023 12:54:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlFlvXUkUniB5YBMxd8v52mfp6ntXglA2ydF1DHHOm+Ww9o+02qHS1VrjiKIAma8lsBPOWXW X-Received: by 2002:a05:6a21:33a6:b0:126:a5e3:3927 with SMTP id yy38-20020a056a2133a600b00126a5e33927mr14552581pzb.8.1689623664122; Mon, 17 Jul 2023 12:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689623664; cv=none; d=google.com; s=arc-20160816; b=krdwUbT1DuxL8lSJunCeIWuI3geBvoByms6Mkh692Mlt1ajjCjQT4xV07YT1tYmthw okas9FTChudzOP+fNYtuKwSS6XZacdyB+fRsIQGfCqBzQZ1KeJ1Zdu0/KNB5DfC/CO24 ZeYELm+0N54vX10E32f4wU08aMNp7LUSS0iXDXCYHvmytfGni7dsFpZOdBDwnvERZCCx GMZvoQbVb1/9xWla8elL8SC8cC54WzMIklvWcWAXJnatPCq2Uood0i3pSKqy+mpKI/Pv Kk/XfQsJDKlQOFq8jstqVsyZJWfrKGvrenWi+wqUDXM/qBdm4PcXd16zoKBKjNkfV93F c6qg== 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=N2cj6nzOloFnUedIE+sqlGYJXKAM8KXP3LA38uvlSgg=; fh=r0pW40tkm/jD9RjXabFgSoNafui7KeGC/E7yCAT/cFU=; b=Poryj96vR7OckS+Bo+qeASAIN1Jl5ovRH0j0X+dXRO8DZtTAof21HAYI6W/wLmjBAT MOcwOegXnOgyfSlRI0cJObA07gB9Yg+8kRlZoLqiYuu7qZkMpIxsWTGOrlkBaES4zALJ wF5GzQ7FqMPETcx0p9kasPuey1n9Ljdpw4bIz4lNoP1h1kYiqbeVuqgH/6Q4cg9ZN1xh wZhuE3MRTk7urahVkock9xAgNI8h87GEjU7F/Vrdduz05zR29A8LjRLiQxb7GDv/NakT e1pxWCMW9HVED1HGqetkEnt9Fd8WcybMmlxZ8pLpzqLmM2VscWoOOtzRs/ER0Ghnma6v gRxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=aMum8ykN; 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 cb12-20020a056a00430c00b00666b7377d65si282209pfb.389.2023.07.17.12.54.12; Mon, 17 Jul 2023 12:54:24 -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=aMum8ykN; 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 S231187AbjGQTTH (ORCPT + 99 others); Mon, 17 Jul 2023 15:19:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjGQTTF (ORCPT ); Mon, 17 Jul 2023 15:19:05 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06F8618D; Mon, 17 Jul 2023 12:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1689621543; 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=N2cj6nzOloFnUedIE+sqlGYJXKAM8KXP3LA38uvlSgg=; b=aMum8ykNR3O1EyRf6APapE/nrm/XIgEfrpD8ayt6JjIYHc+ZXXuoLqyzwoTFi2PMsEbFo0 8F9S9ZtTbKtbVAibRi4zQuAieo9ldUyxhzc5NMkbAJtj94tVSGeV2CfoYzoeBe1keU1UIX 0eqds2sfP9zZWoHFmwgWgbxzA1/ATLA= Message-ID: Subject: Re: [PATCH v2 01/10] pm: Introduce DEFINE_NOIRQ_DEV_PM_OPS() helper From: Paul Cercueil To: Andy Shevchenko , Mika Westerberg , Linus Walleij , Balsam CHIHI , Claudiu Beznea , Geert Uytterhoeven , Wolfram Sang , Thierry Reding , 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 Date: Mon, 17 Jul 2023 21:19:00 +0200 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> 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 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 Hi Andy, Le lundi 17 juillet 2023 =C3=A0 20:28 +0300, Andy Shevchenko a =C3=A9crit= =C2=A0: > _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. >=20 > Signed-off-by: Andy Shevchenko > --- > =C2=A0include/linux/pm.h | 9 +++++++++ > =C2=A01 file changed, 9 insertions(+) >=20 > 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 =3D { > \ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0SET_RUNTIME_PM_OPS(suspen= d_fn, resume_fn, idle_fn) \ > =C2=A0} > =C2=A0 > +/* > + * 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 to become too bloated and confusing. Anyway: Reviewed-by: Paul Cercueil Cheers, -Paul > + */ > +#define DEFINE_NOIRQ_DEV_PM_OPS(name, suspend_fn, resume_fn) \ > +const struct dev_pm_ops name =3D { \ > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0NOIRQ_SYSTEM_SLEEP_PM_OPS(susp= end_fn, resume_fn) \ > +} > + > =C2=A0#define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr)) > =C2=A0#define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), > (_ptr)) > =C2=A0