diff options
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/edac_mc.c | 13 | ||||
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 10 | ||||
-rw-r--r-- | drivers/edac/edac_module.h | 2 | ||||
-rw-r--r-- | drivers/edac/i7300_edac.c | 38 | ||||
-rw-r--r-- | drivers/edac/i7core_edac.c | 9 |
5 files changed, 42 insertions, 30 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index e8c9ef03495b..33edd6766344 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -559,7 +559,8 @@ static void edac_mc_workq_function(struct work_struct *work_req) | |||
559 | * | 559 | * |
560 | * called with the mem_ctls_mutex held | 560 | * called with the mem_ctls_mutex held |
561 | */ | 561 | */ |
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) | ||
563 | { | 564 | { |
564 | edac_dbg(0, "\n"); | 565 | edac_dbg(0, "\n"); |
565 | 566 | ||
@@ -567,7 +568,9 @@ static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec) | |||
567 | if (mci->op_state != OP_RUNNING_POLL) | 568 | if (mci->op_state != OP_RUNNING_POLL) |
568 | return; | 569 | return; |
569 | 570 | ||
570 | INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function); | 571 | if (init) |
572 | INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function); | ||
573 | |||
571 | mod_delayed_work(edac_workqueue, &mci->work, msecs_to_jiffies(msec)); | 574 | mod_delayed_work(edac_workqueue, &mci->work, msecs_to_jiffies(msec)); |
572 | } | 575 | } |
573 | 576 | ||
@@ -601,7 +604,7 @@ static void edac_mc_workq_teardown(struct mem_ctl_info *mci) | |||
601 | * user space has updated our poll period value, need to | 604 | * user space has updated our poll period value, need to |
602 | * reset our workq delays | 605 | * reset our workq delays |
603 | */ | 606 | */ |
604 | void edac_mc_reset_delay_period(int value) | 607 | void edac_mc_reset_delay_period(unsigned long value) |
605 | { | 608 | { |
606 | struct mem_ctl_info *mci; | 609 | struct mem_ctl_info *mci; |
607 | struct list_head *item; | 610 | struct list_head *item; |
@@ -611,7 +614,7 @@ void edac_mc_reset_delay_period(int value) | |||
611 | list_for_each(item, &mc_devices) { | 614 | list_for_each(item, &mc_devices) { |
612 | mci = list_entry(item, struct mem_ctl_info, link); | 615 | mci = list_entry(item, struct mem_ctl_info, link); |
613 | 616 | ||
614 | edac_mc_workq_setup(mci, (unsigned long) value); | 617 | edac_mc_workq_setup(mci, value, false); |
615 | } | 618 | } |
616 | 619 | ||
617 | mutex_unlock(&mem_ctls_mutex); | 620 | mutex_unlock(&mem_ctls_mutex); |
@@ -782,7 +785,7 @@ int edac_mc_add_mc(struct mem_ctl_info *mci) | |||
782 | /* This instance is NOW RUNNING */ | 785 | /* This instance is NOW RUNNING */ |
783 | mci->op_state = OP_RUNNING_POLL; | 786 | mci->op_state = OP_RUNNING_POLL; |
784 | 787 | ||
785 | edac_mc_workq_setup(mci, edac_mc_get_poll_msec()); | 788 | edac_mc_workq_setup(mci, edac_mc_get_poll_msec(), true); |
786 | } else { | 789 | } else { |
787 | mci->op_state = OP_RUNNING_INTERRUPT; | 790 | mci->op_state = OP_RUNNING_INTERRUPT; |
788 | } | 791 | } |
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 51c0362acf5c..b335c6ab5efe 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -52,18 +52,20 @@ int edac_mc_get_poll_msec(void) | |||
52 | 52 | ||
53 | static int edac_set_poll_msec(const char *val, struct kernel_param *kp) | 53 | static int edac_set_poll_msec(const char *val, struct kernel_param *kp) |
54 | { | 54 | { |
55 | long l; | 55 | unsigned long l; |
56 | int ret; | 56 | int ret; |
57 | 57 | ||
58 | if (!val) | 58 | if (!val) |
59 | return -EINVAL; | 59 | return -EINVAL; |
60 | 60 | ||
61 | ret = kstrtol(val, 0, &l); | 61 | ret = kstrtoul(val, 0, &l); |
62 | if (ret) | 62 | if (ret) |
63 | return ret; | 63 | return ret; |
64 | if ((int)l != l) | 64 | |
65 | if (l < 1000) | ||
65 | return -EINVAL; | 66 | return -EINVAL; |
66 | *((int *)kp->arg) = l; | 67 | |
68 | *((unsigned long *)kp->arg) = l; | ||
67 | 69 | ||
68 | /* notify edac_mc engine to reset the poll period */ | 70 | /* notify edac_mc engine to reset the poll period */ |
69 | edac_mc_reset_delay_period(l); | 71 | edac_mc_reset_delay_period(l); |
diff --git a/drivers/edac/edac_module.h b/drivers/edac/edac_module.h index 3d139c6e7fe3..f2118bfcf8df 100644 --- a/drivers/edac/edac_module.h +++ b/drivers/edac/edac_module.h | |||
@@ -52,7 +52,7 @@ extern void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev, | |||
52 | extern void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev); | 52 | extern void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev); |
53 | extern void edac_device_reset_delay_period(struct edac_device_ctl_info | 53 | extern void edac_device_reset_delay_period(struct edac_device_ctl_info |
54 | *edac_dev, unsigned long value); | 54 | *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); |
56 | 56 | ||
57 | extern void *edac_align_ptr(void **p, unsigned size, int n_elems); | 57 | extern void *edac_align_ptr(void **p, unsigned size, int n_elems); |
58 | 58 | ||
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c index d63f4798f7d0..57e96a3350f0 100644 --- a/drivers/edac/i7300_edac.c +++ b/drivers/edac/i7300_edac.c | |||
@@ -943,33 +943,35 @@ static int i7300_get_devices(struct mem_ctl_info *mci) | |||
943 | 943 | ||
944 | /* Attempt to 'get' the MCH register we want */ | 944 | /* Attempt to 'get' the MCH register we want */ |
945 | pdev = NULL; | 945 | pdev = NULL; |
946 | while (!pvt->pci_dev_16_1_fsb_addr_map || | 946 | while ((pdev = pci_get_device(PCI_VENDOR_ID_INTEL, |
947 | !pvt->pci_dev_16_2_fsb_err_regs) { | 947 | PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, |
948 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | 948 | pdev))) { |
949 | PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, pdev); | ||
950 | if (!pdev) { | ||
951 | /* End of list, leave */ | ||
952 | i7300_printk(KERN_ERR, | ||
953 | "'system address,Process Bus' " | ||
954 | "device not found:" | ||
955 | "vendor 0x%x device 0x%x ERR funcs " | ||
956 | "(broken BIOS?)\n", | ||
957 | PCI_VENDOR_ID_INTEL, | ||
958 | PCI_DEVICE_ID_INTEL_I7300_MCH_ERR); | ||
959 | goto error; | ||
960 | } | ||
961 | |||
962 | /* Store device 16 funcs 1 and 2 */ | 949 | /* Store device 16 funcs 1 and 2 */ |
963 | switch (PCI_FUNC(pdev->devfn)) { | 950 | switch (PCI_FUNC(pdev->devfn)) { |
964 | case 1: | 951 | case 1: |
965 | pvt->pci_dev_16_1_fsb_addr_map = pdev; | 952 | if (!pvt->pci_dev_16_1_fsb_addr_map) |
953 | pvt->pci_dev_16_1_fsb_addr_map = | ||
954 | pci_dev_get(pdev); | ||
966 | break; | 955 | break; |
967 | case 2: | 956 | case 2: |
968 | pvt->pci_dev_16_2_fsb_err_regs = pdev; | 957 | if (!pvt->pci_dev_16_2_fsb_err_regs) |
958 | pvt->pci_dev_16_2_fsb_err_regs = | ||
959 | pci_dev_get(pdev); | ||
969 | break; | 960 | break; |
970 | } | 961 | } |
971 | } | 962 | } |
972 | 963 | ||
964 | if (!pvt->pci_dev_16_1_fsb_addr_map || | ||
965 | !pvt->pci_dev_16_2_fsb_err_regs) { | ||
966 | /* At least one device was not found */ | ||
967 | i7300_printk(KERN_ERR, | ||
968 | "'system address,Process Bus' device not found:" | ||
969 | "vendor 0x%x device 0x%x ERR funcs (broken BIOS?)\n", | ||
970 | PCI_VENDOR_ID_INTEL, | ||
971 | PCI_DEVICE_ID_INTEL_I7300_MCH_ERR); | ||
972 | goto error; | ||
973 | } | ||
974 | |||
973 | edac_dbg(1, "System Address, processor bus- PCI Bus ID: %s %x:%x\n", | 975 | edac_dbg(1, "System Address, processor bus- PCI Bus ID: %s %x:%x\n", |
974 | pci_name(pvt->pci_dev_16_0_fsb_ctlr), | 976 | pci_name(pvt->pci_dev_16_0_fsb_ctlr), |
975 | pvt->pci_dev_16_0_fsb_ctlr->vendor, | 977 | pvt->pci_dev_16_0_fsb_ctlr->vendor, |
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 87533ca7752e..d871275196f6 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1334,14 +1334,19 @@ static int i7core_get_onedevice(struct pci_dev **prev, | |||
1334 | * is at addr 8086:2c40, instead of 8086:2c41. So, we need | 1334 | * is at addr 8086:2c40, instead of 8086:2c41. So, we need |
1335 | * to probe for the alternate address in case of failure | 1335 | * to probe for the alternate address in case of failure |
1336 | */ | 1336 | */ |
1337 | if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev) | 1337 | if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev) { |
1338 | pci_dev_get(*prev); /* pci_get_device will put it */ | ||
1338 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | 1339 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, |
1339 | PCI_DEVICE_ID_INTEL_I7_NONCORE_ALT, *prev); | 1340 | PCI_DEVICE_ID_INTEL_I7_NONCORE_ALT, *prev); |
1341 | } | ||
1340 | 1342 | ||
1341 | if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE && !pdev) | 1343 | if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE && |
1344 | !pdev) { | ||
1345 | pci_dev_get(*prev); /* pci_get_device will put it */ | ||
1342 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | 1346 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, |
1343 | PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_ALT, | 1347 | PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_ALT, |
1344 | *prev); | 1348 | *prev); |
1349 | } | ||
1345 | 1350 | ||
1346 | if (!pdev) { | 1351 | if (!pdev) { |
1347 | if (*prev) { | 1352 | if (*prev) { |