Linux USB
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Christian Marangi <ansuelsmth@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sasha Levin <sashal@kernel.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH AUTOSEL 6.18-5.10] usb: host: add ARCH_AIROHA in XHCI MTK dependency
Date: Mon, 31 Aug 2026 09:29:39 -0400	[thread overview]
Message-ID: <20260831133314.4125787-551-sashal@kernel.org> (raw)
In-Reply-To: <20260831133314.4125787-1-sashal@kernel.org>

From: Christian Marangi <ansuelsmth@gmail.com>

[ Upstream commit ffeaf31f05d664581aa436d9cb92b4d1d8d301ce ]

Airoha SoC use the same register map and logic of the Mediatek xHCI
driver, hence add it to the dependency list to permit compilation also
on this ARCH.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://patch.msgid.link/20260519164903.31258-1-ansuelsmth@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

# Stable Backport Analysis: `usb: host: add ARCH_AIROHA in XHCI MTK
dependency`

## PHASE 1: COMMIT MESSAGE FORENSICS

### Step 1.1: Parse the Subject Line
**Record:** `[usb: host]` `[add]` — Add `ARCH_AIROHA` to the Kconfig
dependency list for `USB_XHCI_MTK` so the MediaTek xHCI driver can be
selected when building for Airoha SoCs.

### Step 1.2: Parse All Commit Message Tags
**Record:**
- **Signed-off-by:** Christian Marangi `<ansuelsmth@gmail.com>` (author)
- **Link:**
  https://patch.msgid.link/20260519164903.31258-1-ansuelsmth@gmail.com
- **Signed-off-by:** Greg Kroah-Hartman `<gregkh@linuxfoundation.org>`
  (USB maintainer acceptance)
- No `Fixes:`, `Reported-by:`, `Tested-by:`, `Reviewed-by:`, `Acked-
  by:`, or `Cc: stable@vger.kernel.org`
- Notable: USB maintainer sign-off; no bug report or syzbot involvement

### Step 1.3: Analyze Commit Body
**Record:**
- **Bug described:** Airoha SoCs reuse the MediaTek xHCI register map
  and logic, but `USB_XHCI_MTK` Kconfig does not list `ARCH_AIROHA` in
  its `depends on`, so the driver cannot be enabled on Airoha platform
  builds.
- **Symptom:** Kconfig hides/unselectable `CONFIG_USB_XHCI_MTK` when
  `CONFIG_ARCH_AIROHA=y`; kernel builds for Airoha cannot compile in the
  xhci-mtk driver without `COMPILE_TEST` workarounds.
- **Version info:** None stated.
- **Root cause:** Kconfig dependency oversight — platform added without
  updating all reused Mediatek IP driver dependencies.

### Step 1.4: Detect Hidden Bug Fixes
**Record:** Not disguised as cleanup. This is an explicit
**Kconfig/build dependency fix**. It falls under the stable “build fix”
exception category rather than a runtime crash fix.

---

## PHASE 2: DIFF ANALYSIS

### Step 2.1: Inventory the Changes
**Record:**
- **Files:** `drivers/usb/host/Kconfig` — 1 line changed (+1 token in
  `depends on`)
- **Functions modified:** None (Kconfig only)
- **Scope:** Single-file, surgical Kconfig change

### Step 2.2: Code Flow Change
**Record:**
- **Hunk (USB_XHCI_MTK depends):**
  - **Before:** `depends on (MIPS && SOC_MT7621) || ARCH_MEDIATEK ||
    COMPILE_TEST`
  - **After:** `depends on (MIPS && SOC_MT7621) || ARCH_MEDIATEK ||
    ARCH_AIROHA || COMPILE_TEST`
  - **Path affected:** Kernel configuration time only; no runtime code
    path changes.

### Step 2.3: Bug Mechanism
**Record:**
- **Category:** Build/configuration fix (Kconfig dependency)
- **Mechanism:** `ARCH_AIROHA` builds satisfy none of the original
  dependencies (unless `COMPILE_TEST`), so `USB_XHCI_MTK` is
  unavailable. Adding `ARCH_AIROHA` aligns this driver with other
  Mediatek-derived drivers already enabled for Airoha (PCIe, pinctrl,
  clk, gpio, ethernet, etc.).

### Step 2.4: Fix Quality Assessment
**Record:**
- **Quality:** Obviously correct; mirrors the established pattern used
  for `PCIE_MEDIATEK` (`b3b76fc86f0fb`, 2022).
- **Regression risk:** Very low — only makes an existing tristate option
  visible/selectable on `ARCH_AIROHA`; does not auto-enable anything.
- **Red flags:** None.

---

## PHASE 3: GIT HISTORY INVESTIGATION

### Step 3.1: Blame the Changed Lines
**Record:**
- `USB_XHCI_MTK` `depends on` line introduced by John Crispin,
  2016-12-20 (`808cf33d4817c7`), as `(MIPS && SOC_MT7621) ||
  ARCH_MEDIATEK || COMPILE_TEST`.
- `ARCH_AIROHA` added to this tree in `428ae88ef519f` (merged May 2024):
  “arm64: add Airoha EN7581 platform”.
- **Bug introduced:** When `ARCH_AIROHA` was added (~6.9 timeframe);
  xhci-mtk dependency was never updated.

### Step 3.2: Follow Fixes Tag
**Record:** No `Fixes:` tag present. N/A.

### Step 3.3: Related File History
**Record:**
- `git log -S'ARCH_AIROHA' -- drivers/usb/host/Kconfig` returns empty —
  `ARCH_AIROHA` was never added to this file.
- Precedent: `b3b76fc86f0fb` “PCI: mediatek: Allow building for
  ARCH_AIROHA” — identical rationale and pattern.
- Standalone one-commit fix; not part of a series.

### Step 3.4: Author's Other Commits
**Record:** Christian Marangi is an active Airoha/Mediatek platform
contributor (net/airoha fixes visible in tree). This patch is consistent
with ongoing Airoha platform enablement work.

### Step 3.5: Prerequisites
**Record:**
- **Requires:** `ARCH_AIROHA` Kconfig symbol — **present** in this tree
  (`arch/arm64/Kconfig.platforms`, `arch/arm/Kconfig.platforms`).
- **Requires:** `USB_XHCI_MTK` driver — **present**
  (`drivers/usb/host/xhci-mtk.c`).
- **Standalone:** Yes; no other commits required.

---

## PHASE 4: MAILING LIST AND EXTERNAL RESEARCH

### Step 4.1: Original Patch Discussion
**Record:** `b4 dig -c <commit>` could not be run (commit not in local
tree). Lore fetch blocked (403/Anubis bot protection). Link tag points
to linux-usb list submission from 2026-05-19. **UNVERIFIED:** Full
review thread content.

### Step 4.2: Reviewers
**Record:** Greg Kroah-Hartman Signed-off-by confirms USB maintainer
acceptance. **UNVERIFIED:** Full recipient list via `b4 dig -w`.

### Step 4.3: Bug Report
**Record:** No external bug report referenced. Issue inferred from
platform/Kconfig mismatch.

### Step 4.4: Related Patches/Series
**Record:** Part of broader Airoha platform enablement; similar Kconfig
updates already landed for PCIe, pinctrl, clk, gpio, ethernet, etc. No
multi-patch series dependency.

### Step 4.5: Stable Mailing List
**Record:** **UNVERIFIED** — could not search lore stable list due to
access restrictions.

---

## PHASE 5: CODE SEMANTIC ANALYSIS

### Step 5.1: Key Functions Modified
**Record:** None — Kconfig symbol `USB_XHCI_MTK` dependency only.

### Step 5.2: Callers
**Record:** Kconfig evaluated at build configuration time. `xhci-mtk`
driver probe is triggered by device tree `compatible = "mediatek,mtk-
xhci"` (and variants) via `xhci-mtk.c` platform driver table. No Airoha
USB DT nodes in mainline DTS yet, but en7581 reset/clock bindings
include USB host reset lines (`EN7581_USB_HOST_P0_RST`, etc.).

