From: Prarit Bhargava <prarit@redhat.com> Date: Thu, 4 Dec 2008 10:38:12 -0500 Subject: [x86_64] limit num of mce sysfs files removed on suspend Message-id: 20081204153812.5371.24998.sendpatchset@prarit.bos.redhat.com O-Subject: [RHEL5.3 PATCH]: Fix suspend on Nehalem and Dunnington systems Bugzilla: 467725 RH-Acked-by: Peter Martuccelli <peterm@redhat.com> RH-Acked-by: Larry Woodman <lwoodman@redhat.com> RH-Acked-by: Jiri Pirko <jpirko@redhat.com> When suspending a Nehalem or Dunnington system mce_remove_device() is called. Currently mce_remove_device will "overrun" the number of sysfs files -- only six are created regardless of the number of mce banks found. Limit the removal of mce sysfs files to NR_SYSFS_BANKS = 6. Sucessfully compiled and tested by me. Resolves BZ 467725. diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c index d370a4e..8c76505 100644 --- a/arch/x86_64/kernel/mce.c +++ b/arch/x86_64/kernel/mce.c @@ -650,7 +650,7 @@ static void mce_remove_device(unsigned int cpu) { int i; - for (i = 0; i < banks; i++) + for (i = 0; i < NR_SYSFS_BANKS; i++) sysdev_remove_file(&per_cpu(device_mce,cpu), bank_attributes[i]); sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_tolerant);