Re: [RFC][PATCH] PCI: rcar-gen4: Add missing PM ops

From: Marek Vasut

Date: Mon Sep 07 2026 - 11:49:19 EST


On 9/7/26 3:46 PM, Koichiro Den wrote:

Hello Den-san,

I have reproduced the NULL pointer dereference at pci->pp.ops->deinit on R-Car
S4 Spider in EP mode with CONFIG_PCIE_DW_HOST=y.

(I used next-20260904 with this patch and the following fix applied:
"buffer: fix NULL dereference of bh->b_folio in __bh_submit()")

[...]

[drivers/pci/controller/dwc/pcie-designware-host.c]
1225 int dw_pcie_suspend_noirq(struct dw_pcie *pci)
1226 {
...
1286 pci->pp.skip_pwrctrl_off = pme_capable;
1287 dw_pcie_stop_link(pci);
> 1288 if (pci->pp.ops->deinit)
1289 pci->pp.ops->deinit(&pci->pp);
1290

Thank you for your help with the endpoint part.

The fix turns out to be very simple -- the suspend/resume handling is specific to the PCIe controller in RC mode, so I added a conditional to invoke those host (RC) suspend/resume operations only if the controller is in that mode, and I sent a V2.

This RC-only fix in V2 is also in line with what MX6 and DRA7xx PCIe controllers do.

--
Best regards,
Marek Vasut