### Step 5.3: Callees
**Record:** N/A for Kconfig change.

### Step 5.4: Call Chain / Reachability
**Record:** Affects developers/distro builders configuring kernels with
`CONFIG_ARCH_AIROHA=y`. Not a userspace-triggerable runtime bug, but
blocks building USB host support for Airoha hardware using the existing
xhci-mtk driver.

### Step 5.5: Similar Patterns
**Record:** Multiple drivers in this tree already use `ARCH_AIROHA` in
Kconfig:
- `drivers/pci/controller/Kconfig` — `PCIE_MEDIATEK`,
  `PCIE_MEDIATEK_GEN3`
- `drivers/pinctrl/mediatek/Kconfig`
- `drivers/clk/Kconfig`
- `drivers/gpio/Kconfig`
- `drivers/net/ethernet/mediatek/Kconfig`
- `drivers/net/ethernet/airoha/Kconfig`
USB xhci-mtk is the outlier missing this dependency.

---

## PHASE 6: CROSS-REFERENCING AGAINST LOCAL TREE

### Step 6.1: Does the Buggy Code Exist?
**Record:** **YES.** Local tree is **v6.18.44** (`VERSION=6`,
`PATCHLEVEL=18`, `SUBLEVEL=44`). Current `drivers/usb/host/Kconfig` line
74:

