summaryrefslogtreecommitdiffstats
path: root/drivers/edac/e752x_edac.c
diff options
context:
space:
mode:
authorBrian Pomerantz <bapper@mvista.com>2007-02-12 00:53:05 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 09:48:32 -0800
commit9962fd017becf944d671da498ccaaea570452206 (patch)
treefcb47a80c9a398a3840fee689f7486cb7d8ab9c1 /drivers/edac/e752x_edac.c
parentdfb2a76378f095b0aaa2024ce9a8cfb2ae2354d2 (diff)
downloadop-kernel-dev-9962fd017becf944d671da498ccaaea570452206.zip
op-kernel-dev-9962fd017becf944d671da498ccaaea570452206.tar.gz
[PATCH] EDAC: e752x byte access fix
The reading of the DRA registers should be a byte at a time (one register at a time) instead of 4 bytes at a time (four registers). Reading a dword at a time retrieves erroneous information from all but the first register. A change was made to read in each register in a loop prior to using the data in those registers. Signed-off-by: Brian Pomerantz <bapper@mvista.com> Signed-off-by: Dave Jiang <djiang@mvista.com> Signed-off-by: Doug Thompson <norsk5@xmission.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Andi Kleen <ak@suse.de> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac/e752x_edac.c')
-rw-r--r--drivers/edac/e752x_edac.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index ab98739..9abfc0d 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -782,7 +782,12 @@ static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
u8 value;
u32 dra, drc, cumul_size;
- pci_read_config_dword(pdev, E752X_DRA, &dra);
+ dra = 0;
+ for (index=0; index < 4; index++) {
+ u8 dra_reg;
+ pci_read_config_byte(pdev, E752X_DRA+index, &dra_reg);
+ dra |= dra_reg << (index * 8);
+ }
pci_read_config_dword(pdev, E752X_DRC, &drc);
drc_chan = dual_channel_active(ddrcsr);
drc_drbg = drc_chan + 1; /* 128 in dual mode, 64 in single */
OpenPOWER on IntegriCloud