cxl/mbox: Initialize the poison state
authorAlison Schofield <alison.schofield@intel.com>
Tue, 18 Apr 2023 17:39:03 +0000 (10:39 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sun, 23 Apr 2023 18:45:26 +0000 (11:45 -0700)
commitd0abf5787adc0341a04667d3b4a23b4d0999af30
tree0f20372836d7d4dc3a5e76daee16712520869ccd
parentdec441d32a9a1e4a891ccda3356cac61cc1ffe79
cxl/mbox: Initialize the poison state

Driver reads of the poison list are synchronized to ensure that a
reader does not get an incomplete list because their request
overlapped (was interrupted or preceded by) another read request
of the same DPA range. (CXL Spec 3.0 Section 8.2.9.8.4.1). The
driver maintains state information to achieve this goal.

To initialize the state, first recognize the poison commands in
the CEL (Command Effects Log). If the device supports Get Poison
List, allocate a single buffer for the poison list and protect it
with a lock.

Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Link: https://lore.kernel.org/r/9078d180769be28a5087288b38cdfc827cae58bf.1681838291.git.alison.schofield@intel.com
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/mbox.c
drivers/cxl/cxlmem.h
drivers/cxl/pci.c