]> git.baikalelectronics.ru Git - kernel.git/commit
EDAC, sb_edac: Use cpu family/model in driver detection
authorTony Luck <tony.luck@intel.com>
Thu, 28 Apr 2016 22:40:00 +0000 (15:40 -0700)
committerBorislav Petkov <bp@suse.de>
Mon, 2 May 2016 17:44:43 +0000 (19:44 +0200)
commitcf7c16938b623c630a314e74d3aad4a504f71e8f
tree1936dbdab9f678c1c9b1e9cc4524755df588a4de
parente3885bf223cd11cf0ab4df065725f72faaa16d5e
EDAC, sb_edac: Use cpu family/model in driver detection

Instead of picking a random PCI ID from the dozen or so we need to
access, just use x86_match_cpu() to pick based on CPU model number. The
choosing of PCI devices has been problematic in the past, see

  cc1e3ec269f5 ("sb_edac: Fix detection on SNB machines")

which fixed problems introduced by

  95950504ac96 ("sb_edac: Claim a different PCI device").

This is especially ugly if future hardware might not even have
EDAC-relevant registers in PCI config space and we would still be
required to choose some "random" PCI devices to scan for just so our
driver loads.

Is this cleaner/clearer? It deletes much more code than it adds. Only
tested on Broadwell. The driver loads/unloads and loads again. Still
decodes errors too.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Suggested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
drivers/edac/sb_edac.c