diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2009-09-18 06:39:19 -0400 |
---|---|---|
committer | Borislav Petkov <borislav.petkov@amd.com> | 2009-10-07 10:49:43 -0400 |
commit | 8edc5445895dbcf050d6e8ac5488f70a3937753a (patch) | |
tree | 37ac989f065b4a5f73cafefb26685d6e9881702e /drivers/edac/amd64_edac.c | |
parent | 72f158fe6fc2033ceb0f3e0e9e5c2aa356fed6da (diff) |
amd64_edac: fix K8 intlv_sel check
The check when DRAM interleaving is enabled should be done against the
pvt->dram_IntlvSel field and not against the ->dram_limit.
Simplify first loop and fixup printk formatting while at it.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac/amd64_edac.c')
-rw-r--r-- | drivers/edac/amd64_edac.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 854c7c125035..2c869d1fe334 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
@@ -279,14 +279,11 @@ static struct mem_ctl_info *find_mc_by_sys_addr(struct mem_ctl_info *mci, | |||
279 | intlv_en = pvt->dram_IntlvEn[0]; | 279 | intlv_en = pvt->dram_IntlvEn[0]; |
280 | 280 | ||
281 | if (intlv_en == 0) { | 281 | if (intlv_en == 0) { |
282 | for (node_id = 0; ; ) { | 282 | for (node_id = 0; node_id < DRAM_REG_COUNT; node_id++) { |
283 | if (amd64_base_limit_match(pvt, sys_addr, node_id)) | 283 | if (amd64_base_limit_match(pvt, sys_addr, node_id)) |
284 | break; | 284 | goto found; |
285 | |||
286 | if (++node_id >= DRAM_REG_COUNT) | ||
287 | goto err_no_match; | ||
288 | } | 285 | } |
289 | goto found; | 286 | goto err_no_match; |
290 | } | 287 | } |
291 | 288 | ||
292 | if (unlikely((intlv_en != 0x01) && | 289 | if (unlikely((intlv_en != 0x01) && |
@@ -301,7 +298,7 @@ static struct mem_ctl_info *find_mc_by_sys_addr(struct mem_ctl_info *mci, | |||
301 | bits = (((u32) sys_addr) >> 12) & intlv_en; | 298 | bits = (((u32) sys_addr) >> 12) & intlv_en; |
302 | 299 | ||
303 | for (node_id = 0; ; ) { | 300 | for (node_id = 0; ; ) { |
304 | if ((pvt->dram_limit[node_id] & intlv_en) == bits) | 301 | if ((pvt->dram_IntlvSel[node_id] & intlv_en) == bits) |
305 | break; /* intlv_sel field matches */ | 302 | break; /* intlv_sel field matches */ |
306 | 303 | ||
307 | if (++node_id >= DRAM_REG_COUNT) | 304 | if (++node_id >= DRAM_REG_COUNT) |
@@ -311,10 +308,10 @@ static struct mem_ctl_info *find_mc_by_sys_addr(struct mem_ctl_info *mci, | |||
311 | /* sanity test for sys_addr */ | 308 | /* sanity test for sys_addr */ |
312 | if (unlikely(!amd64_base_limit_match(pvt, sys_addr, node_id))) { | 309 | if (unlikely(!amd64_base_limit_match(pvt, sys_addr, node_id))) { |
313 | amd64_printk(KERN_WARNING, | 310 | amd64_printk(KERN_WARNING, |
314 | "%s(): sys_addr 0x%lx falls outside base/limit " | 311 | "%s(): sys_addr 0x%llx falls outside base/limit " |
315 | "address range for node %d with node interleaving " | 312 | "address range for node %d with node interleaving " |
316 | "enabled.\n", __func__, (unsigned long)sys_addr, | 313 | "enabled.\n", |
317 | node_id); | 314 | __func__, sys_addr, node_id); |
318 | return NULL; | 315 | return NULL; |
319 | } | 316 | } |
320 | 317 | ||