diff options
author | Borislav Petkov <bp@suse.de> | 2015-11-30 21:02:01 +0300 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2015-12-11 18:56:43 +0300 |
commit | c4cf3b454ecaa222aad9017932bd3b9c9325d931 (patch) | |
tree | 8e132709bdcaa097d84bba838bbd51a395607c3d /drivers/edac/edac_pci.c | |
parent | e136fa016f2f06ca6e00d4f99894b4424f3f2a5c (diff) | |
download | linux-c4cf3b454ecaa222aad9017932bd3b9c9325d931.tar.xz |
EDAC: Rework workqueue handling
Hide the EDAC workqueue pointer in a separate compilation unit and add
accessors for the workqueue manipulations needed.
Remove edac_pci_reset_delay_period() which wasn't used by anything. It
seems it got added without a user with
91b99041c1d5 ("drivers/edac: updated PCI monitoring")
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/edac/edac_pci.c')
-rw-r--r-- | drivers/edac/edac_pci.c | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c index d8b083190695..99685388d3fb 100644 --- a/drivers/edac/edac_pci.c +++ b/drivers/edac/edac_pci.c @@ -209,7 +209,7 @@ static void edac_pci_workq_function(struct work_struct *work_req) delay = msecs_to_jiffies(msec); /* Reschedule only if we are in POLL mode */ - queue_delayed_work(edac_workqueue, &pci->work, delay); + edac_queue_work(&pci->work, delay); } mutex_unlock(&edac_pci_ctls_mutex); @@ -229,8 +229,8 @@ static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci, edac_dbg(0, "\n"); INIT_DELAYED_WORK(&pci->work, edac_pci_workq_function); - queue_delayed_work(edac_workqueue, &pci->work, - msecs_to_jiffies(edac_pci_get_poll_msec())); + + edac_queue_work(&pci->work, msecs_to_jiffies(edac_pci_get_poll_msec())); } /* @@ -243,32 +243,8 @@ static void edac_pci_workq_teardown(struct edac_pci_ctl_info *pci) pci->op_state = OP_OFFLINE; - cancel_delayed_work_sync(&pci->work); - flush_workqueue(edac_workqueue); -} - -/* - * edac_pci_reset_delay_period - * - * called with a new period value for the workq period - * a) stop current workq timer - * b) restart workq timer with new value - */ -void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci, - unsigned long value) -{ - edac_dbg(0, "\n"); - - edac_pci_workq_teardown(pci); - - /* need to lock for the setup */ - mutex_lock(&edac_pci_ctls_mutex); - - edac_pci_workq_setup(pci, value); - - mutex_unlock(&edac_pci_ctls_mutex); + edac_stop_work(&pci->work); } -EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period); /* * edac_pci_alloc_index: Allocate a unique PCI index number |