Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Brian Pomerantz and committed by
Linus Torvalds
9962fd01 dfb2a763

+6 -1
+6 -1
drivers/edac/e752x_edac.c
··· 782 782 u8 value; 783 783 u32 dra, drc, cumul_size; 784 784 785 - pci_read_config_dword(pdev, E752X_DRA, &dra); 785 + dra = 0; 786 + for (index=0; index < 4; index++) { 787 + u8 dra_reg; 788 + pci_read_config_byte(pdev, E752X_DRA+index, &dra_reg); 789 + dra |= dra_reg << (index * 8); 790 + } 786 791 pci_read_config_dword(pdev, E752X_DRC, &drc); 787 792 drc_chan = dual_channel_active(ddrcsr); 788 793 drc_drbg = drc_chan + 1; /* 128 in dual mode, 64 in single */