Skip to content

Commit

Permalink
small fix: pmem/ram mess and dcd extent list size bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Fan Ni committed Feb 12, 2024
1 parent d3da9e8 commit 9d24fa6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/cxl/core/hdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,14 @@ int cxl_dpa_set_mode(struct cxl_endpoint_decoder *cxled,
* configuration
*/
switch (mode) {
case CXL_DECODER_RAM:
case CXL_DECODER_PMEM:
if (resource_size(&cxlds->pmem_res) == 0) {
dev_dbg(dev, "no available pmem capacity\n");
rc = -ENXIO;
goto out;
}
break;
case CXL_DECODER_PMEM:
case CXL_DECODER_RAM:
if (resource_size(&cxlds->ram_res) == 0) {
dev_dbg(dev, "no available ram capacity\n");
rc = -ENXIO;
Expand Down
6 changes: 4 additions & 2 deletions drivers/cxl/core/mbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -1102,9 +1102,11 @@ static int cxl_send_dc_cap_response(struct cxl_memdev_state *mds,
dc_res->extent_list[0].dpa_start = cpu_to_le64(extent->start);
memset(dc_res->extent_list[0].reserved, 0, 8);
dc_res->extent_list[0].length = cpu_to_le64(range_len(extent));
}
dc_res->extent_list_size = cpu_to_le32(1);
} else {
dc_res->extent_list_size = cpu_to_le32(0);
}

dc_res->extent_list_size = cpu_to_le32(1);
mbox_cmd = (struct cxl_mbox_cmd) {
.opcode = opcode,
.size_in = size,
Expand Down

0 comments on commit 9d24fa6

Please sign in to comment.