diff options
author | Lukas Wunner <lukas@wunner.de> | 2023-03-11 17:40:11 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2023-04-18 20:36:58 +0300 |
commit | 022b66f38195f6760c193ceee18e0b676d9c9070 (patch) | |
tree | ba11e36f81f6cd24ba5d9ae45fc48c4fd5571ba1 /drivers/cxl | |
parent | c8fc07abeba5cd14e88a2d77f4c4fed670da9492 (diff) | |
download | linux-022b66f38195f6760c193ceee18e0b676d9c9070.tar.xz |
PCI/DOE: Allow mailbox creation without devres management
DOE mailbox creation is currently only possible through a devres-managed
API. The lifetime of mailboxes thus ends with driver unbinding.
An upcoming commit will create DOE mailboxes upon device enumeration by
the PCI core. Their lifetime shall not be limited by a driver.
Therefore rework pcim_doe_create_mb() into the non-devres-managed
pci_doe_create_mb(). Add pci_doe_destroy_mb() for mailbox destruction
on device removal.
Provide a devres-managed wrapper under the existing pcim_doe_create_mb()
name.
The error path of pcim_doe_create_mb() previously called xa_destroy() if
alloc_ordered_workqueue() failed. That's unnecessary because the xarray
is still empty at that point. It doesn't need to be destroyed until
it's been populated by pci_doe_cache_protocols(). Arrange the error
path of the new pci_doe_create_mb() accordingly.
pci_doe_cancel_tasks() is no longer used as callback for
devm_add_action(), so refactor it to accept a struct pci_doe_mb pointer
instead of a generic void pointer.
Tested-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Ming Li <ming4.li@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/7c9a63867d70233c5e9d26cd8bf956742cd6d650.1678543498.git.lukas@wunner.de
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl')
0 files changed, 0 insertions, 0 deletions