Re: [PATCH v5] PCI: rcar-gen4: Add missing PM ops
From: Manivannan Sadhasivam
Date: Sat Oct 17 2026 - 01:19:01 EST
On Sun, Oct 04, 2026 at 03:18:13AM +0200, Marek Vasut wrote:
> 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.
>
In the future, if any one of your Endpoint didn't allow the link to enter L2,
then you need to set the 'suspend_poweroff' flag for V4M or other SoCs which
pulls the plug during suspend:
https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?id=f845c1e2d2d4506802244ea2a378ae7b04e90bfe
> 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")
Note that I changed this fixes tag to below while applying:
Fixes: 0270dbe4f891 ("arm64: dts: renesas: r8a779h0: Add PCIe Host and Endpoint nodes")
to reflect the fact that the V4M support is what caused the issue, not the
initial driver support.
- Mani
--
மணிவண்ணன் சதாசிவம்