```74:74:drivers/usb/host/Kconfig
        depends on (MIPS && SOC_MT7621) || ARCH_MEDIATEK || COMPILE_TEST
```

`ARCH_AIROHA` is enabled in `arch/arm64/configs/defconfig` (line 37).
The commit under review is **not yet applied** to this tree.

### Step 6.2: Backport Complications
**Record:** `git apply --check` confirms the patch applies **cleanly**
to the local tree. No conflicts expected.

### Step 6.3: Related Fixes Already Present?
**Record:** `PCIE_MEDIATEK` ARCH_AIROHA dependency fix (`b3b76fc86f0fb`)
is already in tree. No duplicate xhci-mtk ARCH_AIROHA fix found.

---

## PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT

### Step 7.1: Subsystem Criticality
**Record:** **drivers/usb/host** — IMPORTANT (USB host support), but fix
is config-only for a platform-specific (Airoha) subset.

### Step 7.2: Subsystem Activity
**Record:** xhci-mtk actively maintained (recent fixes in 2024–2025 for
isoc/split scheduling). Airoha platform actively developed since 2024.

---

## PHASE 8: IMPACT AND RISK ASSESSMENT

### Step 8.1: Who Is Affected
**Record:** **Platform-specific** — kernel builders and users of Airoha
EN7581/EN7523 SoCs (routers/embedded). `CONFIG_ARCH_AIROHA=y` is in
arm64 defconfig.

### Step 8.2: Trigger Conditions
**Record:** Building a kernel with `CONFIG_ARCH_AIROHA=y` and attempting
to enable `CONFIG_USB_XHCI_MTK`. Common for platform bring-up; not
triggered by unprivileged users at runtime.

### Step 8.3: Failure Mode Severity
**Record:** **Build/configuration failure** — cannot select/build xhci-
mtk for Airoha. Severity: **LOW** for general users, **MEDIUM** for
Airoha platform developers. Not a crash, security issue, or data
corruption.

### Step 8.4: Risk-Benefit Ratio
**Record:**
- **Benefit:** Unblocks USB host driver compilation for Airoha;
  completes Kconfig parity with other Mediatek-IP drivers; zero-cost for
  non-Airoha users.
- **Risk:** Minimal — one Kconfig token, no code change, no behavior
  change unless user explicitly enables the option.
- **Ratio:** Favorable for Airoha platform support in a tree that
  already ships `ARCH_AIROHA`.

---

## PHASE 9: FINAL SYNTHESIS

### Step 9.1: Evidence Summary

**FOR backport:**
- Real Kconfig bug in v6.18.44 — `ARCH_AIROHA` present but xhci-mtk
  dependency missing
- Build-fix exception explicitly covers Kconfig dependency fixes
- 1-line, obviously correct, applies cleanly
- Identical precedent already in tree (`PCIE_MEDIATEK` + `ARCH_AIROHA`)
- USB maintainer (Greg K-H) sign-off
- Airoha hardware has USB-related reset/clock infrastructure in tree
- Many sibling Mediatek drivers already include `ARCH_AIROHA`

**AGAINST backport:**
- No runtime crash or security impact
- No USB device-tree nodes for Airoha in mainline yet — limited
  immediate user impact
- Niche embedded platform
- No explicit bug report or stable nomination found

**UNRESOLVED:**
- Full mailing list review thread (lore access blocked)
- Whether stable maintainers already discussed this

### Step 9.2: Stable Rules Checklist
1. Obviously correct and tested? **PASS** — trivial Kconfig alignment;
   Greg K-H SOB
