Commit ead6fa95 authored by Ingo Molnar's avatar Ingo Molnar

Merge tag 'edac_fixes_for_3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp into x86/ras

Pull RAS fixes from Boris Petkov:

 "Two fixlets for Erratum 505 ranges and overflowing variables."
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents c874b6ba 4fc06b31
...@@ -206,8 +206,8 @@ static int amd64_set_scrub_rate(struct mem_ctl_info *mci, u32 bw) ...@@ -206,8 +206,8 @@ static int amd64_set_scrub_rate(struct mem_ctl_info *mci, u32 bw)
if (pvt->fam == 0xf) if (pvt->fam == 0xf)
min_scrubrate = 0x0; min_scrubrate = 0x0;
/* Erratum #505 for F15h Model 0x00 - Model 0x01, Stepping 0 */ /* Erratum #505 */
if (pvt->fam == 0x15 && pvt->model <= 0x01 && pvt->stepping < 0x1) if (pvt->fam == 0x15 && pvt->model < 0x10)
f15h_select_dct(pvt, 0); f15h_select_dct(pvt, 0);
return __amd64_set_scrub_rate(pvt->F3, bw, min_scrubrate); return __amd64_set_scrub_rate(pvt->F3, bw, min_scrubrate);
...@@ -219,8 +219,8 @@ static int amd64_get_scrub_rate(struct mem_ctl_info *mci) ...@@ -219,8 +219,8 @@ static int amd64_get_scrub_rate(struct mem_ctl_info *mci)
u32 scrubval = 0; u32 scrubval = 0;
int i, retval = -EINVAL; int i, retval = -EINVAL;
/* Erratum #505 for F15h Model 0x00 - Model 0x01, Stepping 0 */ /* Erratum #505 */
if (pvt->fam == 0x15 && pvt->model <= 0x01 && pvt->stepping < 0x1) if (pvt->fam == 0x15 && pvt->model < 0x10)
f15h_select_dct(pvt, 0); f15h_select_dct(pvt, 0);
amd64_read_pci_cfg(pvt->F3, SCRCTRL, &scrubval); amd64_read_pci_cfg(pvt->F3, SCRCTRL, &scrubval);
...@@ -1558,11 +1558,12 @@ static int f15_m30h_match_to_this_node(struct amd64_pvt *pvt, unsigned range, ...@@ -1558,11 +1558,12 @@ static int f15_m30h_match_to_this_node(struct amd64_pvt *pvt, unsigned range,
} }
/* Verify sys_addr is within DCT Range. */ /* Verify sys_addr is within DCT Range. */
dct_base = (dct_sel_baseaddr(pvt) << 27); dct_base = (u64) dct_sel_baseaddr(pvt);
dct_limit = (((dct_cont_limit_reg >> 11) & 0x1FFF) << 27) | 0x7FFFFFF; dct_limit = (dct_cont_limit_reg >> 11) & 0x1FFF;
if (!(dct_cont_base_reg & BIT(0)) && if (!(dct_cont_base_reg & BIT(0)) &&
!(dct_base <= sys_addr && dct_limit >= sys_addr)) !(dct_base <= (sys_addr >> 27) &&
dct_limit >= (sys_addr >> 27)))
return -EINVAL; return -EINVAL;
/* Verify number of dct's that participate in channel interleaving. */ /* 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,7 +1585,7 @@ static int f15_m30h_match_to_this_node(struct amd64_pvt *pvt, unsigned range,
if (leg_mmio_hole && (sys_addr >= BIT_64(32))) if (leg_mmio_hole && (sys_addr >= BIT_64(32)))
chan_offset = dhar_offset; chan_offset = dhar_offset;
else else
chan_offset = dct_base; chan_offset = dct_base << 27;
chan_addr = sys_addr - chan_offset; chan_addr = sys_addr - chan_offset;
...@@ -1614,7 +1615,7 @@ static int f15_m30h_match_to_this_node(struct amd64_pvt *pvt, unsigned range, ...@@ -1614,7 +1615,7 @@ static int f15_m30h_match_to_this_node(struct amd64_pvt *pvt, unsigned range,
amd64_read_pci_cfg(pvt->F1, amd64_read_pci_cfg(pvt->F1,
DRAM_CONT_HIGH_OFF + (int) channel * 4, DRAM_CONT_HIGH_OFF + (int) channel * 4,
&tmp); &tmp);
chan_addr += ((tmp >> 11) & 0xfff) << 27; chan_addr += (u64) ((tmp >> 11) & 0xfff) << 27;
} }
f15h_select_dct(pvt, channel); f15h_select_dct(pvt, channel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment