Skip to content

WORKAROUND: PCI/pwrctrl: tc9563: Fix endpoint reset GPIO direction and PERST# handling - #2417

Open
Hariharan Sreedhar (hariharan-sree) wants to merge 3 commits into
qualcomm-linux:tech/all/workaroundfrom
hariharan-sree:lyra-tc9563-gpio-workaround-v2
Open

Hariharan Sreedhar (hariharan-sree) wants to merge 3 commits into
qualcomm-linux:tech/all/workaroundfrom
hariharan-sree:lyra-tc9563-gpio-workaround-v2

Conversation

@hariharan-sree

@hariharan-sree Hariharan Sreedhar (hariharan-sree) commented Nov 26, 2026 •

Copy link
Copy Markdown

Updates the TC9563 PCIe switch's reset-GPIO handling to match this
repo's GPIO descriptor API (1dc6273, "PCI/pwrctrl: tc9563: Switch
per-port reset to GPIO descriptor API").

  • dt-bindings: PCI: toshiba,tc9563: Document reset-gpios and
    gpio-controller usage
    Updates the binding doc to the current reset-gpios /
    gpio-controller property names; drops stale ep-reset-gpio /
    ep-pwr-en-gpio docs.

  • PCI: qcom: Allow downstream PCIe devices to provide PERST# GPIOs
    Lets a downstream PCIe device supply its own PERST# GPIO to the
    qcom PCIe host controller driver.

  • PCI/pwrctrl: tc9563: Re-sync endpoint reset GPIO direction after
    power-on
    Adds tc9563_pwrctrl_sync_gpio_direction(), invoked at the end of
    power_on(), so gpiolib re-reads direction on the DSP1/DSP2 reset
    lines once the switch is powered and I2C-accessible. A line
    requested with GPIOD_ASIS before the switch is up has unknown
    cached direction, and gpiod_set_value_cansleep() refuses to drive
    it until that happens.

    CRs-fixed: 4732833
    QLIJIRA exceptions: [QLIJIRA-250] Temporary downstream exception to fix Wi-Fi failures after resume. - Qualcomm JIRA DC

…d gpio-controller usage

Document the standard reset-gpios property for downstream ports, used
by pci-pwrctrl-tc9563.c to drive the endpoint reset line through the
TC9563 embedded GPIO controller. Update the example to mark pcie@0,0
as a gpio-controller, drop the stray duplicate gpio-controller/
remove the now-redundant ep-reset-gpio from the pcie@2,0 example.

Signed-off-by: Hariharan Sreedhar <hariharan.sreedhar@oss.qualcomm.com>
(cherry picked from commit 974b63200bccd1718486fb839e24c25567ac1416)
…# GPIOs

Create the pwrctrl devices before parsing the Root Port nodes, since a
downstream PCIe device (e.g., the TC9563 switch acting as a GPIO
controller) may provide the PERST# GPIO for its own downstream ports.
Such a provider is not yet powered/probed at the point the RC node's
own PERST# is normally requested, so request it with GPIOD_ASIS
instead of GPIOD_OUT_HIGH and leave its state untouched until the
pwrctrl driver powers the device on and the PCI client driver takes
over control of it.

Also plug a PHY leak on the parse_perst() failure path in
qcom_pcie_parse_port(), and destroy the pwrctrl devices on the
corresponding qcom_pcie_probe() error paths.

Signed-off-by: Hariharan Sreedhar <hariharan.sreedhar@oss.qualcomm.com>
(cherry picked from commit 93dff6f2a2b5f115c89533072daec6661c52b76a)
…n after power-on

The PCIe host controller driver may request the endpoint reset GPIOs
before the switch is powered. gpiolib cannot read their direction
then, and refuses to drive a line it does not know to be an output.
Now that the switch is accessible and the lines are outputs, make
gpiolib read the direction again.

Signed-off-by: Hariharan Sreedhar <hariharan.sreedhar@oss.qualcomm.com>
(cherry picked from commit a78a949d23eb7f1e1cca13359e190d94d3c808f3)
@qcomlnxci
qcomlnxci requested review from a team, Sibi Sankar (QuinAsura), Ricardo Salveti (ricardosalveti) and Rajendra (rrnayak) and removed request for a team November 26, 2026 14:34
@qcomlnxci

Copy link
Copy Markdown

