diff options
author | Doug Thompson <dougthompson@xmission.com> | 2007-07-26 13:41:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-26 14:35:18 -0400 |
commit | bce19683c17485b584b62b984d6dcf5332181588 (patch) | |
tree | abc76c3fed9404df9cf3e636bc9f910c57e177dc /drivers/edac/edac_mc_sysfs.c | |
parent | 045e72acf16054c4ed2760e9a8edb19a08053af1 (diff) |
drivers/edac: fix reset edac_mc pollmsec
This fixes a deadlock that could occur on a 'setup' and 'teardown' sequence of
the workq for a edac_mc control structure instance. A similiar fix was
previously implemented for the edac_device code.
In addition, the edac_mc device code there was missing code to allow the workq
period valu to be altered via sysfs control.
This patch adds that fix on the code, and allows for the changing of the
period value as well.
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac/edac_mc_sysfs.c')
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index cd090b0677a7..4a0576bd06fc 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -122,6 +122,23 @@ static ssize_t memctrl_int_store(void *ptr, const char *buffer, size_t count) | |||
122 | return count; | 122 | return count; |
123 | } | 123 | } |
124 | 124 | ||
125 | /* | ||
126 | * mc poll_msec time value | ||
127 | */ | ||
128 | static ssize_t poll_msec_int_store(void *ptr, const char *buffer, size_t count) | ||
129 | { | ||
130 | int *value = (int *)ptr; | ||
131 | |||
132 | if (isdigit(*buffer)) { | ||
133 | *value = simple_strtoul(buffer, NULL, 0); | ||
134 | |||
135 | /* notify edac_mc engine to reset the poll period */ | ||
136 | edac_mc_reset_delay_period(*value); | ||
137 | } | ||
138 | |||
139 | return count; | ||
140 | } | ||
141 | |||
125 | 142 | ||
126 | /* EDAC sysfs CSROW data structures and methods | 143 | /* EDAC sysfs CSROW data structures and methods |
127 | */ | 144 | */ |
@@ -704,7 +721,7 @@ MEMCTRL_ATTR(edac_mc_log_ce, | |||
704 | S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); | 721 | S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); |
705 | 722 | ||
706 | MEMCTRL_ATTR(edac_mc_poll_msec, | 723 | MEMCTRL_ATTR(edac_mc_poll_msec, |
707 | S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); | 724 | S_IRUGO | S_IWUSR, memctrl_int_show, poll_msec_int_store); |
708 | 725 | ||
709 | /* Base Attributes of the memory ECC object */ | 726 | /* Base Attributes of the memory ECC object */ |
710 | static struct memctrl_dev_attribute *memctrl_attr[] = { | 727 | static struct memctrl_dev_attribute *memctrl_attr[] = { |