cxl/mbox: Add exclusive kernel command support
authorDan Williams <dan.j.williams@intel.com>
Tue, 14 Sep 2021 19:03:04 +0000 (12:03 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 21 Sep 2021 20:44:57 +0000 (13:44 -0700)
commit12f3856ad42d6ce0dbd4266e105c04ae999f908c
tree6fb0e896a522491e6015c7f326b5573e92cd16b8
parentff56ab9e164d71c4a6ae33fc61ae856faec265a1
cxl/mbox: Add exclusive kernel command support

The CXL_PMEM driver expects exclusive control of the label storage area
space. Similar to the LIBNVDIMM expectation that the label storage area
is only writable from userspace when the corresponding memory device is
not active in any region, the expectation is the native CXL_PCI UAPI
path is disabled while the cxl_nvdimm for a given cxl_memdev device is
active in LIBNVDIMM.

Add the ability to toggle the availability of a given command for the
UAPI path. Use that new capability to shutdown changes to partitions and
the label storage area while the cxl_nvdimm device is actively proxying
commands for LIBNVDIMM.

Reviewed-by: Ben Widawsky <ben.widawsky@intel.com>
Link: https://lore.kernel.org/r/163164579468.2830966.6980053377428474263.stgit@dwillia2-desk3.amr.corp.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/pmem.c