Re: [PATCH] PCI: dwc: rcar-gen4: Fix potential unclocked access in rcar_gen4_pcie_ep_deinit()
From: Marek Vasut
Date: Thu Aug 20 2026 - 00:10:15 EST
On 8/18/26 7:55 AM, Koichiro Den wrote:
Hello Den-san,
2. It seems to me dw_pcie_ep_init() can fail:
- before pre_init() has run,
- from inside common_init(), or
- after pre_init() has succeeded and written PCIEDMAINTSTSEN_INIT (e.g.
pci_epc_mem_init() fails)
The caller cannot tell which case returned the error. In the first case,
common_init() has not run, while in the last case PCIEDMAINTSTSEN is not 0.
So this seems to me different from what the commit message says. Is
common_deinit() intended to be safe in all three cases?
I hope this is addressed by the introduction of .post_deinit() callback, which makes the endpoint deinit safe in all cases.
The commit message was poorly written, and is rewritten since.
--
Best regards,
Marek Vasut