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: "Matthew Schwartz" <matthew.schwartz@linux.dev>,
	"Mario Limonciello (AMD)" <superm1@kernel.org>,
	"Denis Benato" <denis.benato@linux.dev>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Sasha Levin" <sashal@kernel.org>,
	corentin.chary@gmail.com, luke@ljones.dev, hansg@kernel.org,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH AUTOSEL 6.19-6.12] platform/x86: asus-nb-wmi: add DMI quirk for ASUS ROG Flow Z13-KJP GZ302EAC
Date: Mon, 30 Mar 2026 08:38:18 -0400	[thread overview]
Message-ID: <20260330123842.756154-5-sashal@kernel.org> (raw)
In-Reply-To: <20260330123842.756154-1-sashal@kernel.org>

From: Matthew Schwartz <matthew.schwartz@linux.dev>

[ Upstream commit 0198d2743207d67f995cd6df89e267e1b9f5e1f1 ]

The ASUS ROG Flow Z13-KJP GZ302EAC model uses sys_vendor name ASUS
rather than ASUSTeK COMPUTER INC., but it needs the same folio quirk as
the other ROG Flow Z13. To keep things simple, just match on sys_vendor
ASUS since it covers both.

Signed-off-by: Matthew Schwartz <matthew.schwartz@linux.dev>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Denis Benato <denis.benato@linux.dev>
Link: https://patch.msgid.link/20260312212246.1608080-1-matthew.schwartz@linux.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

Now I have all the facts verified. Here is the complete analysis:

---

## PHASE 1: COMMIT MESSAGE FORENSICS

**Step 1.1: Subject Line**
Record: [platform/x86: asus-nb-wmi] [add] [Broaden DMI vendor match for
ASUS ROG Flow Z13-KJP GZ302EAC so the existing folio quirk applies]

**Step 1.2: Tags**
- Signed-off-by: Matthew Schwartz <matthew.schwartz@linux.dev> (author)
- Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
- Reviewed-by: Denis Benato <denis.benato@linux.dev>
- Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> (subsystem
  maintainer)
- Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
  (maintainer sign-off)
- Link: https://patch.msgid.link/20260312212246.1608080-1-
  matthew.schwartz@linux.dev
- No Fixes:, Reported-by:, Tested-by:, or Cc: stable tags (expected for
  candidates)

Record: Triple Reviewed-by including subsystem maintainer; strong
quality signal.

**Step 1.3: Body Text**
The GZ302EAC model reports `sys_vendor` as "ASUS" rather than "ASUSTeK
COMPUTER INC." The existing Z13 DMI entry matched only the longer
string, so the GZ302EAC variant never received `quirk_asus_z13`. The fix
broadens the vendor match to "ASUS" to cover both strings.
Record: [Bug] DMI vendor string mismatch prevents quirk application.
[Symptom] Missing folio/tablet and key-remap behavior on this model.
[Version info] None explicit. [Root cause] `sys_vendor` differs across
Z13 variants.

**Step 1.4: Hidden Bug Fix Detection**
Record: This is explicitly a hardware quirk fix — the existing Z13 quirk
fails to match a real hardware variant, causing functional regressions
for that model's users.

---

## PHASE 2: DIFF ANALYSIS

**Step 2.1: Inventory**
Record: [1 file: `drivers/platform/x86/asus-nb-wmi.c`, +1/-1]
[asus_quirks[] data table, Z13 entry] [Single-file, single-line surgical
fix]

**Step 2.2: Code Flow Change**
Before: The Z13 DMI entry matched `DMI_SYS_VENDOR` substring `"ASUSTeK
COMPUTER INC."` plus `DMI_PRODUCT_NAME` substring `"ROG Flow Z13"`.
After: Same entry matches `DMI_SYS_VENDOR` substring `"ASUS"` plus same
product name.

Verified in `drivers/firmware/dmi_scan.c` lines 864-866 that
`DMI_MATCH()` uses `strstr()` for non-exact matches:

```864:866:drivers/firmware/dmi_scan.c
                        if (strstr(dmi_ident[s],
                                   dmi->matches[i].substr))
                                continue;
```

Since "ASUS" is a substring of "ASUSTeK COMPUTER INC.", all previously-
matching devices continue to match. The broader string also covers
models reporting just "ASUS".
Record: [Widens vendor match safely; existing devices still match;
GZ302EAC now also matches]

**Step 2.3: Bug Mechanism**
Category: Hardware workaround / DMI quirk match fix.

The `quirk_asus_z13` provides:

```153:156:drivers/platform/x86/asus-nb-wmi.c
static struct quirk_entry quirk_asus_z13 = {
        .key_wlan_event = ASUS_WMI_KEY_ARMOURY,
        .tablet_switch_mode = asus_wmi_kbd_dock_devid,
};
```

