edac: core fix workq timer

When updating the edac_mc_poll_msec module parameter from the sysfs
/sys/module/edac_core/parameters/edac_mc_poll_msec file, we don't update
the workq timers. So that, if we move from a big poll time to a small
one, the small one won't take effect until the big one has timed out.

Here we provide a new module parameter set method to call out to the
update routine. This brings the /sys/module/edac_core/parameters
functionality up to that provided by the /sys/drivers/system/edac/mc sysfs
module parameter files so that we can remove them or at least link to the
/sys/module files...

Signed-off-by: Arthur Jones <ajones@riverbed.com>
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>

authored by

Arthur Jones and committed by
Linus Torvalds
096846e2 14cc571b

+21 -1
+21 -1
drivers/edac/edac_mc_sysfs.c
··· 44 44 return edac_mc_poll_msec; 45 45 } 46 46 47 + static int edac_set_poll_msec(const char *val, struct kernel_param *kp) 48 + { 49 + long l; 50 + int ret; 51 + 52 + if (!val) 53 + return -EINVAL; 54 + 55 + ret = strict_strtol(val, 0, &l); 56 + if (ret == -EINVAL || ((int)l != l)) 57 + return -EINVAL; 58 + *((int *)kp->arg) = l; 59 + 60 + /* notify edac_mc engine to reset the poll period */ 61 + edac_mc_reset_delay_period(l); 62 + 63 + return 0; 64 + } 65 + 47 66 /* Parameter declarations for above */ 48 67 module_param(edac_mc_panic_on_ue, int, 0644); 49 68 MODULE_PARM_DESC(edac_mc_panic_on_ue, "Panic on uncorrected error: 0=off 1=on"); ··· 72 53 module_param(edac_mc_log_ce, int, 0644); 73 54 MODULE_PARM_DESC(edac_mc_log_ce, 74 55 "Log correctable error to console: 0=off 1=on"); 75 - module_param(edac_mc_poll_msec, int, 0644); 56 + module_param_call(edac_mc_poll_msec, edac_set_poll_msec, param_get_int, 57 + &edac_mc_poll_msec, 0644); 76 58 MODULE_PARM_DESC(edac_mc_poll_msec, "Polling period in milliseconds"); 77 59 78 60 /*