linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix EDAC sdram_scrub_rate read failure
@ 2011-09-16 10:58 Han Pingtian
  2011-09-16 12:53 ` Borislav Petkov
  0 siblings, 1 reply; 7+ messages in thread
From: Han Pingtian @ 2011-09-16 10:58 UTC (permalink / raw)
  To: mchehab; +Cc: linux-kernel

If sdram scrubbing rate ins't implemented on current system, read it
will cause an error:

cat: /sys/devices/system/edac/mc//mc0/sdram_scrub_rate: Invalid argument

The eba042a81edd6baaff44831b2d719b14a6d21e58 let it returning -EINVAL,
but according to the document, it should show -1:

dram memory scrubbing rate:

        'sdram_scrub_rate'

        Read/Write attribute file that controls memory scrubbing. The scrubbing
        rate is set by writing a minimum bandwidth in bytes/sec to the attribute
        file. The rate will be translated to an internal value that gives at
        least the specified rate.

        Reading the file will return the actual scrubbing rate employed.

        If configuration fails or memory scrubbing is not implemented, the value
        of the attribute file will be -1.

Signed-off-by: Han Pingtian <phan@redhat.com>
---
 drivers/edac/edac_mc_sysfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index 29ffa35..602fdcf 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -475,7 +475,7 @@ static ssize_t mci_sdram_scrub_rate_show(struct mem_ctl_info *mci, char *data)
 	int bandwidth = 0;
 
 	if (!mci->get_sdram_scrub_rate)
-		return -EINVAL;
+		return sprintf(date, "%d\n", -1);
 
 	bandwidth = mci->get_sdram_scrub_rate(mci);
 	if (bandwidth < 0) {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-09-21 15:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-16 10:58 [PATCH] Fix EDAC sdram_scrub_rate read failure Han Pingtian
2011-09-16 12:53 ` Borislav Petkov
2011-09-19  7:37   ` [PATCH v2] Fix EDAC sdram_scrub_rate read/write failure Han Pingtian
2011-09-19 14:20     ` Borislav Petkov
2011-09-19 20:23       ` Luck, Tony
2011-09-21 12:33         ` Borislav Petkov
2011-09-21 15:41           ` Luck, Tony

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).