Without matching, the driver falls back to `quirk_asus_unknown` (line
561), resulting in:
- Side button erroneously triggering WiFi rfkill toggle instead of
  emitting KEY_PROG3
- No tablet mode detection when the folio keyboard is detached

Record: [DMI match failure prevents `quirk_asus_z13` application on
GZ302EAC variant; fix widens vendor match safely]

**Step 2.4: Fix Quality**
Record: Obviously correct — single string change in a data table,
mechanically verifiable via `strstr()` semantics. Product-name match
(`"ROG Flow Z13"`) still constrains the match. Regression risk: very
low.

---

## PHASE 3: GIT HISTORY INVESTIGATION

**Step 3.1: Blame**
`git blame` shows the Z13 DMI entry was introduced by commit
`132bfcd24925d4` (Antheas Kapenekakis, 2025-08-08): "platform/x86: asus-
wmi: Fix ROG button mapping, tablet mode on ASUS ROG Z13".
Record: [Buggy code introduced by `132bfcd24925d4`] [First released in
v6.17]

**Step 3.2: Fixes: tag**
Record: N/A — no Fixes: tag present (expected for candidates).

**Step 3.3: File History**
Recent history shows `132bfcd24925d4` (Z13 quirk) and `7dc6b2d3b5503`
(Zenbook Duo UX8406CA quirk addition — same pattern). The candidate is a
standalone follow-up. No other GZ302 or KJP commits found.
Record: [Related: `132bfcd24925d4` prerequisite only] [Standalone fix]

**Step 3.4: Author**
No prior commits by Matthew Schwartz in this subsystem found in local
history. However, three subsystem-relevant reviewers signed off,
including the maintainer Ilpo Järvinen.
Record: [Author is not a regular contributor] [Maintainer reviewed and
signed off]

**Step 3.5: Dependencies**
`git tag --contains 132bfcd24925d4` confirms the prerequisite is in
v6.17, v6.18, and v6.19. It is NOT in v6.12 or older LTS trees (exit
code 1, empty output). The candidate is only meaningful for trees that
already contain this commit.
Record: [Depends on `132bfcd24925d4`; relevant for v6.17+; irrelevant
for v6.12.y, v6.6.y, v6.1.y, v5.15.y]

---

## PHASE 4: MAILING LIST AND EXTERNAL RESEARCH

**Step 4.1-4.4:**
Lore.kernel.org and patch.msgid.link were inaccessible due to Anubis
anti-bot protection. The commit message itself carries three Reviewed-by
tags and maintainer sign-off, which are strong acceptance signals.
Record: [Lore thread content UNVERIFIED; relying on commit tag signals]

---

## PHASE 5: CODE SEMANTIC ANALYSIS

**Step 5.1: Key Functions/Data**
Record: `asus_quirks[]` table, `asus_nb_wmi_quirks()`,
`dmi_check_system()`, `dmi_matched()`, `quirk_asus_z13`

**Step 5.2: Callers**
`asus_nb_wmi_quirks()` is the `.detect_quirks` callback in
`asus_nb_wmi_driver`, called from `asus_wmi_register_driver()` during
`asus_nb_wmi_init()` → module initialization. Runs on every boot/module
load for affected hardware.
Record: [Called during normal driver initialization, not a hot path]

**Step 5.3: Callees**
`asus_nb_wmi_quirks()` calls `dmi_check_system(asus_quirks)`. On match,
`dmi_matched()` sets the global `quirks` pointer. This subsequently
affects `asus_nb_wmi_key_filter()` (key remapping) and tablet-switch
initialization in `asus-wmi.c`.
Record: [Quirk drives key event handling and tablet mode detection]

**Step 5.4: Call Chain**
`module_init(asus_nb_wmi_init)` → `asus_wmi_register_driver()` →
platform probe → `wdrv->detect_quirks()` → `asus_nb_wmi_quirks()` →
`dmi_check_system(asus_quirks)` → `dmi_matched()` sets quirks.
Record: [Reachable on every boot on affected hardware]

**Step 5.5: Similar Patterns**
The same file has many similar `DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK
COMPUTER INC.")` entries. The sibling commit `7dc6b2d3b5503` (Zenbook
Duo UX8406CA) shows the same pattern of small, single-entry DMI quirk
additions.
Record: [Standard pattern in this file]

---

## PHASE 6: STABLE TREE ANALYSIS