Topic branch CI failed — tree reproduction

This branch is not built on its own. CI rebuilds the whole qcom-next
tree from qcom-next.yaml with this topic pinned to the PR head, so the
tree is defined by the inputs below rather than by this branch alone.

Input Value
Run 45840396693 (attempt 1)
Failed stage(s) build, build_rt
kernel-config 2b90a827854a601e382b13289c745137becba642 (main)
Topic pinned tech/all/workaround -> 6467a490557b822e928731fee2eabe6505fe1f61
PR qualcomm-linux/kernel-topics#2417
automerge sgaud-quic/automerge @ sha_config_yaml
rerere cache qualcomm-linux/kernel-rrcache

qcom-next.yaml at kernel-config 2b90a827854a pins the baseline
and every other topic to an explicit SHA, so checking that commit out and
overriding only this topic reproduces the same tree.

Rebuild the exact tree
mkdir qcom-topic-repro && cd qcom-topic-repro

# 1. Topic config, at the exact commit this run used
git clone https://github.com/qualcomm-linux/kernel-config.git
git -C kernel-config checkout 2b90a827854a601e382b13289c745137becba642

# 2. Scratch tree; ci-merge resets it to the baseline named in the config
git clone https://github.com/qualcomm-linux/kernel.git

# 3. automerge tooling, same branch CI uses
git clone --branch sha_config_yaml https://github.com/sgaud-quic/automerge.git

# 4. Override only this topic with the PR head
cp kernel-config/qcom-next.yaml qcom-next-pr.yaml
#    In qcom-next-pr.yaml, under the entry for 'tech/all/workaround', set:
#      sha: 6467a490557b822e928731fee2eabe6505fe1f61
#      tag: null
#    Repeat for every branch named by a 'Depends-on:' line in the PR body.

# 5. Reassemble the tree
cd kernel
git config user.email you@example.com
git config user.name "Your Name"
../automerge/ci-merge --yaml-config ../qcom-next-pr.yaml \
  -t head -i qcom-next \
  -c https://github.com/qualcomm-linux/kernel-rrcache \
  -n -p | tee ../merge.log

# 6. Merge this PR on top, as CI does
git fetch https://github.com/qualcomm-linux/kernel-topics.git pull/2417/head:pr-2417
git merge pr-2417

# 7. Confirm the tree matches the run
grep '^Merge successful' ../merge.log
git log --oneline -1

The run log for the failed stage contains the same Merge successful lines;
comparing them against local merge.log confirms an identical tree. The
workspace is assembled by .github/actions/sync in
qualcomm-linux/kernel-config at that commit.

Note: automerge and the rerere cache are tracked by branch, not pinned, so a
later change to either can alter conflict resolution.

@qlijarvis

Copy link
Copy Markdown

🔨 Build Failure Analysis — PR #2417

PR: #2417
Build run: https://github.com/qualcomm-linux/kernel-config/actions/runs/45840396693

# Error File:Line PR-introduced? Root Cause
1 Merge conflict Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml Yes PR modifies the same sections of the DT binding YAML that were already changed in the integration branch, causing a content conflict during git merge

Verdict

This is a merge conflict, not a compilation error. The PR cannot be automatically merged into the qcom-next integration branch due to conflicting changes in the device tree binding documentation.

📎 Detailed analysis: Full report

@qlijarvis

Copy link
Copy Markdown

🔨 Build Failure Analysis — PR #2417

PR: #2417
Build run: https://github.com/qualcomm-linux/kernel-config/actions/runs/45840396693

# Error File:Line PR-introduced? Root Cause
1 Merge conflict Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml Yes PR modifies a file that has conflicting changes in the integration branch

Verdict

This is a merge conflict, not a compilation error. The build failed during the integration phase before any compilation occurred. The PR introduces changes to toshiba,tc9563.yaml that conflict with the current state of the integration branch.

📎 Detailed analysis: Full report

@qlijarvis

Copy link
Copy Markdown

PR #2417 — validate-patch

PR: #2417

Verdict Issues Detailed Report
⚠️ 2 Full report

Final Summary

  1. Lore link present: No — WORKAROUND: prefix; no lore link expected or required
  2. Lore link matches PR commits: N/A — no lore link to compare against
  3. Upstream patch status: N/A — vendor-only changes, not posted upstream
  4. PR present in qcom-next/topics: Partial - 3/3 commit(s) only have partial integration evidence
