From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.12.y 2/2] [AUTOMATED CONFLICT RESOLUTION] Documentation for d98d413ca65d0790a8f3695d0a5845538958ab84
Date: Sat, 6 Jun 2026 08:19:00 -0400 [thread overview]
Message-ID: <20260606121900.2851177-2-sashal@kernel.org> (raw)
In-Reply-To: <20260606121900.2851177-1-sashal@kernel.org>
This commit documents the automated conflict resolution performed by claude
for upstream commit d98d413ca65d0790a8f3695d0a5845538958ab84.
claude's resolution process:
================================================================================
Done. Here's the detailed breakdown.
## The problem
Commit `d98d413ca65d` ("usb: typec: ucsi: Don't update power_supply on power role change if not connected") **cherry-picked without conflict markers** — git fuzzy-matched the unchanged anchor lines (`typec_set_pwr_role(con->port, role);` and `ucsi_port_psy_changed(con);`) and silently applied the body change. So it *looked* clean, but it failed to **build**.
The reason: upstream's hunk wraps the psy update in
```c
if (UCSI_CONSTAT(con, CONNECTED))
ucsi_port_psy_changed(con);
```
`UCSI_CONSTAT(con, FIELD)` is a **function-like accessor macro** introduced by a later UCSI refactor that is **not present in 6.12**. The 6.12 `ucsi.h` only defines the raw BIT-flag macros (`UCSI_CONSTAT_CONNECTED` = BIT(7), etc.), and every connected-check in this tree uses the old idiom `con->status.flags & UCSI_CONSTAT_CONNECTED`.
## The resolution
Single minimal change — translate the macro to the in-tree idiom:
```c
- if (UCSI_CONSTAT(con, CONNECTED))
+ if (con->status.flags & UCSI_CONSTAT_CONNECTED)
ucsi_port_psy_changed(con);
```
This matches exactly how connected status is read at ucsi.c:1108, 1149, 1251, 1663, 1937. The upstream comment was kept verbatim, and the actual fix logic (gate `ucsi_port_psy_changed()` on the port being connected) is byte-faithful. Result is +6/-1, identical line count to upstream.
**One subtlety I verified:** upstream's context line reads `if ((change & UCSI_CONSTAT_POWER_DIR_CHANGE) && role != prev_role)`. The `role != prev_role` comes from a *separate predecessor patch* (`b80e7d34`, the v1-1 of this series) that isn't in 6.12.92. But that text is **context, not payload** — this patch only changes the block body — so its absence is irrelevant to this backport and required no action.
## Verification
- Author preserved: **Myrrh Periwinkle** ✓
- Commit message unchanged ✓
- No functions added, no divergence beyond the one-line macro translation ✓
- **`stable build log`: 0 warnings / 0 errors on both x86_64 and aarch64** ✓
Committed as `782ea4e61bbf`.
================================================================================
Backport verification analysis (via claude):
================================================================================
Analysis complete. Here is my detailed verification.
## Backport Verification: `d98d413ca65d` → `b25f1e36558347` (6.12.92)
### 1. Intent preservation — ✅ Correct
The upstream fix gates `ucsi_port_psy_changed(con)` (a power_supply notification) behind a connection check inside the `POWER_DIR_CHANGE` handler. Rationale: when the port is disconnected, the `online` status is identical regardless of power-direction, so notifying power_supply is unnecessary/incorrect.
The backport reproduces this exactly:
```c
if (con->status.flags & UCSI_CONSTAT_CONNECTED)
ucsi_port_psy_changed(con);
```
preceded by the verbatim upstream comment. The gate logic is byte-faithful to upstream's intent.
### 2. Differences and justification
There are exactly **two** differences from the upstream diff, both fully justified:
**(a) Payload — the one real change (justified, required for build):**
Upstream uses `if (UCSI_CONSTAT(con, CONNECTED))`, a function-like accessor macro introduced by a later UCSI refactor that **does not exist in 6.12**. I confirmed `grep "define UCSI_CONSTAT("` returns nothing; 6.12's `ucsi.h` only has the raw bit macro `UCSI_CONSTAT_CONNECTED` (BIT(3), at ucsi.h:340). The resolution translates it to `con->status.flags & UCSI_CONSTAT_CONNECTED`, which is the established in-tree idiom — used identically at lines 1108, 1149, 1251, 1663, 1937 of the same file. Semantically equivalent and compiles. This is the correct and minimal resolution.
> Minor note: the resolution writeup claimed `UCSI_CONSTAT_CONNECTED = BIT(7)` — it's actually BIT(3). Harmless, since the named macro was used, not a literal.
**(b) Context-only difference (no action correctly taken):**
Upstream's block header is `if ((change & UCSI_CONSTAT_POWER_DIR_CHANGE) && role != prev_role)`; the backport's is `if (con->status.change & UCSI_CONSTAT_POWER_DIR_CHANGE)`. The `&& role != prev_role` and the local `change` variable come from the sibling predecessor `b80e7d34` (the v1-1 patch). I verified `prev_role` is **absent** from this tree — that predecessor isn't applied here. Since this patch only edits the *body* of the block, the differing header is pure context and does not affect the build or the fix. Correctly left untouched.
### 3. Potential issues — none material
- **Build:** The macro translation matches 5 existing call sites; no undefined symbols. Resolution reports 0W/0E on x86_64 + aarch64. Consistent with my static checks.
- **Dependency ordering:** `b80e7d34` (v1-1) ideally lands before this (v1-2) in the series, and per my prior records it was backported separately as `e405a0183c94`. Its absence here is benign — the two patches touch disjoint payloads (one edits the header condition, this one edits the block body), so neither build nor correctness depends on ordering. No risk introduced.
- **Metadata:** Author (Myrrh Periwinkle), message, Fixes/Link tags all preserved correctly.
### 4. Overall assessment — ✅ High quality, correct
A textbook clean amend. The cherry-pick fuzzy-matched the stable anchor lines and applied without conflict markers but would not have built due to the missing `UCSI_CONSTAT()` accessor macro. The single one-line translation to the native `con->status.flags & UCSI_CONSTAT_CONNECTED` idiom is the right fix, is faithful to upstream intent, matches local convention, and is line-count-identical to upstream (+6/−1). No concerns. Backport is correct.
(Recorded to memory for future reference under the `backport-review` tag, cross-linked to the `b80e7d34` 6.12 sibling.)
================================================================================
This is an empty commit for documentation purposes only.
--
2.53.0
prev parent reply other threads:[~2026-06-06 12:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 6:17 FAILED: patch "[PATCH] usb: typec: ucsi: Don't update power_supply on power role" failed to apply to 6.12-stable tree gregkh
2026-06-06 12:18 ` [PATCH 6.12.y 1/2] usb: typec: ucsi: Don't update power_supply on power role change if not connected Sasha Levin
2026-06-06 12:19 ` Sasha Levin [this message]
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=20260606121900.2851177-2-sashal@kernel.org \
--to=sashal@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.