From: Borislav Petkov <borislav.petkov@amd.com>
To: <norsk5@yahoo.com>
Cc: <linux-kernel@vger.kernel.org>, <x86@kernel.org>,
Borislav Petkov <borislav.petkov@amd.com>
Subject: [PATCH 06/10] amd64_edac: fix K8 intlv_sel check
Date: Thu, 24 Sep 2009 14:32:44 +0200 [thread overview]
Message-ID: <1253795568-9877-7-git-send-email-borislav.petkov@amd.com> (raw)
In-Reply-To: <1253795568-9877-1-git-send-email-borislav.petkov@amd.com>
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>
---
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 3dfb8e6..3f98ae0 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,
intlv_en = pvt->dram_IntlvEn[0];
if (intlv_en == 0) {
- for (node_id = 0; ; ) {
+ for (node_id = 0; node_id < DRAM_REG_COUNT; node_id++) {
if (amd64_base_limit_match(pvt, sys_addr, node_id))
- break;
-
- if (++node_id >= DRAM_REG_COUNT)
- goto err_no_match;
+ goto found;
}
- goto found;
+ goto err_no_match;
}
if (unlikely((intlv_en != 0x01) &&
@@ -301,7 +298,7 @@ static struct mem_ctl_info *find_mc_by_sys_addr(struct mem_ctl_info *mci,
bits = (((u32) sys_addr) >> 12) & intlv_en;
for (node_id = 0; ; ) {
- if ((pvt->dram_limit[node_id] & intlv_en) == bits)
+ if ((pvt->dram_IntlvSel[node_id] & intlv_en) == bits)
break; /* intlv_sel field matches */
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,
/* sanity test for sys_addr */
if (unlikely(!amd64_base_limit_match(pvt, sys_addr, node_id))) {
amd64_printk(KERN_WARNING,
- "%s(): sys_addr 0x%lx falls outside base/limit "
- "address range for node %d with node interleaving "
- "enabled.\n", __func__, (unsigned long)sys_addr,
- node_id);
+ "%s(): sys_addr 0x%llx falls outside base/limit "
+ "address range for node %d with node interleaving "
+ "enabled.\n",
+ __func__, sys_addr, node_id);
return NULL;
}
--
1.6.3.3
next prev parent reply other threads:[~2009-09-24 12:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-24 12:32 [PATCH 00/10] amd64_edac fixes Borislav Petkov
2009-09-24 12:32 ` [PATCH 01/10] amd64_edac: convert cpumask_t to struct cpumask ptr Borislav Petkov
2009-09-24 12:32 ` [PATCH 02/10] amd64_edac: unify MCGCTL ECC switching Borislav Petkov
2009-09-24 12:32 ` [PATCH 03/10] amd64_edac: fix driver instance lookup table allocation Borislav Petkov
2009-09-24 12:32 ` [PATCH 04/10] amd64_edac: fix DRAM base and limit address extraction Borislav Petkov
2009-09-24 12:32 ` [PATCH 05/10] amd64_edac: fix interleave enable tests Borislav Petkov
2009-09-24 12:32 ` Borislav Petkov [this message]
2009-09-24 12:32 ` [PATCH 07/10] amd64_edac: simple fix to allow reporting of CECC errors Borislav Petkov
2009-09-24 12:32 ` [PATCH 08/10] amd64_edac: fix chip select handling Borislav Petkov
2009-09-24 12:32 ` [PATCH 09/10] amd64_edac: fix DRAM base and limit extraction Borislav Petkov
2009-09-24 12:32 ` [PATCH 10/10] amd64_edac: beef up DRAM error injection Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1253795568-9877-7-git-send-email-borislav.petkov@amd.com \
--to=borislav.petkov@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=norsk5@yahoo.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®