public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: Thierry Reding <thierry.reding@kernel.org>
Cc: Jonathan Hunter <jonathanh@nvidia.com>,
	Linus Walleij <linusw@kernel.org>,
	Aaron Kling <webgeek1234@gmail.com>,
	Sasha Levin <sashal@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] soc/tegra: Add PM dependency to SOC_TEGRA_PMC Kconfig
Date: Sat, 25 Apr 2026 20:03:04 -0400	[thread overview]
Message-ID: <20260426000304.54912-1-sashal@kernel.org> (raw)

kconfiglint reports:

  K006: config SOC_TEGRA_PMC selects PM_GENERIC_DOMAINS which depends on PM,
        but SOC_TEGRA_PMC does not depend on PM

SOC_TEGRA_PMC is an internal bool symbol (no prompt) that is selected by
ARCH_TEGRA_*_SOC options to enable the Power Management Controller driver.
It was originally introduced in commit 5e7d4c652941 ("soc/tegra: Implement
Tegra186 PMC support") as a bare `bool` with no
selects of its own.

Over time, additional selects were added:
- Commit 5098e2b95e8e ("soc/tegra: pmc: Select GENERIC_PINCONF") added
  select GENERIC_PINCONF
- Commit 28dbe8231066 ("soc/tegra: pmc: Select IRQ_DOMAIN_HIERARCHY") added
  select IRQ_DOMAIN_HIERARCHY
- Commit f880ee9e9688 ("soc/tegra: pmc: Add core power domain") added select PM_OPP and select PM_GENERIC_DOMAINS to
  support core power domain voltage scaling

PM_GENERIC_DOMAINS is defined in kernel/power/Kconfig as:

  config PM_GENERIC_DOMAINS
      bool
      depends on PM

When commit f880ee9e9688 ("soc/tegra: pmc: Add core power domain") added
the select, it did not add a corresponding `depends on PM` to
SOC_TEGRA_PMC. This was not a functional problem because all callers of
SOC_TEGRA_PMC are inside `if ARCH_TEGRA` blocks, and both the ARM32
definition (arch/arm/mach-tegra/Kconfig) and the ARM64 definition
(arch/arm64/Kconfig.platforms) of ARCH_TEGRA select PM. Thus PM is always
enabled when SOC_TEGRA_PMC is selected in practice.

However, the dependency chain is implicit rather than explicit. Add
`depends on PM` to SOC_TEGRA_PMC to make the requirement explicit and
prevent a theoretical misconfiguration if SOC_TEGRA_PMC were ever selected
outside the ARCH_TEGRA context.

Assisted-by: Claude:claude-opus-4-6 kconfiglint
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/soc/tegra/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/tegra/Kconfig b/drivers/soc/tegra/Kconfig
index 073346c1542ba..8b6fdb9ad1ea3 100644
--- a/drivers/soc/tegra/Kconfig
+++ b/drivers/soc/tegra/Kconfig
@@ -171,6 +171,7 @@ config SOC_TEGRA_FLOWCTRL
 
 config SOC_TEGRA_PMC
 	bool
+	depends on PM
 	select GENERIC_PINCONF
 	select IRQ_DOMAIN_HIERARCHY
 	select PM_OPP
-- 
2.53.0


                 reply	other threads:[~2026-04-26  0:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260426000304.54912-1-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@kernel.org \
    --cc=webgeek1234@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox