|
34 | 34 | static DEFINE_MUTEX(device_ctls_mutex);
|
35 | 35 | static LIST_HEAD(edac_device_list);
|
36 | 36 |
|
| 37 | +/* Default workqueue processing interval on this instance, in msecs */ |
| 38 | +#define DEFAULT_POLL_INTERVAL 1000 |
| 39 | + |
37 | 40 | #ifdef CONFIG_EDAC_DEBUG
|
38 | 41 | static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
|
39 | 42 | {
|
@@ -336,7 +339,7 @@ static void edac_device_workq_function(struct work_struct *work_req)
|
336 | 339 | * whole one second to save timers firing all over the period
|
337 | 340 | * between integral seconds
|
338 | 341 | */
|
339 |
| - if (edac_dev->poll_msec == 1000) |
| 342 | + if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL) |
340 | 343 | edac_queue_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay));
|
341 | 344 | else
|
342 | 345 | edac_queue_work(&edac_dev->work, edac_dev->delay);
|
@@ -366,7 +369,7 @@ static void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
|
366 | 369 | * timers firing on sub-second basis, while they are happy
|
367 | 370 | * to fire together on the 1 second exactly
|
368 | 371 | */
|
369 |
| - if (edac_dev->poll_msec == 1000) |
| 372 | + if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL) |
370 | 373 | edac_queue_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay));
|
371 | 374 | else
|
372 | 375 | edac_queue_work(&edac_dev->work, edac_dev->delay);
|
@@ -400,7 +403,7 @@ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
|
400 | 403 | edac_dev->delay = msecs_to_jiffies(msec);
|
401 | 404 |
|
402 | 405 | /* See comment in edac_device_workq_setup() above */
|
403 |
| - if (edac_dev->poll_msec == 1000) |
| 406 | + if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL) |
404 | 407 | edac_mod_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay));
|
405 | 408 | else
|
406 | 409 | edac_mod_work(&edac_dev->work, edac_dev->delay);
|
@@ -442,11 +445,7 @@ int edac_device_add_device(struct edac_device_ctl_info *edac_dev)
|
442 | 445 | /* This instance is NOW RUNNING */
|
443 | 446 | edac_dev->op_state = OP_RUNNING_POLL;
|
444 | 447 |
|
445 |
| - /* |
446 |
| - * enable workq processing on this instance, |
447 |
| - * default = 1000 msec |
448 |
| - */ |
449 |
| - edac_device_workq_setup(edac_dev, 1000); |
| 448 | + edac_device_workq_setup(edac_dev, edac_dev->poll_msec ?: DEFAULT_POLL_INTERVAL); |
450 | 449 | } else {
|
451 | 450 | edac_dev->op_state = OP_RUNNING_INTERRUPT;
|
452 | 451 | }
|
|
0 commit comments