Skip to content

Commit 0f6f0d6

Browse files
weiny2davejiang
authored andcommitted
cxl/pci: Delay event buffer allocation
The event buffer does not need to be allocated if something has failed in setting up event irq's. In prep for adjusting event configuration for DCD events move the buffer allocation to the end of the event configuration. Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Fan Ni <fan.ni@samsung.com> Reviewed-by: Li Ming <ming4.li@intel.com> Link: https://lore.kernel.org/all/663922b475e50_d54d72945b@dwillia2-xfh.jf.intel.com.notmuch/ [1] Suggested-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Link: https://patch.msgid.link/20241107-dcd-type2-upstream-v7-4-56a84e66bc36@intel.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent f88b3ec commit 0f6f0d6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/cxl/pci.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,10 +764,6 @@ static int cxl_event_config(struct pci_host_bridge *host_bridge,
764764
return 0;
765765
}
766766

767-
rc = cxl_mem_alloc_event_buf(mds);
768-
if (rc)
769-
return rc;
770-
771767
rc = cxl_event_get_int_policy(mds, &policy);
772768
if (rc)
773769
return rc;
@@ -781,6 +777,10 @@ static int cxl_event_config(struct pci_host_bridge *host_bridge,
781777
return -EBUSY;
782778
}
783779

780+
rc = cxl_mem_alloc_event_buf(mds);
781+
if (rc)
782+
return rc;
783+
784784
rc = cxl_event_irqsetup(mds);
785785
if (rc)
786786
return rc;

0 commit comments

Comments
 (0)