Skip to content

PCI: rzg3s-host: Add PCIe hotplug support

Claudiu Beznea linux-pci linux-renesas-soc lkml stable 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest14 patches 10 repliesIn review
  2. v69 patches 0 repliesSuperseded
  3. v59 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v48 patches8 repliesSuperseded

Changes in v7 from the cover letter

- added the following fixes patches:
-- PCI: rzg3s-host: Don't mix goto-based unwinding and cleanup helpers -- PCI: rzg3s-host: Create the INTx IRQ domain before setting the chained
handlers
-- PCI: rzg3s-host: Initialize the IRQ domains after the IRQs are masked -- PCI: rzg3s-host: Drop read-modify-write approach for the R/W1C
registers
-- PCI: rzg3s-host: Use cached MSI address in .irq_compose_msi_msg()

- addressed sashiko comments:
-- do not mix goto and __free() cleanup constructs
-- addressed concurrency: b/w different paths calling .reset_root_port()
and b/w IRQ subsystems and .reset_root_port()

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14PCI: rzg3s-host: Follow hardware manual clock/reset initialization orderdrivers/pci/controller/pcie-rzg3s-host.c+21 -190 replies
2/14PCI: rzg3s-host: Fix runtime PM handling in the NOIRQ suspend/resume phasedrivers/pci/controller/pcie-rzg3s-host.c+10 -120 replies
3/14PCI: rzg3s-host: Don't mix goto-based unwinding and cleanup helpersdrivers/pci/controller/pcie-rzg3s-host.c+8 -20 replies
4/14PCI: rzg3s-host: Create the INTx IRQ domain before setting the chained handlersdrivers/pci/controller/pcie-rzg3s-host.c+10 -120 replies
5/14PCI: rzg3s-host: Initialize the IRQ domains after the IRQs are maskeddrivers/pci/controller/pcie-rzg3s-host.c+15 -160 replies
6/14PCI: rzg3s-host: Drop read-modify-write approach for the R/W1C registersdrivers/pci/controller/pcie-rzg3s-host.c+7 -80 replies
7/14PCI: rzg3s-host: Use cached MSI address in .irq_compose_msi_msg()drivers/pci/controller/pcie-rzg3s-host.c+2 -122 replies
8/14PCI: rzg3s-host: Drop nop instructionsdrivers/pci/controller/pcie-rzg3s-host.c+0 -50 replies
9/14PCI: rzg3s-host: Move host configuration code togetherdrivers/pci/controller/pcie-rzg3s-host.c+124 -1240 replies
10/14PCI: rzg3s-host: Move suspend/resume code into dedicated functionsdrivers/pci/controller/pcie-rzg3s-host.c+96 -850 replies
11/14PCI: rzg3s-host: Move IRQ domain setup codedrivers/pci/controller/pcie-rzg3s-host.c+71 -720 replies
12/14PCI: rzg3s-host: Add helper to wait for link updrivers/pci/controller/pcie-rzg3s-host.c+20 -100 replies
13/14PCI: rzg3s-host: Re-enumerate the bus on PCIe link-state changesdrivers/pci/controller/pcie-rzg3s-host.c+303 -180 replies
14/14PCI: rzg3s-host: Add bridge::reset_root_port()drivers/pci/controller/Kconfig drivers/pci/controller/pcie-rzg3s-host.c+167 -180 replies

Reviews trailers per patch

6 of 14 patches have a Reviewed-by or Acked-by.

PatchLad PrabhakarWolfram Sang
SeriesT-b
1/14R-b T-b
2/14R-b T-b
3/14
4/14
5/14
6/14
7/14
8/14R-b T-b
9/14R-b T-b
10/14R-b T-b
11/14R-b T-b
12/14
13/14
14/14

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

Read the v7 thread

Cover letter [PATCH v7 00/14] PCI: rzg3s-host: Add PCIe hotplug support

From: Claudiu Beznea <[email protected]>

Hi,

Series adds hotplug support for the rzg3s-host driver. This is a continuation of the series John posted initially at [1]. Along with it, prerequisites fixes and cleanup patches were added.

