cxl/mbox: Move mailbox related driver state to its own data structure
authorDan Williams <dan.j.williams@intel.com>
Thu, 15 Jun 2023 01:30:02 +0000 (18:30 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sun, 25 Jun 2023 21:31:08 +0000 (14:31 -0700)
commit59f8d1510739e92135df62d52e8c29bc075c46ad
treeeefd4686a05a67fa7ea06088cfc5a7fb0a2e1cbf
parent3fe7feb0f37e4dcbd51b9a4019866dc55b965a55
cxl/mbox: Move mailbox related driver state to its own data structure

'struct cxl_dev_state' makes too many assumptions about the capabilities
of a CXL device. In particular it assumes a CXL device has a mailbox and
all of the infrastructure and state that comes along with that.

In preparation for supporting accelerator / Type-2 devices that may not
have a mailbox and in general maintain a minimal core context structure,
make mailbox functionality a super-set of  'struct cxl_dev_state' with
'struct cxl_memdev_state'.

With this reorganization it allows for CXL devices that support HDM
decoder mapping, but not other general-expander / Type-3 capabilities,
to only enable that subset without the rest of the mailbox
infrastructure coming along for the ride.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/168679260240.3436160.15520641540463704524.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/mbox.c
drivers/cxl/core/memdev.c
drivers/cxl/cxlmem.h
drivers/cxl/mem.c
drivers/cxl/pci.c
drivers/cxl/pmem.c
drivers/cxl/security.c
tools/testing/cxl/test/mem.c