Message ID | 20230130130453.379749-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2171537wrn; Mon, 30 Jan 2023 05:14:21 -0800 (PST) X-Google-Smtp-Source: AK7set+rqAuNcD3kAhKVsbAWjHWOB7mfMiPQ2saLlz4BMuYzfs27Hoio0vVjpOR3FMkCnd6xTi1w X-Received: by 2002:a17:90a:358:b0:22c:77e8:235 with SMTP id 24-20020a17090a035800b0022c77e80235mr7541983pjf.21.1675084460607; Mon, 30 Jan 2023 05:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675084460; cv=none; d=google.com; s=arc-20160816; b=KNLdlIJuWaAGpw7ZPoPZ5nMuosD0SdP5TboOit3uTmWfpBkAhXNqQ7E7IQDV2tk/CI UzXhYACe551AIScUQNEYiwIVdu/3NWIr3yIMznFS+qbWKhCjSe/z3TjkPMKqYw3xGqll hHF2PAD8fni+HWCFGAanOzke+L7zs8Bb/O+gbURFvVsCOBKfRNEqK9edUlq96z5MLrG2 I7cXKtKTbDsGFfEtlSOwE4KD4MUxJwOKIihzg7kYs9wgWN330fmZS8SKgYV+I+Z5mmSX wgDBHbEJdB6mlmPPhQyf9INog13lBcAhrKvB9Aag1JDCy2Ou9gGW2a9ExR7FYNA9Rrcw dpgA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=qeAwgv5Vwrj+ZUHYj+u/v2cRx3SLtK/jWanZZUzZ5X8=; b=rdkJkckQz2nx21fsu+9HHdRSNll6kuFgHaD8qW/thQ1yITRSKm6IL/BSPjFcwJ+rqM 0gqtjMt36AZ/GIyIrekeYt8IJxBZxT2EWi+wP9yRUQSly1iXrPcUNFEREmuOkjY0RDXU J6WQx5YlLvtRnhT7oKPJfeYlovyAD1rX8F08fAVZE2F8loc0Wc8V0pxXPnFOtgG6MaV3 amqiZQsbf9/kMfIzxgLuhsPM+1snX1YD0R5TUwzYfmtG8A0Dhp6L4voyZMPh1+3eU5Be yhGCy5NMu6egHi10JyZ+DKsigOQtLYlwWYB9QQi3/h3bBBlsCYchoElhfemU/Sd+8A5A 4nbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ss/YBlVw"; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u186-20020a6379c3000000b004791e50c5ecsi2564753pgc.87.2023.01.30.05.14.08; Mon, 30 Jan 2023 05:14:20 -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=@kernel.org header.s=k20201202 header.b="ss/YBlVw"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236602AbjA3NFD (ORCPT <rfc822;n2h9z4@gmail.com> + 99 others); Mon, 30 Jan 2023 08:05:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236100AbjA3NE7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 30 Jan 2023 08:04:59 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A3166589 for <linux-kernel@vger.kernel.org>; Mon, 30 Jan 2023 05:04:58 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0096360B21 for <linux-kernel@vger.kernel.org>; Mon, 30 Jan 2023 13:04:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4544C433D2; Mon, 30 Jan 2023 13:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675083897; bh=mmPMPIPmQMBoM9TxOjnSVNcnUXCZeV3N+dzz5BQ8urI=; h=From:To:Cc:Subject:Date:From; b=ss/YBlVwPSRzs68eTT278PeUuCwFSeUvVRaBWbMkEovzKNJSh9hA8CXy0R6NarH4Z xexXO/NA2ryynCT0d4dIwEuN7c4CpOdsoIO+1eQOLLf5CmOvl7+HnvPU9ptQ+juVdi ryJMEEBmez8NHlPbyyuS9HPNdkNxoF9upX6d2f5wy36c+qsz54eeVmX2Pe9kXdYQpV VhusaCAykFEHQoknQx12e2NJGBbTpInzV2tUVlAIzotJgduSqEa8yREdu2+Js9QqIR w2RiclDurtDUfsS4lTn7GI4VoWMrO4lRdg6oc6wBVxBVDKjLkFBMGg39mVuY++WFVK q0CfgpeOYMeoQ== From: Arnd Bergmann <arnd@kernel.org> To: Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org> Cc: Arnd Bergmann <arnd@arndb.de>, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] soc: sunxi: select CONFIG_PM Date: Mon, 30 Jan 2023 14:04:47 +0100 Message-Id: <20230130130453.379749-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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?1756453363664311339?= X-GMAIL-MSGID: =?utf-8?q?1756453363664311339?= |
Series |
soc: sunxi: select CONFIG_PM
|
|
Commit Message
Arnd Bergmann
Jan. 30, 2023, 1:04 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> Selecting CONFIG_PM_GENERIC_DOMAINS without CONFIG_PM leads to a build failure: WARNING: unmet direct dependencies detected for PM_GENERIC_DOMAINS Depends on [n]: PM [=n] Selected by [y]: - SUN20I_PPU [=y] && (ARCH_SUNXI [=n] || COMPILE_TEST [=y]) drivers/base/power/domain_governor.c: In function 'default_suspend_ok': drivers/base/power/domain_governor.c:85:24: error: 'struct dev_pm_info' has no member named 'ignore_children' 85 | if (!dev->power.ignore_children) | ^ drivers/base/power/domain.c: In function 'genpd_queue_power_off_work': drivers/base/power/domain.c:657:20: error: 'pm_wq' undeclared (first use in this function) 657 | queue_work(pm_wq, &genpd->power_off_work); | ^~~~~ Unfortunately platforms are inconsistent between using 'select PM' and 'depends on PM' here. CONFIG_PM is a user-visible symbol, so in principle we should be using 'depends on', but on the other hand using 'select' here is more common among drivers/soc. Go with the majority for now, as this has a smaller risk of introducing circular dependencies. We may need to clean this up for consistency later. Fixes: 0e30ca5ab0a8 ("soc: sunxi: Add Allwinner D1 PPU driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/soc/sunxi/Kconfig | 1 + 1 file changed, 1 insertion(+)
Comments
Dne ponedeljek, 30. januar 2023 ob 14:04:47 CET je Arnd Bergmann napisal(a): > From: Arnd Bergmann <arnd@arndb.de> > > Selecting CONFIG_PM_GENERIC_DOMAINS without CONFIG_PM leads to a > build failure: > > WARNING: unmet direct dependencies detected for PM_GENERIC_DOMAINS > Depends on [n]: PM [=n] > Selected by [y]: > - SUN20I_PPU [=y] && (ARCH_SUNXI [=n] || COMPILE_TEST [=y]) > > drivers/base/power/domain_governor.c: In function 'default_suspend_ok': > drivers/base/power/domain_governor.c:85:24: error: 'struct dev_pm_info' has > no member named 'ignore_children' 85 | if > (!dev->power.ignore_children) > > | ^ > > drivers/base/power/domain.c: In function 'genpd_queue_power_off_work': > drivers/base/power/domain.c:657:20: error: 'pm_wq' undeclared (first use in > this function) 657 | queue_work(pm_wq, &genpd->power_off_work); > > | ^~~~~ > > Unfortunately platforms are inconsistent between using 'select PM' > and 'depends on PM' here. CONFIG_PM is a user-visible symbol, so > in principle we should be using 'depends on', but on the other hand > using 'select' here is more common among drivers/soc. Go with the > majority for now, as this has a smaller risk of introducing circular > dependencies. We may need to clean this up for consistency later. > > Fixes: 0e30ca5ab0a8 ("soc: sunxi: Add Allwinner D1 PPU driver") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Although, would it be better if commit in question is fixed and another PR is issued? That way we can avoid issue with broken config. Best regards, Jernej
On Mon, Jan 30, 2023, at 22:18, Jernej Škrabec wrote: > Dne ponedeljek, 30. januar 2023 ob 14:04:47 CET je Arnd Bergmann napisal(a): >> From: Arnd Bergmann <arnd@arndb.de> >> >> Selecting CONFIG_PM_GENERIC_DOMAINS without CONFIG_PM leads to a >> build failure: >> >> WARNING: unmet direct dependencies detected for PM_GENERIC_DOMAINS >> Depends on [n]: PM [=n] >> Selected by [y]: >> - SUN20I_PPU [=y] && (ARCH_SUNXI [=n] || COMPILE_TEST [=y]) >> >> drivers/base/power/domain_governor.c: In function 'default_suspend_ok': >> drivers/base/power/domain_governor.c:85:24: error: 'struct dev_pm_info' has >> no member named 'ignore_children' 85 | if >> (!dev->power.ignore_children) >> >> | ^ >> >> drivers/base/power/domain.c: In function 'genpd_queue_power_off_work': >> drivers/base/power/domain.c:657:20: error: 'pm_wq' undeclared (first use in >> this function) 657 | queue_work(pm_wq, &genpd->power_off_work); >> >> | ^~~~~ >> >> Unfortunately platforms are inconsistent between using 'select PM' >> and 'depends on PM' here. CONFIG_PM is a user-visible symbol, so >> in principle we should be using 'depends on', but on the other hand >> using 'select' here is more common among drivers/soc. Go with the >> majority for now, as this has a smaller risk of introducing circular >> dependencies. We may need to clean this up for consistency later. >> >> Fixes: 0e30ca5ab0a8 ("soc: sunxi: Add Allwinner D1 PPU driver") >> Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> > > Although, would it be better if commit in question is fixed and another PR is > issued? That way we can avoid issue with broken config. Agreed, merging it into the original commit would have been ideal. unfortunately the half of my brain that does the pull request didn't talk to the half that wrote the bugfix, so I already pulled it in after I sent the fix for linux-next... I'll just add the fix with your Ack on top then. Arnd
Hi-- On 1/30/23 05:04, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > Selecting CONFIG_PM_GENERIC_DOMAINS without CONFIG_PM leads to a > build failure: > > WARNING: unmet direct dependencies detected for PM_GENERIC_DOMAINS > Depends on [n]: PM [=n] > Selected by [y]: > - SUN20I_PPU [=y] && (ARCH_SUNXI [=n] || COMPILE_TEST [=y]) > > drivers/base/power/domain_governor.c: In function 'default_suspend_ok': > drivers/base/power/domain_governor.c:85:24: error: 'struct dev_pm_info' has no member named 'ignore_children' > 85 | if (!dev->power.ignore_children) > | ^ > drivers/base/power/domain.c: In function 'genpd_queue_power_off_work': > drivers/base/power/domain.c:657:20: error: 'pm_wq' undeclared (first use in this function) > 657 | queue_work(pm_wq, &genpd->power_off_work); > | ^~~~~ > > Unfortunately platforms are inconsistent between using 'select PM' > and 'depends on PM' here. CONFIG_PM is a user-visible symbol, so > in principle we should be using 'depends on', but on the other hand > using 'select' here is more common among drivers/soc. Go with the > majority for now, as this has a smaller risk of introducing circular > dependencies. We may need to clean this up for consistency later. > > Fixes: 0e30ca5ab0a8 ("soc: sunxi: Add Allwinner D1 PPU driver") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> With this patch (in linux-next-20230203), building on sparc32 with COMPILE_TEST=y and ARCH_SUNXI not set: WARNING: unmet direct dependencies detected for PM Depends on [n]: SPARC64 [=n] Selected by [y]: - SUN20I_PPU [=y] && (ARCH_SUNXI || COMPILE_TEST [=y]) WARNING: unmet direct dependencies detected for PM Depends on [n]: SPARC64 [=n] Selected by [y]: - SUN20I_PPU [=y] && (ARCH_SUNXI || COMPILE_TEST [=y]) WARNING: unmet direct dependencies detected for PM_GENERIC_DOMAINS Depends on [n]: SPARC64 [=n] && PM [=y] Selected by [y]: - QCOM_GDSC [=y] && COMMON_CLK [=y] && PM [=y] - SUN20I_PPU [=y] && (ARCH_SUNXI || COMPILE_TEST [=y]) - MESON_GX_PM_DOMAINS [=y] && (ARCH_MESON || COMPILE_TEST [=y]) && PM [=y] && OF [=y] - BCM2835_POWER [=y] && (ARCH_BCM2835 || COMPILE_TEST [=y] && OF [=y]) && PM [=y] - BCM_PMB [=y] && (ARCH_BCMBCA || COMPILE_TEST [=y] && OF [=y]) && PM [=y] - ROCKCHIP_PM_DOMAINS [=y] && (ARCH_ROCKCHIP || COMPILE_TEST [=y]) && PM [=y] Selected by [m]: - ARM_SCPI_POWER_DOMAIN [=m] && (ARM_SCPI_PROTOCOL [=m] || COMPILE_TEST [=y] && OF [=y]) && PM [=y] - MESON_EE_PM_DOMAINS [=m] && (ARCH_MESON || COMPILE_TEST [=y]) && PM [=y] && OF [=y] - QCOM_AOSS_QMP [=m] && (ARCH_QCOM || COMPILE_TEST [=y]) && MAILBOX [=y] && COMMON_CLK [=y] && PM [=y] WARNING: unmet direct dependencies detected for PM_GENERIC_DOMAINS_OF Depends on [n]: SPARC64 [=n] && PM_GENERIC_DOMAINS [=y] && OF [=y] Selected by [y]: - MESON_GX_PM_DOMAINS [=y] && (ARCH_MESON || COMPILE_TEST [=y]) && PM [=y] && OF [=y] Selected by [m]: - MESON_EE_PM_DOMAINS [=m] && (ARCH_MESON || COMPILE_TEST [=y]) && PM [=y] && OF [=y] Apparently sparc32 does not support PM (arch/sparc/Kconfig): if SPARC64 source "kernel/power/Kconfig" endif so I think that SUN20I_PPU should also depend on !SPARC32. Does that make sense? Thanks. > --- > drivers/soc/sunxi/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/soc/sunxi/Kconfig b/drivers/soc/sunxi/Kconfig > index 29e9ba2d520d..02d0b338feb3 100644 > --- a/drivers/soc/sunxi/Kconfig > +++ b/drivers/soc/sunxi/Kconfig > @@ -23,6 +23,7 @@ config SUNXI_SRAM > config SUN20I_PPU > bool "Allwinner D1 PPU power domain driver" > depends on ARCH_SUNXI || COMPILE_TEST > + select PM > select PM_GENERIC_DOMAINS > help > Say y to enable the PPU power domain driver. This saves power
On Sat, Feb 4, 2023, at 08:47, Randy Dunlap wrote: > On 1/30/23 05:04, Arnd Bergmann wrote: > > Apparently sparc32 does not support PM (arch/sparc/Kconfig): > > if SPARC64 > source "kernel/power/Kconfig" > endif > > so I think that SUN20I_PPU should also depend on !SPARC32. > Does that make sense? I would suggest working around this in arch/sparc/ instead of every driver that uses 'select PM', perhaps something like --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -283,7 +283,7 @@ config ARCH_FORCE_MAX_ORDER This config option is actually maximum order plus one. For example, a value of 13 means that the largest free memory block is 2^12 pages. -if SPARC64 +if SPARC64 || COMPILE_TEST source "kernel/power/Kconfig" endif The issue does not happen anywhere else, as it's fine if kernel/power/Kconfig is not included at all. I'm also not too worried about random sparc32 configs since it's pretty much impossible to build a sparc32 allmodconfig or randconfig, with all the other bugs that runs into. Arnd
On 2/4/23 02:38, Arnd Bergmann wrote: > On Sat, Feb 4, 2023, at 08:47, Randy Dunlap wrote: >> On 1/30/23 05:04, Arnd Bergmann wrote: >> >> Apparently sparc32 does not support PM (arch/sparc/Kconfig): >> >> if SPARC64 >> source "kernel/power/Kconfig" >> endif >> >> so I think that SUN20I_PPU should also depend on !SPARC32. >> Does that make sense? > > I would suggest working around this in arch/sparc/ instead > of every driver that uses 'select PM', perhaps something like > > --- a/arch/sparc/Kconfig > +++ b/arch/sparc/Kconfig > @@ -283,7 +283,7 @@ config ARCH_FORCE_MAX_ORDER > This config option is actually maximum order plus one. For example, > a value of 13 means that the largest free memory block is 2^12 pages. > > -if SPARC64 > +if SPARC64 || COMPILE_TEST > source "kernel/power/Kconfig" > endif > That looks good. Thanks. > The issue does not happen anywhere else, as it's fine if > kernel/power/Kconfig is not included at all. I'm also not too > worried about random sparc32 configs since it's pretty much impossible > to build a sparc32 allmodconfig or randconfig, with all the other > bugs that runs into. OK/ack.
diff --git a/drivers/soc/sunxi/Kconfig b/drivers/soc/sunxi/Kconfig index 29e9ba2d520d..02d0b338feb3 100644 --- a/drivers/soc/sunxi/Kconfig +++ b/drivers/soc/sunxi/Kconfig @@ -23,6 +23,7 @@ config SUNXI_SRAM config SUN20I_PPU bool "Allwinner D1 PPU power domain driver" depends on ARCH_SUNXI || COMPILE_TEST + select PM select PM_GENERIC_DOMAINS help Say y to enable the PPU power domain driver. This saves power