diff mbox

[-next] imx7: fix Kconfig warning and build errors

Message ID 47fc2167-bf0a-866a-e075-8247a10aa6e0@infradead.org (mailing list archive)
State New, archived
Headers show

Commit Message

Randy Dunlap April 12, 2017, 6:22 p.m. UTC
From: Randy Dunlap <rdunlap@infradead.org>

Fix Kconfig warning in drivers/soc/imx/Kconfig and subsequent build errors
elsewhere when CONFIG_PM is not enabled.

warning: (IMX7_PM_DOMAINS) selects PM_GENERIC_DOMAINS which has unmet direct dependencies (PM)

This warning causes multiple build errors in drivers/base/power/domain.c:

../drivers/base/power/domain.c: In function 'genpd_queue_power_off_work':
../drivers/base/power/domain.c:279:13: error: 'pm_wq' undeclared (first use in this function)
  queue_work(pm_wq, &genpd->power_off_work);
../drivers/base/power/domain.c: In function 'genpd_dev_pm_qos_notifier':
../drivers/base/power/domain.c:462:25: error: 'struct dev_pm_info' has no member named 'ignore_children'
   if (!dev || dev->power.ignore_children)
../drivers/base/power/domain.c: In function 'rtpm_status_str':
../drivers/base/power/domain.c:2207:16: error: 'struct dev_pm_info' has no member named 'runtime_error'
  if (dev->power.runtime_error)
../drivers/base/power/domain.c:2209:21: error: 'struct dev_pm_info' has no member named 'disable_depth'
  else if (dev->power.disable_depth)
../drivers/base/power/domain.c:2211:21: error: 'struct dev_pm_info' has no member named 'runtime_status'
  else if (dev->power.runtime_status < ARRAY_SIZE(status_lookup))
   p = status_lookup[dev->power.runtime_status];

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc:	Shawn Guo <shawnguo@kernel.org>
Cc:	Sascha Hauer <kernel@pengutronix.de>
Cc:	Fabio Estevam <fabio.estevam@nxp.com>
Cc:	linux-arm-kernel@lists.infradead.org
---
 drivers/soc/imx/Kconfig |    1 +
 1 file changed, 1 insertion(+)

Comments

Fabio Estevam April 12, 2017, 6:26 p.m. UTC | #1
On Wed, Apr 12, 2017 at 3:22 PM, Randy Dunlap <rdunlap@infradead.org> wrote:

> --- linux-next-20170412.orig/drivers/soc/imx/Kconfig
> +++ linux-next-20170412/drivers/soc/imx/Kconfig
> @@ -2,6 +2,7 @@ menu "i.MX SoC drivers"
>
>  config IMX7_PM_DOMAINS
>         bool "i.MX7 PM domains"
> +       depends on PM
>         select PM_GENERIC_DOMAINS

Could this be:

select PM_GENERIC_DOMAINS if PM instead?
Randy Dunlap April 12, 2017, 7:24 p.m. UTC | #2
On 04/12/17 11:26, Fabio Estevam wrote:
> On Wed, Apr 12, 2017 at 3:22 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> 
>> --- linux-next-20170412.orig/drivers/soc/imx/Kconfig
>> +++ linux-next-20170412/drivers/soc/imx/Kconfig
>> @@ -2,6 +2,7 @@ menu "i.MX SoC drivers"
>>
>>  config IMX7_PM_DOMAINS
>>         bool "i.MX7 PM domains"
>> +       depends on PM
>>         select PM_GENERIC_DOMAINS
> 
> Could this be:
> 
> select PM_GENERIC_DOMAINS if PM instead?
> 

You want IMX7_PM_DOMAINS to be built without having
PM_GENERIC_DOMAINS enabled?

On x86, your suggestion works for me... because of this
in drivers/soc/Makefile:

obj-$(CONFIG_ARCH_MXC)		+= imx/

and I don't have CONFIG_ARCH_MXC, so the gpc* binaries are
not being built at all.  This might be a small bug.
Fabio Estevam April 12, 2017, 7:55 p.m. UTC | #3
On Wed, Apr 12, 2017 at 4:24 PM, Randy Dunlap <rdunlap@infradead.org> wrote:

> You want IMX7_PM_DOMAINS to be built without having
> PM_GENERIC_DOMAINS enabled?
>
> On x86, your suggestion works for me... because of this
> in drivers/soc/Makefile:
>
> obj-$(CONFIG_ARCH_MXC)          += imx/
>
> and I don't have CONFIG_ARCH_MXC, so the gpc* binaries are
> not being built at all.  This might be a small bug.

Just tested your patch with imx_v6_v7_defconfig + manually doing
CONFIG_PM=n  and it does fix the build error, thanks:

Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
diff mbox

Patch

--- linux-next-20170412.orig/drivers/soc/imx/Kconfig
+++ linux-next-20170412/drivers/soc/imx/Kconfig
@@ -2,6 +2,7 @@  menu "i.MX SoC drivers"
 
 config IMX7_PM_DOMAINS
 	bool "i.MX7 PM domains"
+	depends on PM
 	select PM_GENERIC_DOMAINS
 	depends on SOC_IMX7D || (COMPILE_TEST && OF)
 	default y if SOC_IMX7D