**Step 6.1: Buggy Code in Stable Trees**
Verified via `git tag --contains`: The Z13 quirk (commit
`132bfcd24925d4`) exists in v6.17, v6.18, v6.19 and their point
releases. It does NOT exist in v6.12 or earlier LTS trees.
Record: [Relevant for v6.17.y, v6.18.y, v6.19.y ONLY]

**Step 6.2: Backport Complications**
One-line string change in a static data table. The Z13 entry is
identical across v6.17, v6.18, and v6.19.
Record: [Clean apply expected on all relevant trees]

**Step 6.3: Duplicate Fixes**
No evidence of an equivalent fix already shipped in stable.
Record: [No duplicates found]

---

## PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT

**Step 7.1:**
Record: [platform/x86 — ASUS notebook WMI driver] [PERIPHERAL: affects
specific ASUS laptop hardware, not universal]

**Step 7.2:**
Record: [Actively maintained; steady stream of DMI quirk and key-mapping
updates]

---

## PHASE 8: IMPACT AND RISK ASSESSMENT

**Step 8.1: Who Is Affected**
Record: [Driver-specific / model-specific: owners of ASUS ROG Flow
Z13-KJP GZ302EAC and any other Z13 variant reporting `sys_vendor` =
"ASUS"]

**Step 8.2: Trigger Conditions**
Record: [Triggers on every boot/module-load on affected hardware; not
timing-dependent, not privilege-dependent]

**Step 8.3: Failure Mode Severity**
Without the quirk: the driver falls back to `quirk_asus_unknown`, so the
side button erroneously toggles WiFi rfkill and tablet mode detection
when the folio keyboard is detached does not work.
Record: [Functional hardware issue; severity MEDIUM for affected users]

**Step 8.4: Risk-Benefit Ratio**
- BENEFIT: Correct hardware behavior for a real device variant (HIGH for
  those users)
- RISK: 1-line data-only change, still constrained by product-name match
  (VERY LOW)
Record: [Strongly favorable ratio]

---

## PHASE 9: FINAL SYNTHESIS

**Step 9.1: Evidence**
- FOR: Fixes real DMI matching bug; trivial 1-line change; hardware
  quirk stable exception; triple Reviewed-by including maintainer;
  prerequisite exists in v6.17+; `strstr()` semantics verified; zero
  regression risk to existing devices
- AGAINST: Narrow impact (single model variant); not a
  crash/security/corruption fix
- UNRESOLVED: Lore thread content inaccessible; exact KJP DMI strings
  from external source unverified

**Step 9.2: Stable Rules Checklist**
1. Obviously correct and tested? **YES** — trivially verifiable,
   maintainer-reviewed
2. Fixes a real bug? **YES** — hardware quirk not applied to real device
3. Important issue? **YES for affected users** — functional hardware
   regression
4. Small and contained? **YES** — 1 line, 1 file, data-only
5. No new features or APIs? **YES** — extends existing quirk coverage
6. Can apply to stable? **YES** — clean apply on v6.17+ trees

**Step 9.3: Exception Category**
Record: **Hardware quirk/workaround** — explicitly in the "quirks and
workarounds" class suitable for stable.

**Step 9.4: Decision**
This is a textbook hardware quirk fix: a single-line broadening of a DMI
vendor match so that an existing quirk applies to a real hardware
variant. It falls squarely into the stable exception for hardware quirks
and workarounds. The fix is trivially correct (verified via `strstr()`
semantics), carries effectively zero regression risk (product-name match
still constrains it), and has strong review signals. It should be
backported to stable trees v6.17.y, v6.18.y, and v6.19.y (the only trees
containing the prerequisite Z13 quirk commit `132bfcd24925d4`).

---

## Verification

- [Phase 1] Parsed subject/body/tags from commit message; found 3x
  Reviewed-by (Mario Limonciello, Denis Benato, Ilpo Järvinen) plus
  maintainer sign-off
- [Phase 2] Read diff: 1 line changed in `asus_quirks[]` — vendor string
  `"ASUSTeK COMPUTER INC."` → `"ASUS"`
- [Phase 2] Verified `DMI_MATCH()` uses `strstr()` in
  `drivers/firmware/dmi_scan.c` lines 865-866
- [Phase 2] Verified `quirk_asus_z13` at lines 153-156: sets
  `key_wlan_event = ASUS_WMI_KEY_ARMOURY` and `tablet_switch_mode =
  asus_wmi_kbd_dock_devid`
- [Phase 2] Verified fallback: `asus_nb_wmi_quirks()` initializes
  `quirks = &quirk_asus_unknown` (line 561) before `dmi_check_system()`
- [Phase 3] `git blame -L 547,555`: Z13 entry introduced by
  `132bfcd24925d4` (Antheas Kapenekakis, 2025-08-08)
