Skip to content

FROMLIST: PCI: qcom: Handle mixed PERST#/PHY DT configuration#786

Open
ziyuezhang-123 wants to merge 2 commits into
qualcomm-linux:qcom-6.18.yfrom
ziyuezhang-123:for-6.18/pci-qcom-handle-mixed-perst-phy-dt-config
Open

FROMLIST: PCI: qcom: Handle mixed PERST#/PHY DT configuration#786
ziyuezhang-123 wants to merge 2 commits into
qualcomm-linux:qcom-6.18.yfrom
ziyuezhang-123:for-6.18/pci-qcom-handle-mixed-perst-phy-dt-config

Conversation

@ziyuezhang-123

Copy link
Copy Markdown

Some platforms have a mixed DT configuration where PERST# is described
in the Root Complex node (using 'perst-gpios') while PHY is described in
the PCIe port nodes. The current code only handles the case where PERST#
is in the port nodes (via 'reset-gpios').

Handle this mixed configuration by checking for 'perst-gpios' in the Root
Complex node first. If found, reuse that GPIO descriptor for all ports
instead of parsing 'reset-gpios' from individual port nodes.

Emit a warning to indicate that the DT needs to be fixed to use the
standard 'reset-gpios' in port nodes.

Note: This patch depends on 'PCI: qcom: Parse PERST# from all PCIe bridge
nodes' (PR #785).

Signed-off-by: Qiang Yu qiang.yu@oss.qualcomm.com

Link: https://lore.kernel.org/all/20260508-mix_perst_phy_dts-v1-1-9eff6ee9b51a@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/
Some platforms have a mixed DT configuration where PERST# is described
in the Root Complex node (using 'perst-gpios') while PHY is described in
the PCIe port nodes. The current code only handles the case where PERST#
is in the port nodes (via 'reset-gpios').

Handle this mixed configuration by checking for 'perst-gpios' in the Root
Complex node first. If found, reuse that GPIO descriptor for all ports
instead of parsing 'reset-gpios' from individual port nodes.

Emit a warning to indicate that the DT needs to be fixed to use the
standard 'reset-gpios' in port nodes.

Signed-off-by: Qiang Yu <qiang.yu@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260508-mix_perst_phy_dts-v1-1-9eff6ee9b51a@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 #786 — validate-patch

PR: #786

Verdict Issues Detailed Report
⚠️ 0 Full report

Final Summary

  1. Lore link present: Yes — both patches include lore.kernel.org links in commit messages
  2. Lore link matches PR commits: ⚠️ Cannot verify — network restrictions prevent fetching upstream patches for comparison
  3. Upstream patch status: ⚠️ Unknown — cannot query lore.kernel.org or git.kernel.org due to network restrictions
  4. PR present in qcom-next: Not checked — no kernel tree available in current environment

Note: This validation is limited by network restrictions. A complete validation requires:

  • Fetching patches from lore.kernel.org to verify diff matching
  • Checking upstream git trees for merge status
  • Verifying commit date consistency with upstream submission timeline
Verdict: ⚠️ — click to expand

🔍 Patch Validation

PR: #786
Commits: 2 patches
Verdict: ⚠️ PARTIAL


Patch 1/2: 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/

Commit Message

Check Status Note
Subject matches upstream ⚠️ Cannot verify - network restricted; subject appears well-formed
Body preserves rationale Comprehensive explanation of the change and 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) FROMLIST: prefix indicates upstream submission status

Diff Analysis

File Status Notes
drivers/pci/controller/dwc/pcie-qcom.c Refactors PERST# parsing to support all PCIe bridge nodes

Key Changes:

  • Introduces struct qcom_pcie_perst to track PERST# GPIOs per port
  • Refactors qcom_pcie_port to use list of PERST# descriptors instead of single GPIO
  • Adds recursive qcom_pcie_parse_perst() function for depth-first parsing
  • Updates __qcom_pcie_perst_assert() to iterate over all PERST# GPIOs
  • Changes error code from -ENOENT to -ENODEV for consistency
  • Adds proper cleanup in error paths

Code Quality:

  • ✅ Proper list initialization and management
  • ✅ Error handling for shared PERST# (currently unsupported, documented in comment)
  • ✅ Maintains backward compatibility via legacy binding path
  • ✅ Consistent coding style

Patch 2/2: FROMLIST: PCI: qcom: Handle mixed PERST#/PHY DT configuration

Upstream commit: https://lore.kernel.org/all/20260508-mix_perst_phy_dts-v1-1-9eff6ee9b51a@oss.qualcomm.com/

Commit Message

Check Status Note
Subject matches upstream ⚠️ Cannot verify - network restricted; subject appears well-formed
Body preserves rationale Clear explanation of mixed DT configuration handling
Fixes tag present/correct N/A No Fixes tag (enhancement, not bugfix)
Authorship preserved Qiang Yu qiang.yu@oss.qualcomm.com
Backport note (if applicable) FROMLIST: prefix indicates upstream submission status

Diff Analysis

File Status Notes
drivers/pci/controller/dwc/pcie-qcom.c Adds support for legacy 'perst-gpios' in Root Complex node

Key Changes:

  • Adds struct gpio_desc *reset to struct qcom_pcie
  • Checks for 'perst-gpios' in Root Complex node before parsing port nodes
  • Reuses Root Complex PERST# GPIO for all ports if found
  • Emits warning to indicate DT needs fixing

