]>
Commit | Line | Data |
---|---|---|
23447c10 GKH |
1 | From d347e75847c1fb299c97736638f45e6ea39702d4 Mon Sep 17 00:00:00 2001 |
2 | From: Bjorn Helgaas <bhelgaas@google.com> | |
3 | Date: Fri, 11 Jan 2013 12:07:22 -0700 | |
4 | Subject: PCI: shpchp: Handle push button event asynchronously | |
5 | ||
6 | From: Bjorn Helgaas <bhelgaas@google.com> | |
7 | ||
8 | commit d347e75847c1fb299c97736638f45e6ea39702d4 upstream. | |
9 | ||
10 | Use non-ordered workqueue for attention button events. | |
11 | ||
12 | Attention button events on each slot can be handled asynchronously. So | |
13 | we should use non-ordered workqueue. This patch also removes ordered | |
14 | workqueue in shpchp as a result. | |
15 | ||
16 | 486b10b9f4 ("PCI: pciehp: Handle push button event asynchronously") made | |
17 | the same change to pciehp. I split this out from a patch by Yijing Wang | |
18 | <wangyijing@huawei.com> so we fix one thing at a time and to make the | |
19 | shpchp history correspond more closely with the pciehp history. | |
20 | ||
21 | Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> | |
22 | CC: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | |
23 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
24 | ||
25 | --- | |
26 | drivers/pci/hotplug/shpchp.h | 1 - | |
27 | drivers/pci/hotplug/shpchp_core.c | 10 ---------- | |
28 | drivers/pci/hotplug/shpchp_ctrl.c | 2 +- | |
29 | 3 files changed, 1 insertion(+), 12 deletions(-) | |
30 | ||
31 | --- a/drivers/pci/hotplug/shpchp.h | |
32 | +++ b/drivers/pci/hotplug/shpchp.h | |
33 | @@ -47,7 +47,6 @@ extern bool shpchp_poll_mode; | |
34 | extern int shpchp_poll_time; | |
35 | extern bool shpchp_debug; | |
36 | extern struct workqueue_struct *shpchp_wq; | |
37 | -extern struct workqueue_struct *shpchp_ordered_wq; | |
38 | ||
39 | #define dbg(format, arg...) \ | |
40 | do { \ | |
41 | --- a/drivers/pci/hotplug/shpchp_core.c | |
42 | +++ b/drivers/pci/hotplug/shpchp_core.c | |
43 | @@ -40,7 +40,6 @@ bool shpchp_debug; | |
44 | bool shpchp_poll_mode; | |
45 | int shpchp_poll_time; | |
46 | struct workqueue_struct *shpchp_wq; | |
47 | -struct workqueue_struct *shpchp_ordered_wq; | |
48 | ||
49 | #define DRIVER_VERSION "0.4" | |
50 | #define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>, Dely Sy <dely.l.sy@intel.com>" | |
51 | @@ -175,7 +174,6 @@ void cleanup_slots(struct controller *ct | |
52 | list_del(&slot->slot_list); | |
53 | cancel_delayed_work(&slot->work); | |
54 | flush_workqueue(shpchp_wq); | |
55 | - flush_workqueue(shpchp_ordered_wq); | |
56 | pci_hp_deregister(slot->hotplug_slot); | |
57 | } | |
58 | } | |
59 | @@ -364,17 +362,10 @@ static int __init shpcd_init(void) | |
60 | if (!shpchp_wq) | |
61 | return -ENOMEM; | |
62 | ||
63 | - shpchp_ordered_wq = alloc_ordered_workqueue("shpchp_ordered", 0); | |
64 | - if (!shpchp_ordered_wq) { | |
65 | - destroy_workqueue(shpchp_wq); | |
66 | - return -ENOMEM; | |
67 | - } | |
68 | - | |
69 | retval = pci_register_driver(&shpc_driver); | |
70 | dbg("%s: pci_register_driver = %d\n", __func__, retval); | |
71 | info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); | |
72 | if (retval) { | |
73 | - destroy_workqueue(shpchp_ordered_wq); | |
74 | destroy_workqueue(shpchp_wq); | |
75 | } | |
76 | return retval; | |
77 | @@ -384,7 +375,6 @@ static void __exit shpcd_cleanup(void) | |
78 | { | |
79 | dbg("unload_shpchpd()\n"); | |
80 | pci_unregister_driver(&shpc_driver); | |
81 | - destroy_workqueue(shpchp_ordered_wq); | |
82 | destroy_workqueue(shpchp_wq); | |
83 | info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n"); | |
84 | } | |
85 | --- a/drivers/pci/hotplug/shpchp_ctrl.c | |
86 | +++ b/drivers/pci/hotplug/shpchp_ctrl.c | |
87 | @@ -456,7 +456,7 @@ void shpchp_queue_pushbutton_work(struct | |
88 | kfree(info); | |
89 | goto out; | |
90 | } | |
91 | - queue_work(shpchp_ordered_wq, &info->work); | |
92 | + queue_work(shpchp_wq, &info->work); | |
93 | out: | |
94 | mutex_unlock(&p_slot->lock); | |
95 | } |