Skip to content

Commit

Permalink
cxl/region: Fix missing probe failure
Browse files Browse the repository at this point in the history
cxl_region_probe() allows for regions not in the 'commit' state to be
enabled. Fail probe when the region is not committed otherwise the
kernel may indicate that an address range is active when none of the
decoders are active.

Fixes: 8d48817 ("cxl/region: Add region driver boiler plate")
Cc: <stable@vger.kernel.org>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/166993220462.1995348.1698008475198427361.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Dan Williams committed Dec 3, 2022
1 parent b5807c8 commit bf3e5da
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/cxl/core/region.c
Original file line number Diff line number Diff line change
Expand Up @@ -1923,6 +1923,9 @@ static int cxl_region_probe(struct device *dev)
*/
up_read(&cxl_region_rwsem);

if (rc)
return rc;

switch (cxlr->mode) {
case CXL_DECODER_PMEM:
return devm_cxl_add_pmem_region(cxlr);
Expand Down

0 comments on commit bf3e5da

Please sign in to comment.