Verdict: ⚠️ — click to expand

🔍 Patch Validation

PR: #2417 - WORKAROUND patches for TC9563 PCIe switch GPIO handling
Upstream commit: N/A (WORKAROUND: prefix - vendor-only changes)
Verdict: ⚠️ PARTIAL

Commit Message

Check Status Note
Subject matches upstream N/A WORKAROUND: vendor-only commits
Body preserves rationale ✅ Clear technical rationale provided for all 3 commits
Fixes tag present/correct N/A No Fixes tags; not fixing upstream bugs
Authorship preserved ✅ Consistent author across all commits
Backport note (if applicable) ⚠️ (cherry picked from commit <sha>) present but references internal commits, not upstream

Diff

File Status Notes
Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml ✅ Adds reset-gpios documentation, reorganizes gpio-controller placement
drivers/pci/controller/dwc/pcie-qcom.c ✅ Refactors pwrctrl device creation timing, adds PHY leak fix
drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c ✅ Adds GPIO direction re-sync after power-on

Issues

  • Integration presence concern: All 3 commits show only "partial" matches in qcom-next/topics. The integration_presence_report indicates subject or partial tree evidence was found, but full changes were not verified. This suggests the commits may differ from what's already in the integration branches, or the detection was inconclusive.
  • Cherry-pick references: The (cherry picked from commit ...) lines reference internal SHAs (974b63200bcc, 93dff6f2a2b5, a78a949d23eb) that are not verifiable against public upstream sources.

Verdict

Conditional approval with verification required:

These are legitimate WORKAROUND: commits for vendor-specific TC9563 PCIe switch GPIO handling. The technical content is coherent:

  1. Patch 1/3 documents the reset-gpios binding
  2. Patch 2/3 adjusts timing to allow downstream devices to provide GPIOs
  3. Patch 3/3 re-syncs GPIO direction after power-on

However, the "partial" integration status for all 3 commits requires manual verification before merge. The reviewer should:

  1. Confirm whether these exact changes are already present in qcom-next/topics (possibly under different commit SHAs)
  2. Verify the cherry-pick source commits (974b63200bcc, 93dff6f2a2b5, a78a949d23eb) exist in the internal tree
  3. Check for any conflicts or duplicates with existing integration branch content

Final Summary

  1. Lore link present: No — WORKAROUND: prefix; no lore link expected or required
  2. Lore link matches PR commits: N/A — no lore link to compare against
  3. Upstream patch status: N/A — vendor-only changes, not posted upstream
  4. PR present in qcom-next/topics: Partial - 3/3 commit(s) only have partial integration evidence (subject or partial tree match found, but full changes not verified)

Deterministic Integration Presence

Integration Presence Report

This report is generated by Jarvis before validate-patch runs.
It is the authoritative source for whether PR changes are already present
in qcom-next or in the kernel topic branches.

Kernel repo: /local/mnt/workspace/sgaud/Qgenie/image_pipeline/kernel
qcom-next ref: 1843874b4356d1203ebd83d5ebfc24d45aa35f1d
topics remote: topics -> https://github.com/qualcomm-linux/kernel-topics
topics fetch: fetched

Commit Subject qcom-next topics Final
1/3 [PATCH 1/3] WORKAROUND: dt-bindings: PCI: toshiba,tc9563: Document partial - subject or partial tree evidence found, but full change was not verified partial - subject or partial tree evidence found, but full change was not verified partial
2/3 [PATCH 2/3] WORKAROUND: PCI: qcom: Allow downstream PCIe devices to partial - subject or partial tree evidence found, but full change was not verified partial - subject or partial tree evidence found, but full change was not verified partial
3/3 [PATCH 3/3] WORKAROUND: PCI/pwrctrl: tc9563: Re-sync endpoint reset partial - subject or partial tree evidence found, but full change was not verified missing - no subject, patch-id, or full tree-content match found partial

Final Status

overall_status: PARTIAL
present_commits: 0/3
partial_commits: 3/3
missing_commits: 0/3
topics_checked_for_commits: 3/3
final_summary: PR present in qcom-next/topics: Partial - 3/3 commit(s) only have partial integration evidence

@qlijarvis

Copy link
Copy Markdown

