Archive-only list for patches
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Matthias Schiffer <matthias.schiffer@tq-group.com>,
	Alexander Stein <alexander.stein@ew.tq-group.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Sasha Levin <sashal@kernel.org>,
	aaro.koskinen@iki.fi, andreas@kemnade.info, rogerq@kernel.org,
	tony@atomide.com, linux-omap@vger.kernel.org
Subject: [PATCH AUTOSEL 6.18-5.10] ti-sysc: allow OMAP2 and OMAP4 timers to be reserved on AM33xx
Date: Tue,  9 Dec 2025 22:48:45 -0500	[thread overview]
Message-ID: <20251210034915.2268617-4-sashal@kernel.org> (raw)
In-Reply-To: <20251210034915.2268617-1-sashal@kernel.org>

From: Matthias Schiffer <matthias.schiffer@tq-group.com>

[ Upstream commit 3f61783920504b2cf99330b372d82914bb004d8e ]

am33xx.dtsi has the same clock setup as am35xx.dtsi, setting
ti,no-reset-on-init and ti,no-idle on timer1_target and timer2_target,
so AM33 needs the same workaround as AM35 to avoid ti-sysc probe
failing on certain target modules.

Signed-off-by: Matthias Schiffer <matthias.schiffer@tq-group.com>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/20250825131114.2206804-1-alexander.stein@ew.tq-group.com
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

# Commit Analysis: ti-sysc: allow OMAP2 and OMAP4 timers to be reserved
on AM33xx

## 1. Commit Message Analysis

**Subject/Body**: The commit addresses ti-sysc probe failures on AM33xx
platforms (commonly used in BeagleBone and industrial embedded systems).
The commit explains that AM33xx has the same clock setup as AM35xx (with
`ti,no-reset-on-init` and `ti,no-idle` on timer targets), so it needs
the same workaround.

**Notable absence**: No `Cc: stable@vger.kernel.org` or `Fixes:` tag.
The maintainers didn't explicitly mark this for stable backporting.

## 2. Code Change Analysis

The changes are minimal and well-contained:

1. **New enum value**: Adds `SOC_AM33` to `enum sysc_soc` at
   `drivers/bus/ti-sysc.c:51`
2. **SoC detection**: Adds `SOC_FLAG("AM33*", SOC_AM33)` to
   `sysc_soc_match[]`
3. **Logic extension in `sysc_check_active_timer()`**:
   - Converts if/else to switch statement
   - Adds `SOC_AM33` case alongside existing `SOC_3430` and `SOC_AM35`
     to return `-ENXIO`

