cxl/region: Validate region mode vs decoder mode
authorDan Williams <dan.j.williams@intel.com>
Fri, 10 Feb 2023 09:05:51 +0000 (01:05 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:07:17 +0000 (17:07 +0000)
commit93d242f63ed39f5742160ddc9b89a5c16e3fd9b6
tree9e0ea2907262152ba803dec862bc58cf557f5a28
parent3b70d45c7ea8e6c4584f497b1bad1dba1c3b9557
cxl/region: Validate region mode vs decoder mode

[ Upstream commit 1b9b7a6fd618239db47a83da39dff9e725a5865a ]

In preparation for a new region mode, do not, for example, allow
'ram' decoders to be assigned to 'pmem' regions and vice versa.

Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
Reviewed-by: Gregory Price <gregory.price@memverge.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Tested-by: Fan Ni <fan.ni@samsung.com>
Link: https://lore.kernel.org/r/167601995111.1924368.7459128614177994602.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Stable-dep-of: 0718588c7aaa ("cxl/region: Do not try to cleanup after cxl_region_setup_targets() fails")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cxl/core/region.c