diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2013-01-11 14:07:22 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-01-14 12:23:07 -0500 |
commit | d347e75847c1fb299c97736638f45e6ea39702d4 (patch) | |
tree | 7dfe6294b84f3cd1ba3cabe6b2cf7e040d8fa71c /drivers/pci | |
parent | 10959d72d401cec2781ca636b07d692c625e1c91 (diff) |
PCI: shpchp: Handle push button event asynchronously
Use non-ordered workqueue for attention button events.
Attention button events on each slot can be handled asynchronously. So
we should use non-ordered workqueue. This patch also removes ordered
workqueue in shpchp as a result.
486b10b9f4 ("PCI: pciehp: Handle push button event asynchronously") made
the same change to pciehp. I split this out from a patch by Yijing Wang
<wangyijing@huawei.com> so we fix one thing at a time and to make the
shpchp history correspond more closely with the pciehp history.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/shpchp.h | 1 | ||||
-rw-r--r-- | drivers/pci/hotplug/shpchp_core.c | 10 | ||||
-rw-r--r-- | drivers/pci/hotplug/shpchp_ctrl.c | 2 |
3 files changed, 1 insertions, 12 deletions
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index ca64932e658b..1b69d955a31f 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h | |||
@@ -47,7 +47,6 @@ extern bool shpchp_poll_mode; | |||
47 | extern int shpchp_poll_time; | 47 | extern int shpchp_poll_time; |
48 | extern bool shpchp_debug; | 48 | extern bool shpchp_debug; |
49 | extern struct workqueue_struct *shpchp_wq; | 49 | extern struct workqueue_struct *shpchp_wq; |
50 | extern struct workqueue_struct *shpchp_ordered_wq; | ||
51 | 50 | ||
52 | #define dbg(format, arg...) \ | 51 | #define dbg(format, arg...) \ |
53 | do { \ | 52 | do { \ |
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index 59ca86c924a3..3774e0d5506e 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c | |||
@@ -40,7 +40,6 @@ bool shpchp_debug; | |||
40 | bool shpchp_poll_mode; | 40 | bool shpchp_poll_mode; |
41 | int shpchp_poll_time; | 41 | int shpchp_poll_time; |
42 | struct workqueue_struct *shpchp_wq; | 42 | struct workqueue_struct *shpchp_wq; |
43 | struct workqueue_struct *shpchp_ordered_wq; | ||
44 | 43 | ||
45 | #define DRIVER_VERSION "0.4" | 44 | #define DRIVER_VERSION "0.4" |
46 | #define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>, Dely Sy <dely.l.sy@intel.com>" | 45 | #define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>, Dely Sy <dely.l.sy@intel.com>" |
@@ -181,7 +180,6 @@ void cleanup_slots(struct controller *ctrl) | |||
181 | list_del(&slot->slot_list); | 180 | list_del(&slot->slot_list); |
182 | cancel_delayed_work(&slot->work); | 181 | cancel_delayed_work(&slot->work); |
183 | flush_workqueue(shpchp_wq); | 182 | flush_workqueue(shpchp_wq); |
184 | flush_workqueue(shpchp_ordered_wq); | ||
185 | pci_hp_deregister(slot->hotplug_slot); | 183 | pci_hp_deregister(slot->hotplug_slot); |
186 | } | 184 | } |
187 | } | 185 | } |
@@ -370,17 +368,10 @@ static int __init shpcd_init(void) | |||
370 | if (!shpchp_wq) | 368 | if (!shpchp_wq) |
371 | return -ENOMEM; | 369 | return -ENOMEM; |
372 | 370 | ||
373 | shpchp_ordered_wq = alloc_ordered_workqueue("shpchp_ordered", 0); | ||
374 | if (!shpchp_ordered_wq) { | ||
375 | destroy_workqueue(shpchp_wq); | ||
376 | return -ENOMEM; | ||
377 | } | ||
378 | |||
379 | retval = pci_register_driver(&shpc_driver); | 371 | retval = pci_register_driver(&shpc_driver); |
380 | dbg("%s: pci_register_driver = %d\n", __func__, retval); | 372 | dbg("%s: pci_register_driver = %d\n", __func__, retval); |
381 | info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); | 373 | info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); |
382 | if (retval) { | 374 | if (retval) { |
383 | destroy_workqueue(shpchp_ordered_wq); | ||
384 | destroy_workqueue(shpchp_wq); | 375 | destroy_workqueue(shpchp_wq); |
385 | } | 376 | } |
386 | return retval; | 377 | return retval; |
@@ -390,7 +381,6 @@ static void __exit shpcd_cleanup(void) | |||
390 | { | 381 | { |
391 | dbg("unload_shpchpd()\n"); | 382 | dbg("unload_shpchpd()\n"); |
392 | pci_unregister_driver(&shpc_driver); | 383 | pci_unregister_driver(&shpc_driver); |
393 | destroy_workqueue(shpchp_ordered_wq); | ||
394 | destroy_workqueue(shpchp_wq); | 384 | destroy_workqueue(shpchp_wq); |
395 | info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n"); | 385 | info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n"); |
396 | } | 386 | } |
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index f9b5a52e4115..fd2cae9eb6c2 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c | |||
@@ -453,7 +453,7 @@ void shpchp_queue_pushbutton_work(struct work_struct *work) | |||
453 | kfree(info); | 453 | kfree(info); |
454 | goto out; | 454 | goto out; |
455 | } | 455 | } |
456 | queue_work(shpchp_ordered_wq, &info->work); | 456 | queue_work(shpchp_wq, &info->work); |
457 | out: | 457 | out: |
458 | mutex_unlock(&p_slot->lock); | 458 | mutex_unlock(&p_slot->lock); |
459 | } | 459 | } |