lkml.org 
[lkml]   [2013]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH v7 3/4] PCI: shpchp: Handle push button event asynchronously
    From
    Date
    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>
    ---
    drivers/pci/hotplug/shpchp.h | 1 -
    drivers/pci/hotplug/shpchp_core.c | 10 ----------
    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 ca64932..1b69d95 100644
    --- a/drivers/pci/hotplug/shpchp.h
    +++ b/drivers/pci/hotplug/shpchp.h
    @@ -47,7 +47,6 @@ extern bool shpchp_poll_mode;
    extern int shpchp_poll_time;
    extern bool shpchp_debug;
    extern struct workqueue_struct *shpchp_wq;
    -extern struct workqueue_struct *shpchp_ordered_wq;

    #define dbg(format, arg...) \
    do { \
    diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
    index 59ca86c..3774e0d 100644
    --- a/drivers/pci/hotplug/shpchp_core.c
    +++ b/drivers/pci/hotplug/shpchp_core.c
    @@ -40,7 +40,6 @@ bool shpchp_debug;
    bool 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>"
    @@ -181,7 +180,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);
    }
    }
    @@ -370,17 +368,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;
    @@ -390,7 +381,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");
    }
    diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
    index f9b5a52..fd2cae9 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)
    kfree(info);
    goto out;
    }
    - queue_work(shpchp_ordered_wq, &info->work);
    + queue_work(shpchp_wq, &info->work);
    out:
    mutex_unlock(&p_slot->lock);
    }


    \
     
     \ /
      Last update: 2013-01-14 01:21    [W:5.462 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site