summaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/shpchp_core.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 17:13:10 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 17:13:10 -0700
commit91b745016c12d440386c40fb76ab69c8e08cbc06 (patch)
tree881a26a43b3ee924c0979a54b38c7a87d79d7f1a /drivers/pci/hotplug/shpchp_core.c
parent04cc69768e7d1f40d98b79d23d203674553b4da2 (diff)
parentdaaae6b010ac0f60c9c35e481589966f9f1fcc22 (diff)
downloadop-kernel-dev-91b745016c12d440386c40fb76ab69c8e08cbc06.zip
op-kernel-dev-91b745016c12d440386c40fb76ab69c8e08cbc06.tar.gz
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: remove in_workqueue_context() workqueue: Clarify that schedule_on_each_cpu is synchronous memory_hotplug: drop spurious calls to flush_scheduled_work() shpchp: update workqueue usage pciehp: update workqueue usage isdn/eicon: don't call flush_scheduled_work() from diva_os_remove_soft_isr() workqueue: add and use WQ_MEM_RECLAIM flag workqueue: fix HIGHPRI handling in keep_working() workqueue: add queue_work and activate_work trace points workqueue: prepare for more tracepoints workqueue: implement flush[_delayed]_work_sync() workqueue: factor out start_flush_work() workqueue: cleanup flush/cancel functions workqueue: implement alloc_ordered_workqueue() Fix up trivial conflict in fs/gfs2/main.c as per Tejun
Diffstat (limited to 'drivers/pci/hotplug/shpchp_core.c')
-rw-r--r--drivers/pci/hotplug/shpchp_core.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index a7bd504..aca972b 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -33,7 +33,6 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/pci.h>
-#include <linux/workqueue.h>
#include "shpchp.h"
/* Global variables */
@@ -41,6 +40,7 @@ int shpchp_debug;
int shpchp_poll_mode;
int shpchp_poll_time;
struct workqueue_struct *shpchp_wq;
+struct workqueue_struct *shpchp_ordered_wq;
#define DRIVER_VERSION "0.4"
#define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>, Dely Sy <dely.l.sy@intel.com>"
@@ -174,8 +174,8 @@ void cleanup_slots(struct controller *ctrl)
slot = list_entry(tmp, struct slot, slot_list);
list_del(&slot->slot_list);
cancel_delayed_work(&slot->work);
- flush_scheduled_work();
flush_workqueue(shpchp_wq);
+ flush_workqueue(shpchp_ordered_wq);
pci_hp_deregister(slot->hotplug_slot);
}
}
@@ -360,9 +360,23 @@ static int __init shpcd_init(void)
{
int retval = 0;
+ shpchp_wq = alloc_ordered_workqueue("shpchp", 0);
+ if (!shpchp_wq)
+ return -ENOMEM;
+
+ shpchp_ordered_wq = alloc_ordered_workqueue("shpchp_ordered", 0);
+ if (!shpchp_ordered_wq) {
+ destroy_workqueue(shpchp_wq);
+ return -ENOMEM;
+ }
+
retval = pci_register_driver(&shpc_driver);
dbg("%s: pci_register_driver = %d\n", __func__, retval);
info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
+ if (retval) {
+ destroy_workqueue(shpchp_ordered_wq);
+ destroy_workqueue(shpchp_wq);
+ }
return retval;
}
@@ -370,6 +384,8 @@ static void __exit shpcd_cleanup(void)
{
dbg("unload_shpchpd()\n");
pci_unregister_driver(&shpc_driver);
+ destroy_workqueue(shpchp_ordered_wq);
+ destroy_workqueue(shpchp_wq);
info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
}
OpenPOWER on IntegriCloud