Series was tested on RZ/G3S and RZ/G3E boards by generating consecutive link down/up events. The RZ/G3S has an I2C device which, depending on the way it is programmed, it controls the state of the PCIe link. The board has 3 PCIe interface: PCIE_SLOT, M.2 Key E, M.2 Key B. The following script was executed for ~9 hours:

#!/bin/sh

echo performance > /sys/module/pcie_aspm/parameters/policy

while :; do

        i2cset -y 1 0x18 0xf4 0x8 # Link down
        i2cset -y 1 0x18 0xf4 0xc # Link up: PCIE_SLOT (NVMe Micron)
        i2cset -y 1 0x18 0xf4 0x8 # Link down
        i2cset -y 1 0x18 0xf4 0xd # Link up: M.2 Key B (NVMe Transcend)
        i2cset -y 1 0x18 0xf4 0x8 # Link down
        i2cset -y 1 0x18 0xf4 0xb # Link up: M.2 Key E (WiFi AX200)

done

Thank you,
Claudiu

Changes in v7:
- added the following fixes patches:
-- PCI: rzg3s-host: Don't mix goto-based unwinding and cleanup helpers -- PCI: rzg3s-host: Create the INTx IRQ domain before setting the chained
handlers
-- PCI: rzg3s-host: Initialize the IRQ domains after the IRQs are masked -- PCI: rzg3s-host: Drop read-modify-write approach for the R/W1C
registers
-- PCI: rzg3s-host: Use cached MSI address in .irq_compose_msi_msg()

- addressed sashiko comments:
-- do not mix goto and __free() cleanup constructs
-- addressed concurrency: b/w different paths calling .reset_root_port()
and b/w IRQ subsystems and .reset_root_port()

Changes in v6:
- addressed review comments as follows:
- added patch 7/9 ("PCI: rzg3s-host: Add helper to wait for link up")
- adopted the approach from pciehp and saved DSN of the connected device and, based on it, take decision if the bus devices need to be removed + rescanned
- in case of link up and !list_empty(&bus->devices) remove first the devices from the bus and re-scan (adopted the approach from pciehp)
- with the new approach cleared the link IRQ (before enabling it) in probe, and resume paths

Changes in v5:
- collected tags
- added patch 3/9 ("PCI: rzg3s-host: Select PCI_HOST_COMMON")
- addressed sashiko review comments (detailed in individual patches)

Changes in v4:
- simplified comments in patch 2/8
- kept only DL_UpDown changes in patch 7/8
- added patch 8/8 for the .reset_root_port() support

Changes in v3:
- added patches 1-6
- re-worked patch 7 to use struct pci_host_bridge::reset_root_port() API

[1] https://lore.kernel.org/all/[email protected]/

Claudiu Beznea (13):
PCI: rzg3s-host: Follow hardware manual clock/reset initialization
order
PCI: rzg3s-host: Fix runtime PM handling in the NOIRQ suspend/resume
phase
PCI: rzg3s-host: Don't mix goto-based unwinding and cleanup helpers
PCI: rzg3s-host: Create the INTx IRQ domain before setting the chained
handlers
PCI: rzg3s-host: Initialize the IRQ domains after the IRQs are masked
PCI: rzg3s-host: Drop read-modify-write approach for the R/W1C
registers
PCI: rzg3s-host: Use cached MSI address in .irq_compose_msi_msg()
PCI: rzg3s-host: Drop nop instructions
PCI: rzg3s-host: Move host configuration code together
PCI: rzg3s-host: Move suspend/resume code into dedicated functions
PCI: rzg3s-host: Move IRQ domain setup code
PCI: rzg3s-host: Add helper to wait for link up
PCI: rzg3s-host: Add bridge::reset_root_port()

John Madieu (1):
PCI: rzg3s-host: Re-enumerate the bus on PCIe link-state changes

 drivers/pci/controller/Kconfig           |    1 +
 drivers/pci/controller/pcie-rzg3s-host.c | 1260 +++++++++++++++-------
 2 files changed, 851 insertions(+), 410 deletions(-)
Signature · 1 line
2.43.0