Re: [PATCH] reset: Remove ARCH_HAS_RESET_CONTROLLER Kconfig symbol

From: Andrew Davis

Date: Fri Nov 13 2026 - 14:24:39 EST


On 11/13/26 9:22 AM, Philipp Zabel wrote:
On Do, 2026-11-12 at 15:42 -0600, Andrew Davis wrote:
Many ARCH_HAS_* symbols change some behavior based on what an ARCH
supports, but ARCH_HAS_RESET_CONTROLLER is used only to set a default
for RESET_CONTROLLER. Those ARCH symbols that select this can skip the
middleman and directly select RESET_CONTROLLER, and many already do.

Replace all selection of this symbol with a direct selection of
RESET_CONTROLLER when it is not already in the selection list. In the
latter case when RESET_CONTROLLER is also already selected we can simply

"In the latter case" and "when RESET_CONTROLLER is also already
selected" are saying the same thing. I'd choose one and drop the other.


Sure, it is a little long winded, will clean that up.

remove the ARCH_HAS_RESET_CONTROLLER without changing existing behavior.

Some ARCHs "select" this symbol when they actually "depend on" the
RESET_CONTROLLER framework to build, in those cases the indirect select
could lead to broken randconfig builds. In cases when it is not needed
for building the ARCH code, these selections can be switched to the weaker
"imply" to allow it deselected for minimal builds without reset support.

Can't it just be dropped completely for those? See for example mach-
gemini below.


Yes, in some of these cases it wasn't needed and can be dropped such
as the mach-gemini case you point out. But my intention here was to
mechanical and not make any functional changes, going back and cleaning
up cases when it wasn't needed in the first place would come next.

Take the ARCH_BRCMSTB case, nothing in its arch code needs RESET_CONTROLLER
but if we remove that select, then nothing else selects RESET_CONTROLLER and
RESET_BRCMSTB is no longer enabled, when before it would have been enabled
by simply selecting ARCH_BRCMSTB.

Not saying that was correct behavior before either, but at least this patch
doesn't change any current default behavior and allows us to start to clean
some more odd cases.

Andrew

Additional checking will be needed to find such cases.

Signed-off-by: Andrew Davis <afd@xxxxxx>
---
arch/arm/Kconfig | 2 +-
arch/arm/Kconfig.platforms | 1 -
arch/arm/mach-bcm/Kconfig | 4 ++--
arch/arm/mach-berlin/Kconfig | 2 +-
arch/arm/mach-ep93xx/Kconfig | 2 +-
arch/arm/mach-gemini/Kconfig | 2 +-
arch/arm/mach-imx/Kconfig | 2 +-
arch/arm/mach-keystone/Kconfig | 2 +-
arch/arm/mach-mmp/Kconfig | 6 +++---
arch/arm/mach-omap2/Kconfig | 1 -
arch/arm/mach-rockchip/Kconfig | 2 +-
arch/arm/mach-socfpga/Kconfig | 1 -
arch/arm/mach-sti/Kconfig | 1 -
arch/arm/mach-stm32/Kconfig | 1 -
arch/arm/mach-sunxi/Kconfig | 1 -
arch/arm/mach-tegra/Kconfig | 1 -
arch/arm/mach-zynq/Kconfig | 2 +-
arch/arm64/Kconfig.platforms | 9 +++------
arch/mips/Kconfig | 6 ++----
arch/riscv/Kconfig.socs | 2 +-
drivers/reset/Kconfig | 4 ----
21 files changed, 19 insertions(+), 35 deletions(-)

[...]
diff --git a/arch/arm/mach-gemini/Kconfig b/arch/arm/mach-gemini/Kconfig
index f436a2009eca3..11e0e966c3bb6 100644
--- a/arch/arm/mach-gemini/Kconfig
+++ b/arch/arm/mach-gemini/Kconfig
@@ -3,7 +3,7 @@ menuconfig ARCH_GEMINI
bool "Cortina Systems Gemini"
depends on ARCH_MULTI_V4
depends on CPU_LITTLE_ENDIAN
- select ARCH_HAS_RESET_CONTROLLER
+ select RESET_CONTROLLER

I don't think this is required. There is no reset controller
implementation in arch/arm/mach-gemini ...

select ARM_AMBA
select ARM_APPENDED_DTB # Old Redboot bootloaders deployed
select COMMON_CLK_GEMINI

... and COMMON_CLK_GEMINI already selects RESET_CONTROLLER in
drivers/clk/Kconfig.


regards
Philipp