]> git.karo-electronics.de Git - linux-beck.git/commitdiff
PCI: pciehp: Handle push button event asynchronously
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Mon, 7 Nov 2011 11:56:50 +0000 (20:56 +0900)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 5 Dec 2011 18:21:47 +0000 (10:21 -0800)
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 pciehp as a result.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/hotplug/pciehp.h
drivers/pci/hotplug/pciehp_core.c
drivers/pci/hotplug/pciehp_ctrl.c
drivers/pci/hotplug/pciehp_hpc.c

index 838f571027b750e390090fb06dc032abda3db639..9a33fdde2d1639ae5722eef34f37771d01bd6594 100644 (file)
@@ -45,7 +45,6 @@ extern int pciehp_poll_time;
 extern int pciehp_debug;
 extern int pciehp_force;
 extern struct workqueue_struct *pciehp_wq;
-extern struct workqueue_struct *pciehp_ordered_wq;
 
 #define dbg(format, arg...)                                            \
 do {                                                                   \
index a13ad1308adb3563d8108c300510948b41ee82a6..b8c99d35ac97af9aef83c5e46b9e9337bf7e9610 100644 (file)
@@ -43,7 +43,6 @@ int pciehp_poll_mode;
 int pciehp_poll_time;
 int pciehp_force;
 struct workqueue_struct *pciehp_wq;
-struct workqueue_struct *pciehp_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>"
@@ -345,18 +344,11 @@ static int __init pcied_init(void)
        if (!pciehp_wq)
                return -ENOMEM;
 
-       pciehp_ordered_wq = alloc_ordered_workqueue("pciehp_ordered", 0);
-       if (!pciehp_ordered_wq) {
-               destroy_workqueue(pciehp_wq);
-               return -ENOMEM;
-       }
-
        pciehp_firmware_init();
        retval = pcie_port_service_register(&hpdriver_portdrv);
        dbg("pcie_port_service_register = %d\n", retval);
        info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
        if (retval) {
-               destroy_workqueue(pciehp_ordered_wq);
                destroy_workqueue(pciehp_wq);
                dbg("Failure to register service\n");
        }
@@ -367,7 +359,6 @@ static void __exit pcied_cleanup(void)
 {
        dbg("unload_pciehpd()\n");
        pcie_port_service_unregister(&hpdriver_portdrv);
-       destroy_workqueue(pciehp_ordered_wq);
        destroy_workqueue(pciehp_wq);
        info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
 }
index 085dbb5fc168be33de77d0ced5c411c807ffc2ef..27f44295a65738976b4be0f07f4cd33b04e2cc85 100644 (file)
@@ -344,7 +344,7 @@ void pciehp_queue_pushbutton_work(struct work_struct *work)
                kfree(info);
                goto out;
        }
-       queue_work(pciehp_ordered_wq, &info->work);
+       queue_work(pciehp_wq, &info->work);
  out:
        mutex_unlock(&p_slot->lock);
 }
@@ -439,7 +439,7 @@ static void handle_surprise_event(struct slot *p_slot)
        else
                p_slot->state = POWERON_STATE;
 
-       queue_work(pciehp_ordered_wq, &info->work);
+       queue_work(pciehp_wq, &info->work);
 }
 
 static void interrupt_event_handler(struct work_struct *work)
index 7b1414810ae3e0e0a5ccbcd9bec0f21051cf95db..bcdbb16436216886949ed44352d1c0ea4606f21a 100644 (file)
@@ -806,7 +806,6 @@ static void pcie_cleanup_slot(struct controller *ctrl)
        struct slot *slot = ctrl->slot;
        cancel_delayed_work(&slot->work);
        flush_workqueue(pciehp_wq);
-       flush_workqueue(pciehp_ordered_wq);
        kfree(slot);
 }