amd64_edac: Fix single-channel setups
authorBorislav Petkov <bp@suse.de>
Tue, 23 Jul 2013 18:01:23 +0000 (20:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Sep 2013 00:21:57 +0000 (17:21 -0700)
commitdd311a3ca3b1d6a829644aeab7d37edb6ccda95e
treeef2077b7e58c180542cc0788284dd7aeb4f7db12
parent77ad400fd46a05871d065cba6904233fdf5f57f3
amd64_edac: Fix single-channel setups

commit f0a56c480196a98479760862468cc95879df3de0 upstream.

It can happen that configurations are running in a single-channel mode
even with a dual-channel memory controller, by, say, putting the DIMMs
only on the one channel and leaving the other empty. This causes a
problem in init_csrows which implicitly assumes that when the second
channel is enabled, i.e. channel 1, the struct dimm hierarchy will be
present. Which is not.

So always allocate two channels unconditionally.

This provides for the nice side effect that the data structures are
initialized so some day, when memory hotplug is supported, it should
just work out of the box when all of a sudden a second channel appears.

Reported-and-tested-by: Roger Leigh <rleigh@debian.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/edac/amd64_edac.c