PR #2417 — checker-log-analyzer

PR: #2417
Checker run: https://github.com/qualcomm-linux/kernel-config/actions/runs/45840397664

Checker Result Summary
Checker Result Summary
checkpatch ⚠️ Blocked by merge conflict
dt-binding-check ⚠️ Blocked by merge conflict
dtb-check ⚠️ Blocked by merge conflict
sparse-check ⚠️ Blocked by merge conflict
check-uapi-headers ⚠️ Blocked by merge conflict
check-patch-compliance ⚠️ Blocked by merge conflict
tag-check ✅ All commits have valid WORKAROUND: prefix

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #2417 - WORKAROUND: PCI TC9563 GPIO controller and reset handling
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/45840397664
Target branch: tech/all/workaround

Checker Result Summary
checkpatch ⚠️ Blocked by merge conflict
dt-binding-check ⚠️ Blocked by merge conflict
dtb-check ⚠️ Blocked by merge conflict
sparse-check ⚠️ Blocked by merge conflict
check-uapi-headers ⚠️ Blocked by merge conflict
check-patch-compliance ⚠️ Blocked by merge conflict
tag-check ✅ All commits have valid WORKAROUND: prefix

⚠️ Merge Conflict — All Checkers Blocked

Root cause: The PR cannot be merged into the integration branch due to a content conflict in Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml.

Failure details:

Auto-merging Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml
CONFLICT (content): Merge conflict in Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml
Auto-merging drivers/pci/controller/dwc/pcie-qcom.c
Auto-merging drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
Automatic merge failed; fix conflicts and then commit the result.
Merge failed or conflicts detected. Aborting merge.
##[error]Process completed with exit code 3.

All six checker jobs (checkpatch, dt-binding-check, dtb-check, sparse-check, check-uapi-headers, check-patch-compliance) failed at the merge stage before any actual checker validation could run.

Root cause analysis:

The CI workflow attempts to:

  1. Checkout the baseline integration branch (qcom-next + topic/tech/all/workaround)
  2. Merge PR WORKAROUND: PCI/pwrctrl: tc9563: Fix endpoint reset GPIO direction and PERST# handling #2417 on top of it
  3. Run checkers on the merged result

The merge fails because Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml has conflicting changes between:

This indicates that either:

  • The baseline topic/tech/all/workaround branch has diverged and contains overlapping changes to the same binding file, OR
  • Another PR was merged into the baseline that conflicts with this PR's changes

Fix:

The PR author must rebase the PR branch onto the current tip of tech/all/workaround:

# In the PR branch
git fetch origin tech/all/workaround
git rebase origin/tech/all/workaround

# Resolve the conflict in Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml
# Edit the file to resolve conflict markers
git add Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml
git rebase --continue

# Force-push the rebased branch
git push --force-with-lease

Reproduce locally:

git clone https://github.com/qualcomm-linux/kernel-topics.git
cd kernel-topics
git fetch origin tech/all/workaround
git fetch origin pull/2417/head:pr-2417
git checkout tech/all/workaround
git merge pr-2417
# Conflict will appear in Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml

✅ tag-check — Subject Prefix Validation

Status: PASS

All three commits in the PR have valid subject-line prefixes:

  1. WORKAROUND: dt-bindings: PCI: toshiba,tc9563: Document reset-gpios and gpio-controller usage
  2. WORKAROUND: PCI: qcom: Allow downstream PCIe devices to provide PERST# GPIOs
  3. WORKAROUND: PCI/pwrctrl: tc9563: Re-sync endpoint reset

The WORKAROUND: prefix is valid for all branches (including tech/all/workaround). This prefix indicates temporary fixes not suitable for upstream submission.

Note: Since the target branch is tech/all/workaround (not qcom-next or qcom-next-staging), the subject-prefix check is mandatory and has been verified.


Verdict

❌ Cannot merge — merge conflict must be resolved first.

The PR cannot proceed to checker validation until the merge conflict in Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml is resolved. Once the conflict is fixed and the PR is rebased:

  1. Re-trigger the CI workflow (it will run automatically on the force-push)
  2. All six checkers will then run on the conflict-free merged result
  3. The PR can be reviewed for actual code quality issues

Action required: Rebase PR #2417 onto the current tech/all/workaround branch and resolve the conflict in the DT binding file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants