Commit 9962fd01 authored by Brian Pomerantz's avatar Brian Pomerantz Committed by Linus Torvalds

[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: default avatarBrian Pomerantz <bapper@mvista.com>
Signed-off-by: default avatarDave Jiang <djiang@mvista.com>
Signed-off-by: default avatarDoug 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent dfb2a763
...@@ -782,7 +782,12 @@ static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, ...@@ -782,7 +782,12 @@ static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
u8 value; u8 value;
u32 dra, drc, cumul_size; 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); pci_read_config_dword(pdev, E752X_DRC, &drc);
drc_chan = dual_channel_active(ddrcsr); drc_chan = dual_channel_active(ddrcsr);
drc_drbg = drc_chan + 1; /* 128 in dual mode, 64 in single */ drc_drbg = drc_chan + 1; /* 128 in dual mode, 64 in single */
......
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