- [Phase 3] `git show 132bfcd24925d4`: original commit is "Fix ROG
  button mapping, tablet mode on ASUS ROG Z13"
- [Phase 3] `git tag --contains 132bfcd24925d4`: present in v6.17,
  v6.18, v6.19 and their point releases
- [Phase 3] `git tag --contains 132bfcd24925d4 | grep v6.12`: empty —
  NOT in v6.12 or older LTS trees
- [Phase 3] `git log --oneline -20 -- drivers/platform/x86/asus-nb-
  wmi.c`: confirmed recent history and similar pattern (`7dc6b2d3b5503`)
- [Phase 4] WebFetch on lore.kernel.org and patch.msgid.link blocked by
  Anubis — lore thread UNVERIFIED
- [Phase 5] Confirmed call chain: `module_init` →
  `asus_wmi_register_driver()` → `.detect_quirks` →
  `asus_nb_wmi_quirks()` → `dmi_check_system()`
- [Phase 6] Z13 quirk only exists in v6.17+; fix irrelevant for v6.12.y
  and older
- [Phase 6] Z13 DMI entry identical across v6.17/v6.18/v6.19; clean
  apply expected
- [Phase 8] Failure mode: wrong quirks on affected hardware (missing key
  remap, missing tablet mode); severity MEDIUM
- UNVERIFIED: Exact DMI output of GZ302EAC (claim from commit message
  only)
- UNVERIFIED: Lore discussion content, stable nominations by reviewers,
  any NAKs

**YES**

 drivers/platform/x86/asus-nb-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
index a38a65f5c550d..b4677c5bba5b4 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -548,7 +548,7 @@ static const struct dmi_system_id asus_quirks[] = {
 		.callback = dmi_matched,
 		.ident = "ASUS ROG Z13",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUS"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "ROG Flow Z13"),
 		},
 		.driver_data = &quirk_asus_z13,
-- 
2.53.0


  parent reply	other threads:[~2026-03-30 12:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 12:38 [PATCH AUTOSEL 6.19-6.18] ALSA: hda/realtek: add quirk for Lenovo Yoga 7 2-in-1 16AKP10 Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.18] ASoC: amd: acp: add ASUS HN7306EA quirk for legacy SDW machine Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-5.10] btrfs: tracepoints: get correct superblock from dentry in event btrfs_sync_file() Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.12] Bluetooth: hci_sync: annotate data-races around hdev->req_status Sasha Levin
2026-03-30 12:38 ` Sasha Levin [this message]
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-5.10] srcu: Use irq_work to start GP in tiny SRCU Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-5.10] ALSA: asihpi: avoid write overflow check warning Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.1] erofs: add GFP_NOIO in the bio completion if needed Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.18] platform/x86: hp-wmi: Add support for Omen 16-wf1xxx (8C76) Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.18] ALSA:usb:qcom: add AUXILIARY_BUS to Kconfig dependencies Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.12] drm/amdgpu: Handle GPU page faults correctly on non-4K page systems Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.1] ALSA: hda/realtek: Add HP ENVY Laptop 13-ba0xxx quirk Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.1] ASoC: amd: yc: Add DMI quirk for ASUS EXPERTBOOK BM1403CDA Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.18] dmaengine: idxd: Fix lockdep warnings when calling idxd_device_config() Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.1] ASoC: amd: yc: Add DMI quirk for Thin A15 B7VF Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.1] media: rkvdec: reduce stack usage in rkvdec_init_v4l2_vp9_count_tbl() Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.18] btrfs: fix zero size inode with non-zero size after log replay Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-5.10] ALSA: hda/realtek: Add mute LED quirk for HP Pavilion 15-eg0xxx Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-5.10] netfilter: nft_set_pipapo_avx2: don't return non-matching entry on expiry Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-5.10] ASoC: SOF: topology: reject invalid vendor array size in token parser Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19] ALSA: hda/realtek - Fixed Speaker Mute LED for HP EliteBoard G1a platform Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.18] netfilter: ctnetlink: ensure safe access to master conntrack Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.6] RDMA/irdma: Fix double free related to rereg_user_mr Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-5.10] can: mcp251x: add error handling for power enable in open and resume Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.18] ALSA: hda/realtek: add HP Laptop 15-fd0xxx mute LED quirk Sasha Levin
2026-03-30 12:38 ` [PATCH AUTOSEL 6.19-6.6] ALSA: hda/realtek: Add quirk for ASUS ROG Flow Z13-KJP GZ302EAC 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=20260330123842.756154-5-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=corentin.chary@gmail.com \
    --cc=denis.benato@linux.dev \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke@ljones.dev \
    --cc=matthew.schwartz@linux.dev \
    --cc=patches@lists.linux.dev \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=superm1@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