diff options
author | Dave Jiang <dave.jiang@intel.com> | 2023-10-16 10:57:48 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2023-10-27 20:29:41 -0700 |
commit | 458ba8189cb4380aa6a6cc4d52ab067f80a64829 (patch) | |
tree | 1f5220e5c47e52604cf9f81f1e7b5db7e9516b1f /drivers/cxl/core/mbox.c | |
parent | 8f61d48c83f6e3525a770e44692604595693f787 (diff) | |
download | linux-stable-458ba8189cb4380aa6a6cc4d52ab067f80a64829.tar.gz linux-stable-458ba8189cb4380aa6a6cc4d52ab067f80a64829.tar.bz2 linux-stable-458ba8189cb4380aa6a6cc4d52ab067f80a64829.zip |
cxl: Add cxl_decoders_committed() helper
Add a helper to retrieve the number of decoders committed for the port.
Replace all the open coding of the calculation with the helper.
Link: https://lore.kernel.org/linux-cxl/651c98472dfed_ae7e729495@dwillia2-xfh.jf.intel.com.notmuch/
Suggested-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Jim Harris <jim.harris@samsung.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Link: https://lore.kernel.org/r/169747906849.272156.1729290904857372335.stgit@djiang5-mobl3
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl/core/mbox.c')
-rw-r--r-- | drivers/cxl/core/mbox.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c index b91bb9886991..b12986b968da 100644 --- a/drivers/cxl/core/mbox.c +++ b/drivers/cxl/core/mbox.c @@ -1200,7 +1200,7 @@ int cxl_mem_sanitize(struct cxl_memdev *cxlmd, u16 cmd) * Require an endpoint to be safe otherwise the driver can not * be sure that the device is unmapped. */ - if (endpoint && endpoint->commit_end == -1) + if (endpoint && cxl_num_decoders_committed(endpoint) == 0) rc = __cxl_mem_sanitize(mds, cmd); else rc = -EBUSY; |