diff options
| author | 2026-08-30 14:16:20 +0300 | |
|---|---|---|
| committer | 2026-10-09 14:13:24 -0500 | |
| commit | 1b82c6657e957f598b6e19e045e0bbd5cb370083 (patch) | |
| tree | bceb391d16112bf11a6e8a1914e4632e97c0884f /scripts/Makefile.thinlto | |
| parent | PCI/P2PDMA: Do not tear down the allocate attribute on registration failure (diff) | |
PCI/P2PDMA: Wait for RCU readers before freeing state
pci_p2pmem_find_many() scans all PCI devices without locking or protection
against driver unbind, including devices with poolless P2PDMA state.
pci_has_p2pmem() may observe pdev->p2pdma just before driver unbind clears
it, while pci_p2pdma_release() skips the grace period when no pool is
present. This allows devres to free the object while it is still in use.
Clear the pointer with RCU_INIT_POINTER() and always wait for pre-existing
RCU readers before returning. The same grace period continues to protect
gen_pool users for pool-backed providers.
Fixes: 372d6d1b8ae3 ("PCI/P2PDMA: Refactor to separate core P2P functionality from memory allocation")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Tushar Dave <tdave@nvidia.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Cc: Alex Williamson <alex@shazbot.org>
Cc: Matt Evans <matt@ozlabs.org>
Link: https://patch.msgid.link/20260830-batch-p2p-fixes-v1-2-5044e8dfbe2e@nvidia.com
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
