* [PATCH 6.12.y 2/2] [AUTOMATED CONFLICT RESOLUTION] Documentation for d98d413ca65d0790a8f3695d0a5845538958ab84
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
0 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2026-06-06 12:19 UTC (permalink / raw)
To: stable; +Cc: Sasha Levin
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
^ permalink raw reply [flat|nested] 3+ messages in thread