aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/edac/amd64_edac.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 6952d432e62b..3c9e4e98c651 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -1558,11 +1558,12 @@ static int f15_m30h_match_to_this_node(struct amd64_pvt *pvt, unsigned range,
1558 } 1558 }
1559 1559
1560 /* Verify sys_addr is within DCT Range. */ 1560 /* Verify sys_addr is within DCT Range. */
1561 dct_base = (dct_sel_baseaddr(pvt) << 27); 1561 dct_base = (u64) dct_sel_baseaddr(pvt);
1562 dct_limit = (((dct_cont_limit_reg >> 11) & 0x1FFF) << 27) | 0x7FFFFFF; 1562 dct_limit = (dct_cont_limit_reg >> 11) & 0x1FFF;
1563 1563
1564 if (!(dct_cont_base_reg & BIT(0)) && 1564 if (!(dct_cont_base_reg & BIT(0)) &&
1565 !(dct_base <= sys_addr && dct_limit >= sys_addr)) 1565 !(dct_base <= (sys_addr >> 27) &&
1566 dct_limit >= (sys_addr >> 27)))
1566 return -EINVAL; 1567 return -EINVAL;
1567 1568
1568 /* Verify number of dct's that participate in channel interleaving. */ 1569 /* Verify number of dct's that participate in channel interleaving. */
@@ -1584,7 +1585,7 @@ static int f15_m30h_match_to_this_node(struct amd64_pvt *pvt, unsigned range,
1584 if (leg_mmio_hole && (sys_addr >= BIT_64(32))) 1585 if (leg_mmio_hole && (sys_addr >= BIT_64(32)))
1585 chan_offset = dhar_offset; 1586 chan_offset = dhar_offset;
1586 else 1587 else
1587 chan_offset = dct_base; 1588 chan_offset = dct_base << 27;
1588 1589
1589 chan_addr = sys_addr - chan_offset; 1590 chan_addr = sys_addr - chan_offset;
1590 1591
@@ -1614,7 +1615,7 @@ static int f15_m30h_match_to_this_node(struct amd64_pvt *pvt, unsigned range,
1614 amd64_read_pci_cfg(pvt->F1, 1615 amd64_read_pci_cfg(pvt->F1,
1615 DRAM_CONT_HIGH_OFF + (int) channel * 4, 1616 DRAM_CONT_HIGH_OFF + (int) channel * 4,
1616 &tmp); 1617 &tmp);
1617 chan_addr += ((tmp >> 11) & 0xfff) << 27; 1618 chan_addr += (u64) ((tmp >> 11) & 0xfff) << 27;
1618 } 1619 }
1619 1620
1620 f15h_select_dct(pvt, channel); 1621 f15h_select_dct(pvt, channel);