Skip to content

FROMLIST: PCI: qcom: Parse PERST# from all PCIe bridge nodes#785

Open
ziyuezhang-123 wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
ziyuezhang-123:for-6.18/pci-qcom-parse-perst-from-all-pcie-bridge-nodes
Open

FROMLIST: PCI: qcom: Parse PERST# from all PCIe bridge nodes#785
ziyuezhang-123 wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
ziyuezhang-123:for-6.18/pci-qcom-parse-perst-from-all-pcie-bridge-nodes

Conversation

@ziyuezhang-123

Copy link
Copy Markdown

Devicetree schema allows the PERST# GPIO to be present in all PCIe bridge
nodes, not just in Root Port node. But the current logic parses PERST# only
from the Root Port nodes. Though it is not causing any issue on the current
platforms, the upcoming platforms will have PERST# in PCIe switch
downstream ports also. So this requires parsing all the PCIe bridge nodes
for the PERST# GPIO.

Hence, rework the parsing logic to extend to all PCIe bridge nodes starting
from the Root Port node. If the 'reset-gpios' property is found for a PCI
bridge node, the GPIO descriptor will be stored in qcom_pcie_perst::desc
and added to the qcom_pcie_port::perst list.

It should be noted that if more than one bridge node has the same GPIO for
PERST# (shared PERST#), the driver will error out. This is due to the
limitation in the GPIOLIB subsystem that allows only exclusive (non-shared)
access to GPIOs from consumers. But this is soon going to get fixed. Once
that happens, it will get incorporated in this driver.

So for now, PERST# sharing is not supported.

Tested-by: Chen-Yu Tsai wenst@chromium.org
Signed-off-by: Manivannan Sadhasivam manivannan.sadhasivam@oss.qualcomm.com

Link: https://lore.kernel.org/all/20251216-pci-pwrctrl-rework-v2-1-745a563b9be6@oss.qualcomm.com/

Devicetree schema allows the PERST# GPIO to be present in all PCIe bridge
nodes, not just in Root Port node. But the current logic parses PERST# only
from the Root Port nodes. Though it is not causing any issue on the current
platforms, the upcoming platforms will have PERST# in PCIe switch
downstream ports also. So this requires parsing all the PCIe bridge nodes
for the PERST# GPIO.

Hence, rework the parsing logic to extend to all PCIe bridge nodes starting
from the Root Port node. If the 'reset-gpios' property is found for a PCI
bridge node, the GPIO descriptor will be stored in qcom_pcie_perst::desc
and added to the qcom_pcie_port::perst list.

It should be noted that if more than one bridge node has the same GPIO for
PERST# (shared PERST#), the driver will error out. This is due to the
limitation in the GPIOLIB subsystem that allows only exclusive (non-shared)
access to GPIOs from consumers. But this is soon going to get fixed. Once
that happens, it will get incorporated in this driver.

So for now, PERST# sharing is not supported.

Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20251216-pci-pwrctrl-rework-v2-1-745a563b9be6@oss.qualcomm.com/
@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

@qlijarvis

Copy link
Copy Markdown

PR #785 — validate-patch

PR: #785

Verdict Issues Detailed Report
⚠️ 12 Full report

Final Summary

  1. Lore link present: Yes — Link tag points to lore.kernel.org message-ID 20251216-pci-pwrctrl-rework-v2-1-745a563b9be6@oss.qualcomm.com
  2. Lore link matches PR commits: Cannot verify — network access restricted; unable to fetch upstream patch for byte-level comparison
  3. Upstream patch status: In review — FROMLIST prefix indicates patch posted to mailing list but not yet merged to mainline
  4. PR present in qcom-next: Not checked — no kernel tree access per constraints
Verdict: ⚠️ — click to expand

🔍 Patch Validation

PR: #785 - FROMLIST: PCI: qcom: Parse PERST# from all PCIe bridge nodes
Upstream commit: https://lore.kernel.org/all/20251216-pci-pwrctrl-rework-v2-1-745a563b9be6@oss.qualcomm.com/
Verdict: ⚠️ PARTIAL

Commit Message

Check Status Note
Subject matches upstream ⚠️ Cannot verify - network restricted; FROMLIST prefix present
Body preserves rationale Comprehensive explanation of change rationale
Fixes tag present/correct N/A No Fixes tag; not a bugfix
Authorship preserved Manivannan Sadhasivam manivannan.sadhasivam@oss.qualcomm.com
Backport note (if applicable) N/A FROMLIST indicates pending upstream review

Diff

File Status Notes
drivers/pci/controller/dwc/pcie-qcom.c ⚠️ Unused variable max_freq added at line 209

Issues

Critical:

  • Unused variable introduced: Line 209 adds unsigned long max_freq = ULONG_MAX; which is never referenced in the patch. This appears to be either:
    • A merge artifact from another patch in the series
    • An incomplete backport
    • Dead code that should be removed

