public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Sasha Levin <sashal@kernel.org>,
	tglx@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH AUTOSEL 6.19-5.10] clocksource/drivers/timer-integrator-ap: Add missing Kconfig dependency on OF
Date: Wed, 11 Feb 2026 20:09:38 -0500	[thread overview]
Message-ID: <20260212010955.3480391-15-sashal@kernel.org> (raw)
In-Reply-To: <20260212010955.3480391-1-sashal@kernel.org>

From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

[ Upstream commit 2246464821e2820572e6feefca2029f17629cc50 ]

This driver accesses the of_aliases global variable declared in
linux/of.h and defined in drivers/base/of.c. It requires OF support or
will cause a link failure. Add the missing Kconfig dependency.

Closes: https://lore.kernel.org/oe-kbuild-all/202601152233.og6LdeUo-lkp@intel.com/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://patch.msgid.link/20260116111723.10585-1-bartosz.golaszewski@oss.qualcomm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

The key observation is that the `extern` declarations for `of_root`,
`of_chosen`, `of_aliases`, `of_stdout` at lines 141-144 are **outside
any `#ifdef CONFIG_OF`** guard. They are visible regardless of
CONFIG_OF. But the actual definition of `of_aliases` only exists in
`drivers/of/base.c` which is only compiled when `CONFIG_OF=y`.

This means:
1. When `CONFIG_OF=n` and `CONFIG_COMPILE_TEST=y`, the
   `INTEGRATOR_AP_TIMER` config can be enabled
2. The driver compiles fine (the extern declaration is visible)
3. But at link time, there is no definition for `of_aliases` → **linker
   error**

## Summary of Analysis

**Commit:** Adds `depends on OF` to `INTEGRATOR_AP_TIMER` Kconfig
option.

### 1. What Problem Does It Fix?

This is a **build fix** — it prevents a **link failure** when
`CONFIG_INTEGRATOR_AP_TIMER=y` with `CONFIG_COMPILE_TEST=y` but
`CONFIG_OF=n`. The driver `timer-integrator-ap.c` directly references
the global variable `of_aliases` (at lines 181 and 201), which is
defined in `drivers/of/base.c`. That file is only compiled when
`CONFIG_OF=y` (per `drivers/Makefile`: `obj-$(CONFIG_OF) += of/`).
Without `depends on OF`, the Kconfig allows enabling the driver in
configurations where OF is disabled, causing an unresolved symbol at
link time.

This was reported by Intel's kbuild test robot (automated build
testing), confirming it's a real, reproducible build failure.

### 2. Stable Kernel Rules Assessment

- **Obviously correct and tested**: Yes. It's a one-line Kconfig
  dependency addition. The driver uses `of_aliases` and multiple OF APIs
  (`of_io_request_and_map`, `of_clk_get`, `of_property_read_string`,
  `of_find_node_by_path`, `of_node_put`, `irq_of_parse_and_map`,
  `TIMER_OF_DECLARE`). It clearly requires `CONFIG_OF`.
- **Fixes a real bug**: Yes — a link failure preventing kernel
  compilation in certain configurations.
- **Fixes an important issue**: Build fixes are explicitly listed as
  backport-worthy in the stable rules. A link error prevents anyone from
  building the kernel with that configuration.
- **Small and contained**: Yes — single line addition to a Kconfig file.
  Zero risk of runtime regression.
- **No new features**: Correct — this only adds a constraint on when the
  driver can be selected.

### 3. Risk vs Benefit

- **Risk**: Essentially zero. Adding a Kconfig `depends on OF` only
  narrows the set of configurations where this driver can be enabled.
  Since the driver fundamentally requires OF to work (it uses OF APIs
  throughout), this is purely corrective. No runtime behavior changes.
- **Benefit**: Fixes a real build failure that prevents kernel
  compilation.

### 4. Scope

- **One line changed** in `drivers/clocksource/Kconfig`
- **One file affected**
- No code logic changes, no runtime impact

### 5. Affected Versions

The bug has existed since commit `568c0342e494` (June 2016, v4.8 cycle)
when `COMPILE_TEST` was added to `INTEGRATOR_AP_TIMER`. All current
stable trees (5.4.y through 6.12.y) are affected and the patch applies
cleanly since the surrounding Kconfig hasn't changed.

### 6. Dependencies

None. This is completely self-contained.

### 7. Classification

This is a **build fix** — one of the explicitly listed categories for
stable backporting. Build fixes are critical because they affect anyone
who needs to compile the kernel with a particular configuration. Even
though this specific configuration (COMPILE_TEST=y, OF=n) may not be
common for production kernels (since the Integrator/AP platform always
has OF), it matters for:
- Automated build testing infrastructure (like Intel's kbuild)
- Distributions running `make allmodconfig` / `make allyesconfig`
  testing
- Developers using COMPILE_TEST for coverage

The fix is small, surgical, zero-risk, and meets all stable kernel
criteria perfectly.

**YES**

 drivers/clocksource/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index aa59e5b133510..fd91127065454 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -254,6 +254,7 @@ config KEYSTONE_TIMER
 
 config INTEGRATOR_AP_TIMER
 	bool "Integrator-AP timer driver" if COMPILE_TEST
+	depends on OF
 	select CLKSRC_MMIO
 	help
 	  Enables support for the Integrator-AP timer.
-- 
2.51.0


  parent reply	other threads:[~2026-02-12  1:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12  1:09 [PATCH AUTOSEL 6.19-5.10] clocksource/drivers/sh_tmu: Always leave device running after probe Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.18] gendwarfksyms: Fix build on 32-bit hosts Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.18] arm64/ftrace,bpf: Fix partial regs after bpf_prog_run Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.18] bpftool: Fix dependencies for static build Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.12] perf/x86/msr: Add Airmont NP Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.18] genirq/cpuhotplug: Notify about affinity changes breaking the affinity mask Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-5.15] char: tpm: cr50: Remove IRQF_ONESHOT Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.6] crypto: hisilicon/qm - move the barrier before writing to the mailbox register Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.12] sched/debug: Fix updating of ppos on server write ops Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.18] perf/x86/intel: Add Airmont NP Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.18] bpf: Properly mark live registers for indirect jumps Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-5.10] mailbox: bcm-ferxrm-mailbox: Use default primary handler Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.18] perf/core: Fix slow perf_event_task_exit() with LBR callstacks Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.12] perf/x86/cstate: Add Airmont NP Sasha Levin
2026-02-12  1:09 ` Sasha Levin [this message]
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-5.10] bpf: verifier improvement in 32bit shift sign extension pattern Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.12] bpf: Recognize special arithmetic shift in the verifier Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.12] bpf: crypto: Use the correct destructor kfunc type Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-5.10] pstore: ram_core: fix incorrect success return when vmap() fails Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.18] bpf: net_sched: Use the correct destructor kfunc type Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.18] irqchip/riscv-imsic: Add a CPU pm notifier to restore the IMSIC on exit Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.1] PCI/MSI: Unmap MSI-X region on error Sasha Levin
2026-02-12  1:09 ` [PATCH AUTOSEL 6.19-6.18] rust: sync: Implement Unpin for ARef Sasha Levin
2026-02-12 12:11   ` Miguel Ojeda
2026-02-26 13:45     ` Sasha Levin

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=20260212010955.3480391-15-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=tglx@kernel.org \
    /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