@@ -1112,6 +1112,7 @@ struct addr_ctx {
u8 intlv_num_sockets;
u8 cs_id;
u8 node_id_shift;
+ bool late_hole_remove;
int (*dehash_addr)(struct addr_ctx *ctx);
void (*make_space_for_cs_id)(struct addr_ctx *ctx);
void (*insert_cs_id)(struct addr_ctx *ctx);
@@ -1676,7 +1677,7 @@ static int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr
return -EINVAL;
}
- if (add_base_and_hole(&ctx)) {
+ if (!ctx.late_hole_remove && add_base_and_hole(&ctx)) {
pr_debug("Failed to add DRAM base address and hole");
return -EINVAL;
}
@@ -1686,6 +1687,11 @@ static int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr
return -EINVAL;
}
+ if (ctx.late_hole_remove && add_base_and_hole(&ctx)) {
+ pr_debug("Failed to add DRAM base address and hole");
+ return -EINVAL;
+ }
+
if (addr_over_limit(&ctx)) {
pr_debug("Calculated address is over limit");
return -EINVAL;