summaryrefslogtreecommitdiff
path: root/drivers/cxl/pci.c
diff options
context:
space:
mode:
authorIra Weiny <ira.weiny@intel.com>2021-06-03 17:53:16 -0700
committerDan Williams <dan.j.williams@intel.com>2021-06-05 17:38:45 -0700
commit9a016527dcb71e2ecadfeacf52122a79b428790c (patch)
treee5ac0fc2ca3323e9a6ae003ec91bbd530e2e3cbd /drivers/cxl/pci.c
parent30af97296f48d84bc4a6abbaabb92c796a84ca57 (diff)
cxl/pci: Reserve individual register block regions
Some hardware implementations mix component and device registers into the same BAR and the driver stack is going to need independent mapping implementations for those 2 cases. Furthermore, it will be nice to have finer grained mappings should user space want to map some register blocks. Now that individual register blocks are mapped; those blocks regions should be reserved individually to fully separate the register blocks. Release the 'global' memory reservation and create individual register block region reservations through devm. NOTE: pci_release_mem_regions() is still compatible with pcim_enable_device() because it removes the automatic region release when called. So preserve the pcim_enable_device() so that the pcim interface can be called if needed. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Link: https://lore.kernel.org/r/20210604005316.4187340-1-ira.weiny@intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl/pci.c')
-rw-r--r--drivers/cxl/pci.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
index 3ffd5fad74b4..e1a2dbc2886b 100644
--- a/drivers/cxl/pci.c
+++ b/drivers/cxl/pci.c
@@ -1110,6 +1110,8 @@ static int cxl_mem_setup_regs(struct cxl_mem *cxlm)
goto free_maps;
}
+ pci_release_mem_regions(pdev);
+
list_for_each_entry(map, &register_maps, list) {
ret = cxl_map_regs(cxlm, map);
if (ret)