Re: [PATCH v3] PCI: rcar-gen4: Add missing PM ops
From: Koichiro Den <hidden>
Date: 2026-09-09 02:17:37
Also in:
linux-pci, linux-renesas-soc, lkml
On Tue, Sep 08, 2026 at 06:29:24PM +0200, Marek Vasut wrote:
Hello Den-san, On 9/8/26 3:05 AM, Koichiro Den wrote:quoted
On Mon, Sep 07, 2026 at 06:35:22PM +0200, Marek Vasut wrote:quoted
The R-Car Gen4 PCIe controller is part of a power domain. On R-Car S4 and V4H, this is an always-on power domain which is not shut down in suspend. On R-Car V4M, this is a dedicated A2PCIPHY power domain, which is shut down during suspend, and the controller loses state, which prevents the PCIe from working after resume. Fix this by adding generic suspend/resume noirq ops for the controller, which tear the link down on suspend, and restart it on resume. Use the same PM ops on all of R-Car Gen4 to gracefully suspend and resume the PCIe link on V4H and S4 too. Test case which demonstrates the problem on R-Car V4M: " $ hexdump -vC /sys/bus/pci/devices/0000:00:00.0/config > /tmp/pre $ echo s2idle > /sys/power/mem_sleep $ echo platform > /sys/power/pm_test $ echo mem > /sys/power/state $ hexdump -vC /sys/bus/pci/devices/0000:00:00.0/config > /tmp/post $ diff -Naru /tmp/pre /tmp/post ... -00000000 12 19 32 00 07 05 10 00 00 00 04 06 00 00 01 00 +00000000 12 19 32 00 07 05 10 00 00 00 00 ff 00 00 80 00 ^^^^^ Class 0604->00ff " Fixes: 0d0c551011df ("PCI: rcar-gen4: Add R-Car Gen4 PCIe controller support for host mode") Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Reported-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> ---The s2idle test with pm_test=platform now passes in EP mode on S4 Spider even with CONFIG_PCIE_DW_HOST=y. Thanks! Feel free to use the tag for it if it helps. Tested-by: Koichiro Den <redacted>Thank you for your test. I would like to ask -- is the EP side of PCIe link behaving correctly during suspend/resume cycle on your S4 setup ? Does the EP require any special handling during suspend/resume ?
To be clear, what I confirmed was the following: - The panic I observed with v1 no longer occurs with this newer revision. - I could create a vNTB EPF after running the test. - With vNTB/ntb_netdev already connected before the test. ping resumed normally afterwards. Note: I used the suspend test from the commit message on the EP: echo s2idle > /sys/power/mem_sleep && \ echo platform > /sys/power/pm_test && \ echo mem > /sys/power/state Based on these, I believe this patch introduces no regression in EP mode on S4. Any pre-existing EP suspend/resume issues could be addressed separately. Best regards, Koichiro
Thank you for your help ! -- Best regards, Marek Vasut