Observations:

  • The patch refactors PERST# GPIO handling from a single gpio_desc *reset per port to a list of qcom_pcie_perst structures
  • Adds recursive parsing via qcom_pcie_parse_perst() to handle nested bridge nodes
  • Changes error code from -ENOENT to -ENODEV in qcom_pcie_parse_ports()
  • Properly handles list cleanup in error paths
  • Includes FIXME comment about shared PERST# limitation

Tag ordering:

  • ✅ Tested-by appears before Signed-off-by (correct kernel convention)
  • ✅ Link tag appears after Signed-off-by (correct)

Commit message structure:

  • ✅ Clear problem statement
  • ✅ Explains solution approach
  • ✅ Documents known limitation (shared PERST#)
  • ✅ Proper paragraph breaks

Verdict

Do not merge as-is — Remove the unused max_freq variable declaration at line 209 before merging. The rest of the patch appears structurally sound, but this dead code suggests incomplete integration or merge conflict resolution.

Final Summary

  1. Lore link present: Yes — Link tag points to lore.kernel.org message-ID 20251216-pci-pwrctrl-rework-v2-1-745a563b9be6@oss.qualcomm.com
  2. Lore link matches PR commits: Cannot verify — network access restricted; unable to fetch upstream patch for byte-level comparison
  3. Upstream patch status: In review — FROMLIST prefix indicates patch posted to mailing list but not yet merged to mainline
  4. PR present in qcom-next: Not checked — no kernel tree access per constraints

@qlijarvis

Copy link
Copy Markdown

PR #785 — checker-log-analyzer

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

Checker Result Summary
Checker Result Summary
checkpatch No style issues detected
dt-binding-check ⏭️ Skipped - no DT binding changes
dtb-check ⏭️ Skipped - no devicetree changes
sparse-check No new sparse warnings (pre-existing imagination driver warnings unrelated to PR)
check-uapi-headers No UAPI header changes
check-patch-compliance Patch differs from upstream lore link
tag-check N/A Not applicable for this branch
qcom-next-check N/A Not applicable for this branch

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #785 - FROMLIST: PCI: qcom: Parse PERST# from all PCIe bridge nodes
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/28416440463

Checker Result Summary
checkpatch No style issues detected
dt-binding-check ⏭️ Skipped - no DT binding changes
dtb-check ⏭️ Skipped - no devicetree changes
sparse-check No new sparse warnings (pre-existing imagination driver warnings unrelated to PR)
check-uapi-headers No UAPI header changes
check-patch-compliance Patch differs from upstream lore link
tag-check N/A Not applicable for this branch
qcom-next-check N/A Not applicable for this branch

❌ check-patch-compliance

Root cause: The patch content in the PR differs from the upstream patch referenced in the Link tag.

Failure details:

2026-06-30T02:51:34.9322061Z Checking commit: FROMLIST: PCI: qcom: Parse PERST# from all PCIe bridge nodes
2026-06-30T02:51:41.8240132Z Change is different from the one mentioned in Link
2026-06-30T02:51:41.8321420Z ##[error]Process completed with exit code 1.

The checker compared the patch in commit a339329727ac against the upstream patch at:
https://lore.kernel.org/all/20251216-pci-pwrctrl-rework-v2-1-745a563b9be6@oss.qualcomm.com/

The check-patch-compliance tool detected differences between the local patch and the upstream version, indicating the patch may have been modified during backporting or contains additional changes not present upstream.

Fix:

  1. Verify the patch matches upstream exactly:

    # Download the upstream patch from lore
    curl -L "https://lore.kernel.org/all/20251216-pci-pwrctrl-rework-v2-1-745a563b9be6@oss.qualcomm.com/raw" -o upstream.patch
    
    # Compare with the PR patch
    git show a339329727ac > pr.patch
    diff -u upstream.patch pr.patch
  2. If intentional modifications were made:

    • Remove the FROMLIST: prefix and use BACKPORT: instead if this is a modified backport
    • Or use UPSTREAM: if the patch is already merged upstream
    • Document any intentional changes in the commit message
  3. If the patch should match upstream exactly:

    • Re-apply the clean upstream patch using git am or b4 am
    • Ensure no unintended modifications were introduced

Reproduce locally:

cd /path/to/kernel
git fetch origin
git checkout <base-branch>
git cherry-pick a339329727ac
bash kernel-checkers/check-patch-compliance.sh --kernel-src . --base HEAD^ --head HEAD

Verdict

1 blocker to fix: The check-patch-compliance failure must be resolved before merging. Either ensure the patch matches the upstream version exactly, or update the commit message to reflect that this is a modified version (using BACKPORT: prefix instead of FROMLIST:).

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