2. Fixes a real bug affecting users? **PASS** — real Kconfig/build
   blocker for Airoha builders
3. Important issue? **PASS (borderline)** — build fix for platform
   already in tree; not crash-level but blocks hardware enablement
4. Small and contained? **PASS** — 1 line, 1 file
5. No new features or APIs? **PASS** — exposes existing driver to
   existing arch; no new code
6. Can apply to local tree? **PASS** — applies cleanly; all
   prerequisites present

### Step 9.3: Exception Category
**Record:** **BUILD FIX** — Kconfig dependency correction to permit
compilation on `ARCH_AIROHA`.

### Step 9.4: Decision Rationale
This tree (v6.18.44) already supports `ARCH_AIROHA` in defconfig and has
extensive Airoha platform infrastructure, including Mediatek-derived
PCIe, clock, pinctrl, and ethernet drivers with `ARCH_AIROHA`
dependencies. The xhci-mtk Kconfig omission is a clear oversight that
prevents building USB host support on this platform using the existing
driver — the same class of fix that was backported for `PCIE_MEDIATEK`
years ago. The change is minimal, zero-risk at runtime, and directly
relevant to this tree.

---

## Verification

- **[Phase 1]** Parsed commit message and tags from user-provided diff
- **[Phase 1]** Confirmed no `Fixes:`, `Reported-by:`, syzbot, or stable
  tags
- **[Phase 2]** Verified diff is 1-line Kconfig change in `USB_XHCI_MTK
  depends on`
- **[Phase 3]** `git describe HEAD` → v6.18.44; `make kernelversion`
  equivalent via Makefile → 6.18.44
- **[Phase 3]** `git blame -L 71,78 drivers/usb/host/Kconfig` → depends
  line from 2016; never updated for Airoha
- **[Phase 3]** `git log --oneline -1 428ae88ef519f` → ARCH_AIROHA added
  March 2024, merged May 2024
- **[Phase 3]** `git show b3b76fc86f0fb` → PCI mediatek ARCH_AIROHA
  precedent confirmed
- **[Phase 3]** `git log -S'ARCH_AIROHA' -- drivers/usb/host/Kconfig` →
  empty (fix not present)
- **[Phase 4]** `b4 dig` requires commit in tree — not usable;
  **UNVERIFIED** lore thread
- **[Phase 4]** WebFetch/curl to lore → blocked (403/Anubis)
- **[Phase 5]** `grep ARCH_AIROHA drivers/*/Kconfig` → 15+ drivers
  already include ARCH_AIROHA; USB_XHCI_MTK does not
- **[Phase 5]** Read `drivers/usb/host/xhci-mtk.c` compatible table —
  uses `mediatek,mtk-xhci` variants
- **[Phase 5]** Read `en7581.dtsi` — no USB nodes yet; reset headers
  include USB host resets
- **[Phase 6]** Read current `drivers/usb/host/Kconfig` line 74 —
  missing ARCH_AIROHA
- **[Phase 6]** `grep ARCH_AIROHA arch/arm64/configs/defconfig` →
  CONFIG_ARCH_AIROHA=y
- **[Phase 6]** `git apply --check` with provided diff → applies cleanly
  (exit 0)
- **[Phase 6]** `grep PCIE_MEDIATEK arch/arm64/configs/defconfig` →
  CONFIG_PCIE_MEDIATEK_GEN3=m (Airoha PCIe already enabled)
- **[Phase 8]** Failure mode: Kconfig unselectable driver on ARCH_AIROHA
  builds; severity LOW-MEDIUM

**YES**The background git search finished: the commit isn’t in this tree
yet — no matches for the subject, “XHCI MTK dependency,” or Christian
Marangi changes under `drivers/usb/host/Kconfig`.

That matches what we already saw: `drivers/usb/host/Kconfig` still lacks
`ARCH_AIROHA` in the `USB_XHCI_MTK` dependency, and the patch applies
cleanly to v6.18.44.

**Verdict for this tree: YES** — one-line Kconfig build fix so Airoha
builds can enable the existing xhci-mtk driver, same pattern as the PCI
Mediatek `ARCH_AIROHA` dependency fix already in tree.

 drivers/usb/host/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index c4f17ce5c77b1..87103b868032d 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -71,7 +71,7 @@ config USB_XHCI_HISTB
 config USB_XHCI_MTK
 	tristate "xHCI support for MediaTek SoCs"
 	select MFD_SYSCON
-	depends on (MIPS && SOC_MT7621) || ARCH_MEDIATEK || COMPILE_TEST
+	depends on (MIPS && SOC_MT7621) || ARCH_MEDIATEK || ARCH_AIROHA || COMPILE_TEST
 	help
 	  Say 'Y' to enable the support for the xHCI host controller
 	  found in MediaTek SoCs.
-- 
2.53.0


  parent reply	other threads:[~2026-08-31 13:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260831133314.4125787-1-sashal@kernel.org>
2026-08-31 13:21 ` [PATCH AUTOSEL 6.18] usb: xhci: remove legacy 'num_trbs_free' tracking Sasha Levin
2026-08-31 13:21 ` [PATCH AUTOSEL 6.18-5.10] xhci: Prevent queuing new commands if xhci is inaccessible Sasha Levin
2026-08-31 13:22 ` [PATCH AUTOSEL 6.18-6.6] thunderbolt: Don't access path config space on Lane 1 adapters in tb_switch_reset_host() Sasha Levin
2026-08-31 13:23 ` [PATCH AUTOSEL 6.18-5.10] thunderbolt: Keep XDomain reference during the lifetime of a service Sasha Levin
2026-08-31 13:23 ` [PATCH AUTOSEL 6.18-6.1] usb: gadget: aspeed_udc: avoid past-the-end iterator in dequeue Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18-6.1] usb: gadget: udc: skip pullup() if already connected Sasha Levin
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18-5.10] usb: core: hcd: fix possible deadlock in rh control transfers Sasha Levin
2026-08-31 13:26 ` [PATCH AUTOSEL 6.18-6.12] usb: xhci: Improve Soft Retries after short transfers Sasha Levin
2026-08-31 13:26 ` [PATCH AUTOSEL 6.18-6.6] thunderbolt: Verify Router Ready bit is set after router enumeration Sasha Levin
2026-08-31 13:26 ` [PATCH AUTOSEL 6.18-6.12] thunderbolt: Avoid reserved fields in path config space for USB4 routers Sasha Levin
2026-08-31 13:26 ` [PATCH AUTOSEL 6.18-6.6] thunderbolt: Improve multi-display DisplayPort tunnel allocation Sasha Levin
2026-08-31 13:27 ` [PATCH AUTOSEL 6.18-6.1] thunderbolt: Don't create multiple DMA tunnels on firmware connection manager Sasha Levin
2026-08-31 13:27 ` [PATCH AUTOSEL 6.18-5.10] usb: gadget: goku_udc: avoid NULL deref of dev->driver in INT_USBRESET log Sasha Levin
2026-08-31 13:27 ` [PATCH AUTOSEL 6.18] thunderbolt: Verify PCIe adapter in detect state before tunnel setup Sasha Levin
2026-08-31 13:28 ` [PATCH AUTOSEL 6.18-5.10] usbip: vhci_hcd: fix NULL deref in status_show_vhci Sasha Levin
2026-08-31 13:29 ` [PATCH AUTOSEL 6.18-5.10] thunderbolt: Set tb->root_switch to NULL when domain is stopped Sasha Levin
2026-08-31 13:29 ` [PATCH AUTOSEL 6.18-6.12] thunderbolt: Don't disable lane adapter if XDomain lane bonding isn't possible Sasha Levin
2026-08-31 13:29 ` Sasha Levin [this message]
2026-08-31 13:30 ` [PATCH AUTOSEL 6.18-6.1] USB: cdc-acm: start bulk-IN polling when ALWAYS_POLL_CTRL is set Sasha Levin
2026-08-31 13:30 ` [PATCH AUTOSEL 6.18-5.10] net: usb: qmi_wwan: add MeiG SRM813Q Sasha Levin
2026-08-31 13:31 ` [PATCH AUTOSEL 6.18-5.10] thunderbolt: Keep the domain reference while processing hotplug Sasha Levin
2026-08-31 13:31 ` [PATCH AUTOSEL 6.18-6.6] thunderbolt: Increase timeout for Configuration Ready bit Sasha Levin
2026-08-31 13:31 ` [PATCH AUTOSEL 6.18-5.10] thunderbolt: Release request if tb_cfg_request() fails in __tb_xdomain_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=20260831133314.4125787-551-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.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