**Technical mechanism**: When a timer has both
`SYSC_QUIRK_NO_RESET_ON_INIT` and `SYSC_QUIRK_NO_IDLE` quirks set
(indicating it's likely in use by the system timer driver), and the SoC
is AM33/AM35/3430, the function returns `-ENXIO` allowing the timer to
be "reserved" and preventing probe failure.

## 3. Classification

This falls under the **QUIRKS and WORKAROUNDS** exception category:
- Extends an existing hardware-specific workaround to similar hardware
- Fixes probe failures on real devices
- Follows an established pattern in the driver for handling SoC-specific
  timer behavior

## 4. Scope and Risk Assessment

**Size**: Very small (~20 lines, 1 file)
**Subsystem**: ti-sysc bus driver (OMAP/TI platform-specific)
**Complexity**: Low - straightforward extension of existing logic
**Risk**: Very low - only affects AM33xx platforms, doesn't change
behavior for any other SoC

The switch statement change is a cosmetic improvement that makes the
code cleaner while adding the new case.

## 5. User Impact

**Who is affected**: Users of AM33xx-based systems (BeagleBone Black,
industrial AM335x boards)
**Severity**: Probe failures prevent proper hardware initialization,
which can be significant for embedded systems
**Prevalence**: AM33xx is a widely-deployed platform

## 6. Stability Indicators

- Multiple signed-off-by tags (Matthias Schiffer, Alexander Stein, Kevin
  Hilman)
- Proper review via lore.kernel.org
- Follows established patterns in the codebase (SOC_AM35 workaround
  already existed)

## 7. Dependency Check

The commit is self-contained. The required infrastructure (SOC detection
mechanism, timer quirk handling) already exists in the driver. The only
addition is a new enum value and extending the switch case.

## Summary Assessment

**Pros**:
- Fixes real probe failures on commonly-used embedded platforms
- Very small, contained change with low regression risk
- Extends existing well-tested workaround to similar hardware
- Falls under the "quirks/workarounds" exception for stable

**Cons**:
- No explicit `Cc: stable` tag from maintainers
- No `Fixes:` tag to identify when the bug was introduced
- Adds new code (enum value) rather than purely fixing existing code

**Risk vs Benefit**: The risk is very low (only affects AM33xx
platforms, extends existing logic). The benefit is meaningful for AM33xx
users who would otherwise hit probe failures. This type of platform-
specific quirk extension is common and safe.

## Verdict

This is a small, well-contained fix that extends an existing hardware
workaround to similar hardware (AM33xx). While it lacks explicit stable
tags, it meets the criteria for the "quirks and workarounds" exception.
The fix prevents probe failures on a widely-used embedded platform with
minimal regression risk. The pattern of extending SoC-specific
workarounds to similar SoCs is well-established and safe.

**YES**

 drivers/bus/ti-sysc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 5566ad11399e7..610354ce7f8f0 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -48,6 +48,7 @@ enum sysc_soc {
 	SOC_UNKNOWN,
 	SOC_2420,
 	SOC_2430,
+	SOC_AM33,
 	SOC_3430,
 	SOC_AM35,
 	SOC_3630,
@@ -2912,6 +2913,7 @@ static void ti_sysc_idle(struct work_struct *work)
 static const struct soc_device_attribute sysc_soc_match[] = {
 	SOC_FLAG("OMAP242*", SOC_2420),
 	SOC_FLAG("OMAP243*", SOC_2430),
+	SOC_FLAG("AM33*", SOC_AM33),
 	SOC_FLAG("AM35*", SOC_AM35),
 	SOC_FLAG("OMAP3[45]*", SOC_3430),
 	SOC_FLAG("OMAP3[67]*", SOC_3630),
@@ -3117,10 +3119,15 @@ static int sysc_check_active_timer(struct sysc *ddata)
 	 * can be dropped if we stop supporting old beagleboard revisions
 	 * A to B4 at some point.
 	 */
-	if (sysc_soc->soc == SOC_3430 || sysc_soc->soc == SOC_AM35)
+	switch (sysc_soc->soc) {
+	case SOC_AM33:
+	case SOC_3430:
+	case SOC_AM35:
 		error = -ENXIO;
-	else
+		break;
+	default:
 		error = -EBUSY;
+	}
 
 	if ((ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT) &&
 	    (ddata->cfg.quirks & SYSC_QUIRK_NO_IDLE))
-- 
2.51.0


  parent reply	other threads:[~2025-12-10  3:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10  3:48 [PATCH AUTOSEL 6.18-6.17] functionfs: fix the open/removal races Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-5.10] scsi: qla2xxx: Use reinit_completion on mbx_intr_comp Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-5.10] via_wdt: fix critical boot hang due to unnamed resource allocation Sasha Levin
2025-12-10  3:48 ` Sasha Levin [this message]
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-5.15] scsi: qla2xxx: Fix lost interrupts with qlini_mode=disabled Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-6.12] exfat: zero out post-EOF page cache on file extension Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-6.12] scsi: smartpqi: Add support for Hurray Data new controller PCI device Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-6.12] scsi: ufs: host: mediatek: Fix shutdown/suspend race condition Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-5.10] powerpc/addnote: Fix overflow on 32-bit builds Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-6.6] fuse: Invalidate the page cache after FOPEN_DIRECT_IO write Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-5.10] ipmi: Fix __scan_channels() failing to rescan channels Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-5.10] scsi: qla2xxx: Fix initiator mode with qlini_mode=exclusive Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-6.17] um: init cpu_tasks[] earlier Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-5.10] reset: fix BIT macro reference Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-5.10] clk: mvebu: cp110 add CLK_IGNORE_UNUSED to pcie_x10, pcie_x11 & pcie_x4 Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-6.6] fuse: Always flush the page cache before FOPEN_DIRECT_IO write Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-5.10] firmware: imx: scu-irq: Init workqueue before request mbox channel Sasha Levin
2025-12-10  3:48 ` [PATCH AUTOSEL 6.18-6.17] scsi: lpfc: Fix reusing an ndlp that is marked NLP_DROPPED during FLOGI Sasha Levin
2025-12-10  3:49 ` [PATCH AUTOSEL 6.18-5.10] exfat: fix remount failure in different process environments Sasha Levin
2025-12-10  3:49 ` [PATCH AUTOSEL 6.18-5.10] ipmi: Fix the race between __scan_channels() and deliver_response() 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=20251210034915.2268617-4-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=aaro.koskinen@iki.fi \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=andreas@kemnade.info \
    --cc=khilman@baylibre.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=matthias.schiffer@tq-group.com \
    --cc=patches@lists.linux.dev \
    --cc=rogerq@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tony@atomide.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