Code Quality:

  • ✅ Backward compatibility maintained
  • ✅ Clear warning message for deprecated DT pattern
  • ✅ Proper error handling with IS_ERR() check
  • ✅ Uses devm_gpiod_get_optional() appropriately

Issues

Patch 1/2

  • ⚠️ Date anomaly: Commit date is "Tue, 16 Dec 2025" which is in the future relative to patch submission but past relative to current date (2026-06-30). This suggests the patch may have been rebased or cherry-picked.
  • ⚠️ Upstream verification blocked: Cannot verify diff matches lore.kernel.org due to network restrictions.

Patch 2/2

  • ⚠️ Lore link date mismatch: Link shows "20260508" (May 8, 2026) but commit date is "Tue, 30 Jun 2026". The commit date is ~2 months after the lore submission, which could indicate a rebase or amendment.
  • ⚠️ Upstream verification blocked: Cannot verify diff matches lore.kernel.org due to network restrictions.
  • ⚠️ Dependency: This patch depends on patch 1/2 (uses qcom_pcie_parse_perst() function introduced in patch 1).

General

  • ⚠️ Network restrictions: Unable to fetch upstream patches from lore.kernel.org to verify byte-for-byte diff matching.
  • ⚠️ Upstream status unknown: Cannot verify if patches have been accepted/merged upstream.

Verdict

Merge recommendation: ⚠️ CONDITIONAL APPROVAL

Rationale:

  1. Both patches appear technically sound with proper error handling and coding style
  2. Commit messages are well-written with clear rationale
  3. FROMLIST: prefix correctly indicates upstream submission status
  4. Changes maintain backward compatibility
  5. However: Date inconsistencies and inability to verify against upstream due to network restrictions require manual review

Required actions before merge:

  1. Verify patches match upstream lore.kernel.org versions byte-for-byte
  2. Confirm upstream acceptance status (merged/pending/rejected)
  3. Resolve date inconsistencies in commit metadata
  4. Verify patch ordering and dependencies are correct

Final Summary

  1. Lore link present: Yes — both patches include lore.kernel.org links in commit messages
  2. Lore link matches PR commits: ⚠️ Cannot verify — network restrictions prevent fetching upstream patches for comparison
  3. Upstream patch status: ⚠️ Unknown — cannot query lore.kernel.org or git.kernel.org due to network restrictions
  4. PR present in qcom-next: Not checked — no kernel tree available in current environment

Note: This validation is limited by network restrictions. A complete validation requires:

  • Fetching patches from lore.kernel.org to verify diff matching
  • Checking upstream git trees for merge status
  • Verifying commit date consistency with upstream submission timeline

@qlijarvis

Copy link
Copy Markdown

PR #786 — checker-log-analyzer

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

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 sparse warnings
check-uapi-headers No UAPI header changes
check-patch-compliance FAILED - patch differs from upstream Link
tag-check N/A Not applicable for qcom-6.18.y
qcom-next-check FROMLIST: prefix correct

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #786 - PCI: qcom: Parse PERST# from all PCIe bridge nodes + Handle mixed PERST#/PHY DT configuration
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/28416444677

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 sparse warnings
check-uapi-headers No UAPI header changes
check-patch-compliance FAILED - patch differs from upstream Link
tag-check N/A Not applicable for qcom-6.18.y
qcom-next-check FROMLIST: prefix correct

❌ check-patch-compliance

Root cause: The first commit in the PR has diverged from the upstream patch referenced in its Link tag.

Failure details:

Checking commit: FROMLIST: PCI: qcom: Parse PERST# from all PCIe bridge nodes
Change is different from the one mentioned in Link

The checker compared the local commit a339329727ac against the upstream patch at:

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

The diff shows the PR patch has 103 lines changed (86 insertions, 17 deletions), but the upstream link may have a different version or the patch was modified after being pulled from the mailing list.

Fix:

  1. Verify the upstream patch version:

    b4 am 20251216-pci-pwrctrl-rework-v2-1-745a563b9be6@oss.qualcomm.com

    Compare the downloaded patch with the PR commit to identify differences.

  2. If the patch was intentionally modified:

    • Remove the FROMLIST: prefix and use BACKPORT: instead
    • Add a note in the commit message explaining the modification
    • Update the Link tag if a newer version exists upstream
  3. If the patch should match upstream exactly:

    • Re-apply the upstream patch cleanly using b4 am + git am
    • Ensure no local modifications were introduced
  4. If upstream has been updated to v3 or later:

    • Update the Link tag to point to the latest version
    • Rebase the commit on the latest upstream version

Reproduce locally:

cd /path/to/kernel
git fetch origin qcom-6.18.y
git checkout qcom-6.18.y
git fetch origin pull/786/head:pr-786
git checkout pr-786

# Run the compliance checker
bash kernel-checkers/check-patch-compliance.sh \
  --kernel-src . \
  --base origin/qcom-6.18.y \
  --head HEAD

Verdict

1 blocker must be fixed before merge:

The check-patch-compliance failure indicates the PR commit does not match the upstream patch referenced in the Link tag. This violates the FROMLIST: tag policy, which requires patches to be byte-for-byte identical to their upstream counterparts (except for context differences due to base tree variations).

Action required: Verify whether the patch was intentionally modified or if the Link tag points to an outdated version. Update accordingly.

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.

4 participants