Skip to content

PCI: tegra194: Fix EP and Root Port corner cases

Manikanta Maddireddy linux-pci linux-tegra lkml 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest10 patches 0 repliesNew
  2. v210 patches 11 repliesSuperseded
  3. v111 patches 13 repliesSuperseded

Changes in v3 from the cover letter

- Rebase onto the current PCI main-based stack after the DWC register-field cleanup series. Patches 1-8 and 10 have no code changes from v2.
- Rework patch 9 and rename it to "Enable core monitor clock after link setup". Set the core clock rate to 500 MHz before enabling it, program the controller, train the link, select the negotiated-speed core rate, and then enable the monitor clock.
- Propagate initial and negotiated core rate-setting errors and monitor enable failures. Keep monitor operations out of the host initialization callback and DLF retry path, and release the monitor during remove, suspend and shutdown without a separate reference-state flag.
- Expand patch 9's explanation of the Boot and Power Management Processor (BPMP) firmware voltage requirement and false frequency-monitor faults during rate transitions.
- Retain Frank Li's Reviewed-by tags from v2 on unchanged patches 1-8 and 10.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10PCI: tegra194: Propagate REFCLK select GPIO errorsdrivers/pci/controller/dwc/pcie-tegra194.c+3 -120 replies
2/10PCI: tegra194: Check core reset deassertiondrivers/pci/controller/dwc/pcie-tegra194.c+20 -30 replies
3/10PCI: tegra194: Fix Endpoint PERST# IRQ suspend racedrivers/pci/controller/dwc/pcie-tegra194.c+22 -120 replies
4/10PCI: tegra194: Do not skip no-link Root Port remove cleanupdrivers/pci/controller/dwc/pcie-tegra194.c+7 -70 replies
5/10PCI: tegra194: Check for 16 GT/s capability before programmingdrivers/pci/controller/dwc/pcie-tegra194.c+10 -60 replies
6/10PCI: tegra194: Check for L1SS capability before programmingdrivers/pci/controller/dwc/pcie-tegra194.c+41 -310 replies
7/10PCI: tegra194: Always disable Tegra234 Endpoint L1.2drivers/pci/controller/dwc/pcie-tegra194.c+28 -190 replies
8/10PCI: tegra194: Guard Endpoint PLL-off error pathdrivers/pci/controller/dwc/pcie-tegra194.c+2 -10 replies
9/10PCI: tegra194: Enable core monitor clock after link setupdrivers/pci/controller/dwc/pcie-tegra194.c+36 -150 replies
10/10PCI: tegra194: Reject zero MSI interrupt numberdrivers/pci/controller/dwc/pcie-tegra194.c+1 -10 replies

Reviews trailers per patch

9 of 10 patches have a Reviewed-by or Acked-by.

PatchFrank Li
1/10R-b
2/10R-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/10] PCI: tegra194: Fix EP and Root Port corner cases

This series fixes a set of independent Tegra194/Tegra234 PCIe controller issues found while testing Root Port and Endpoint flows.

The Root Port fixes tighten probe/remove and suspend/resume error handling:
propagate optional GPIO failures, check reset deassertion, avoid skipping cleanup when no link came up, and enable the optional core monitor clock only after link setup and final core clock rate selection.

The Endpoint fixes cover PERST# IRQ suspend handling, PHY/PLL error unwinds, capability checks before programming optional PCIe extended capabilities, hiding Tegra234 EP L1.2 advertisement for the documented hardware limitation, and rejecting invalid MSI interrupt number zero.

The patches are ordered from low-level error handling toward Endpoint capability checks and MSI validation. MSI-X enablement, MSI-X doorbell changes and fixed MSI-X table handling are deferred; MSI-X remains disabled in the Tegra EPC features.

Changes in v3:
- Rebase onto the current PCI main-based stack after the DWC register-field cleanup series. Patches 1-8 and 10 have no code changes from v2.
- Rework patch 9 and rename it to "Enable core monitor clock after link setup". Set the core clock rate to 500 MHz before enabling it, program the controller, train the link, select the negotiated-speed core rate, and then enable the monitor clock.
- Propagate initial and negotiated core rate-setting errors and monitor enable failures. Keep monitor operations out of the host initialization callback and DLF retry path, and release the monitor during remove, suspend and shutdown without a separate reference-state flag.
- Expand patch 9's explanation of the Boot and Power Management Processor (BPMP) firmware voltage requirement and false frequency-monitor faults during rate transitions.
- Retain Frank Li's Reviewed-by tags from v2 on unchanged patches 1-8 and 10.

Changes in v2:
- Expand the PERST# suspend-race explanation to describe how an IRQ thread can enable the endpoint after the original state check. Explain how disable_irq() drains that thread and preserves the existing suspend policy, and add a synchronization comment.
- Split the MSI-only zero check out of the former MSI/MSI-X patch, with a focused title and commit message. Treat it as defensive validation and omit the Fixes tag from that patch.
- Drop all MSI-X changes and the fixed MSI-X table patch (v1 patch 11), reducing the series from eleven patches to ten.
- Adapt register names to the preceding DWC register-field cleanup series.

Validation reported with v2:
- ARM64 compilation of the Tegra driver passed.
- Checkpatch and whitespace checks passed.
- Tegra PCIe EP link up with pci-epf-test driver.
- pci_endpoint_test
- pci_ep_bar.BAR0.BAR_TEST
- pci_ep_basic.CONSECUTIVE_BAR_TEST
- pci_ep_basic.LEGACY_IRQ_TEST
- pci_ep_basic.MSI_TEST
- pci_ep_data_transfer.memcpy.READ_TEST
- pci_ep_data_transfer.memcpy.WRITE_TEST
- pci_ep_data_transfer.memcpy.COPY_TEST

v2: https://lore.kernel.org/linux-pci/[email protected]/

v1: https://lore.kernel.org/linux-pci/[email protected]/

Manikanta Maddireddy (10):
PCI: tegra194: Propagate REFCLK select GPIO errors
PCI: tegra194: Check core reset deassertion
PCI: tegra194: Fix Endpoint PERST# IRQ suspend race
PCI: tegra194: Do not skip no-link Root Port remove cleanup
PCI: tegra194: Check for 16 GT/s capability before programming
PCI: tegra194: Check for L1SS capability before programming
PCI: tegra194: Always disable Tegra234 Endpoint L1.2
PCI: tegra194: Guard Endpoint PLL-off error path
PCI: tegra194: Enable core monitor clock after link setup
PCI: tegra194: Reject zero MSI interrupt number

 drivers/pci/controller/dwc/pcie-tegra194.c | 239 +++++++++++++--------
 1 file changed, 151 insertions(+), 88 deletions(-)

base-commit: d447e8cfe376cc0cc4db8266d01356d0b3ebb695

Signature · 1 line
2.34.1