]> git.karo-electronics.de Git - karo-tx-linux.git/commit
EDAC: Correct scrub rate API
authorBorislav Petkov <borislav.petkov@amd.com>
Wed, 21 Sep 2011 12:10:43 +0000 (14:10 +0200)
committerBorislav Petkov <borislav.petkov@amd.com>
Wed, 21 Sep 2011 12:18:33 +0000 (14:18 +0200)
commit11f5b3112f5710c04bf2d305193d95192489188d
tree52ae8a5394aef53675fba1ff8b07a02708e2c40a
parentb6fd41e29dea9c6753b1843a77e50433e6123bcb
EDAC: Correct scrub rate API

The original scrub rate API definition states that if scrub rate
accessors are not implemented, a negative value (-1) should be written
to the sysfs file (/sys/devices/system/edac/mc/mc<N>/sdram_scrub_rate,
where N is the memory controller number on the system). This is
counter-intuitive and awkward at the very least because, when setting
the scrub rate, userspace has to write to sysfs and then read it back to
check error status of the operation.

As Tony notes, best it would be to not have the sdram_scrub_rate in
sysfs if scrub rate support is not implemented. It is too late about
that and a bunch of drivers on a bunch of arches would need to be
changed and tested which is not a trivial task ATM.

Instead, settle for the next best thing of returning -ENODEV when
implementation is missing and -EINVAL when there was an error
encountered while setting the scrub rate.

Reported-by: Han Pingtian <phan@redhat.com>
Cc: Tony Luck <tony.luck@intel.com>
Link: http://lkml.kernel.org/r/20110916105856.GA13253@hpt.nay.redhat.com
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Documentation/edac.txt
drivers/edac/edac_mc_sysfs.c