History

Merge tag 'edac_for_3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp

Pull EDAC fixes from Borislav Petkov: "Fix polling timeout setting through sysfs. You're surely wondering why the patches are not based on an rc. Well, Andrew sent you 79040cad3f82 ("drivers/edac/edac_mc_sysfs.c: poll timeout cannot be zero sent you") already (it got in in -rc2) but it is not enough as a fix because for one, setting too low polling intervals (< 1sec) don't make any sense and cause unnecessary polling load on the system. Then, even if we set some interval, we explode with [ 4143.094342] WARNING: CPU: 1 PID: 0 at kernel/workqueue.c:1393 __queue_work+0x1d7/0x340() because the workqueue setup path is used also for the timeout period resetting and we're doing INIT_DELAYED_WORK() on an already active workqueue. Which is total bollocks. So this is taken care of by the second patch. I've CCed stable for those two" * tag 'edac_for_3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: EDAC: Correct workqueue setup path EDAC: Poll timeout cannot be zero, p2

Linus Torvalds committed 12 years ago

Commit 3bd354a2 parents cbc2525 cb6ef423 files · +15 −10Browse files

Unified · Split

3 files
  1. drivers/edac/edac_mc.c +8 −5
  2. drivers/edac/edac_mc_sysfs.c +6 −4
  3. drivers/edac/edac_module.h +1 −1
drivers/edac/edac_mc.c+8−5
@@ -559,7 +559,8 @@ static void edac_mc_workq_function(struct work_struct *work_req) · 558 unmodified lines
559559 *
560560 * called with the mem_ctls_mutex held
561561 */
562−static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec)
562+static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec,
563+ bool init)
563564 {
564565 edac_dbg(0, "\n");
565566
@@ -567,7 +568,9 @@ static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec) · 1 unmodified line
567568 if (mci->op_state != OP_RUNNING_POLL)
568569 return;
569570
570− INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function);
571+ if (init)
572+ INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function);
573+
571574 mod_delayed_work(edac_workqueue, &mci->work, msecs_to_jiffies(msec));
572575 }
573576
@@ -601,7 +604,7 @@ static void edac_mc_workq_teardown(struct mem_ctl_info *mci) · 27 unmodified lines
601604 * user space has updated our poll period value, need to
602605 * reset our workq delays
603606 */
604−void edac_mc_reset_delay_period(int value)
607+void edac_mc_reset_delay_period(unsigned long value)
605608 {
606609 struct mem_ctl_info *mci;
607610 struct list_head *item;
@@ -611,7 +614,7 @@ void edac_mc_reset_delay_period(int value) · 3 unmodified lines
611614 list_for_each(item, &mc_devices) {
612615 mci = list_entry(item, struct mem_ctl_info, link);
613616
614− edac_mc_workq_setup(mci, (unsigned long) value);
617+ edac_mc_workq_setup(mci, value, false);
615618 }
616619
617620 mutex_unlock(&mem_ctls_mutex);
@@ -782,7 +785,7 @@ int edac_mc_add_mc(struct mem_ctl_info *mci) · 164 unmodified lines
782785 /* This instance is NOW RUNNING */
783786 mci->op_state = OP_RUNNING_POLL;
784787
785− edac_mc_workq_setup(mci, edac_mc_get_poll_msec());
788+ edac_mc_workq_setup(mci, edac_mc_get_poll_msec(), true);
786789 } else {
787790 mci->op_state = OP_RUNNING_INTERRUPT;
788791 }
drivers/edac/edac_mc_sysfs.c+6−4
@@ -52,18 +52,20 @@ int edac_mc_get_poll_msec(void) · 51 unmodified lines
5252
5353 static int edac_set_poll_msec(const char *val, struct kernel_param *kp)
5454 {
55− long l;
55+ unsigned long l;
5656 int ret;
5757
5858 if (!val)
5959 return -EINVAL;
6060
61− ret = kstrtol(val, 0, &l);
61+ ret = kstrtoul(val, 0, &l);
6262 if (ret)
6363 return ret;
64− if (!l || ((int)l != l))
64+
65+ if (l < 1000)
6566 return -EINVAL;
66− *((int *)kp->arg) = l;
67+
68+ *((unsigned long *)kp->arg) = l;
6769
6870 /* notify edac_mc engine to reset the poll period */
6971 edac_mc_reset_delay_period(l);
drivers/edac/edac_module.h+1−1
@@ -52,7 +52,7 @@ extern void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev, · 51 unmodified lines
5252 extern void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev);
5353 extern void edac_device_reset_delay_period(struct edac_device_ctl_info
5454 *edac_dev, unsigned long value);
55−extern void edac_mc_reset_delay_period(int value);
55+extern void edac_mc_reset_delay_period(unsigned long value);
5656
5757 extern void *edac_align_ptr(void **p, unsigned size, int n_elems);
5858

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t