]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PCI: shpchp: Handle push button event asynchronously
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 11 Jan 2013 19:07:22 +0000 (12:07 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 6 Feb 2013 04:33:33 +0000 (04:33 +0000)
commit d347e75847c1fb299c97736638f45e6ea39702d4 upstream.

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/pci/hotplug/shpchp.h
drivers/pci/hotplug/shpchp_core.c
drivers/pci/hotplug/shpchp_ctrl.c

index e0c90e643b5f457e0bb600aedd298fb1b27a6f8c..0b9eb75482f4b12b6fda7a9e734633cfbc6df373 100644 (file)
@@ -47,7 +47,6 @@ extern int shpchp_poll_mode;
 extern int shpchp_poll_time;
 extern int shpchp_debug;
 extern struct workqueue_struct *shpchp_wq;
-extern struct workqueue_struct *shpchp_ordered_wq;
 
 #define dbg(format, arg...)                                            \
 do {                                                                   \
index dd7e0c51a33e5e5f79eb9f11b444fe4667d2ba2d..e2b35360d4ff7183ee09f07003e7786152fe98be 100644 (file)
@@ -40,7 +40,6 @@ 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>"
@@ -175,7 +174,6 @@ void cleanup_slots(struct controller *ctrl)
                list_del(&slot->slot_list);
                cancel_delayed_work(&slot->work);
                flush_workqueue(shpchp_wq);
-               flush_workqueue(shpchp_ordered_wq);
                pci_hp_deregister(slot->hotplug_slot);
        }
 }
@@ -364,17 +362,10 @@ static int __init shpcd_init(void)
        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;
@@ -384,7 +375,6 @@ 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");
 }
index b00b09bdd38aab2b5f442bd1e6b552a2046a3108..bba5b3e0bf8ae7cc89e4064b6efd0b3fc1de7461 100644 (file)
@@ -456,7 +456,7 @@ void shpchp_queue_pushbutton_work(struct work_struct *work)
                kfree(info);
                goto out;
        }
-       queue_work(shpchp_ordered_wq, &info->work);
+       queue_work(shpchp_wq, &info->work);
  out:
        mutex_unlock(&p_slot->lock);
 }