diff options
author | Tejun Heo <tj@kernel.org> | 2010-10-18 02:33:02 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-10-18 02:33:02 -0400 |
commit | e24dcbef93dbbf529fbedfc6ce8ab22d2cef35f0 (patch) | |
tree | 6ab3a2004ed8d21a48ce2eeda6c5b733b76599e4 /drivers/pci/hotplug/shpchp_hpc.c | |
parent | a827ea307b147aeb050803433b3f6842582c6ced (diff) |
shpchp: update workqueue usage
* Rename shpchp_wq to shpchp_ordered_wq and add non-ordered shpchp_wq
which is used instead of the system workqueue. This is to remove
the use of flush_scheduled_work() which is deprecated and scheduled
for removal.
* With cmwq in place, there's no point in creating workqueues lazily.
Create both shpchp_wq and shpchp_ordered_wq upfront.
* Include workqueue.h from shpchp.h.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/shpchp_hpc.c')
-rw-r--r-- | drivers/pci/hotplug/shpchp_hpc.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c index d3985e7deab7..36547f0ce305 100644 --- a/drivers/pci/hotplug/shpchp_hpc.c +++ b/drivers/pci/hotplug/shpchp_hpc.c | |||
@@ -179,8 +179,6 @@ | |||
179 | #define SLOT_EVENT_LATCH 0x2 | 179 | #define SLOT_EVENT_LATCH 0x2 |
180 | #define SLOT_SERR_INT_MASK 0x3 | 180 | #define SLOT_SERR_INT_MASK 0x3 |
181 | 181 | ||
182 | static atomic_t shpchp_num_controllers = ATOMIC_INIT(0); | ||
183 | |||
184 | static irqreturn_t shpc_isr(int irq, void *dev_id); | 182 | static irqreturn_t shpc_isr(int irq, void *dev_id); |
185 | static void start_int_poll_timer(struct controller *ctrl, int sec); | 183 | static void start_int_poll_timer(struct controller *ctrl, int sec); |
186 | static int hpc_check_cmd_status(struct controller *ctrl); | 184 | static int hpc_check_cmd_status(struct controller *ctrl); |
@@ -614,13 +612,6 @@ static void hpc_release_ctlr(struct controller *ctrl) | |||
614 | 612 | ||
615 | iounmap(ctrl->creg); | 613 | iounmap(ctrl->creg); |
616 | release_mem_region(ctrl->mmio_base, ctrl->mmio_size); | 614 | release_mem_region(ctrl->mmio_base, ctrl->mmio_size); |
617 | |||
618 | /* | ||
619 | * If this is the last controller to be released, destroy the | ||
620 | * shpchpd work queue | ||
621 | */ | ||
622 | if (atomic_dec_and_test(&shpchp_num_controllers)) | ||
623 | destroy_workqueue(shpchp_wq); | ||
624 | } | 615 | } |
625 | 616 | ||
626 | static int hpc_power_on_slot(struct slot * slot) | 617 | static int hpc_power_on_slot(struct slot * slot) |
@@ -1077,9 +1068,8 @@ int shpc_init(struct controller *ctrl, struct pci_dev *pdev) | |||
1077 | 1068 | ||
1078 | rc = request_irq(ctrl->pci_dev->irq, shpc_isr, IRQF_SHARED, | 1069 | rc = request_irq(ctrl->pci_dev->irq, shpc_isr, IRQF_SHARED, |
1079 | MY_NAME, (void *)ctrl); | 1070 | MY_NAME, (void *)ctrl); |
1080 | ctrl_dbg(ctrl, "request_irq %d for hpc%d (returns %d)\n", | 1071 | ctrl_dbg(ctrl, "request_irq %d (returns %d)\n", |
1081 | ctrl->pci_dev->irq, | 1072 | ctrl->pci_dev->irq, rc); |
1082 | atomic_read(&shpchp_num_controllers), rc); | ||
1083 | if (rc) { | 1073 | if (rc) { |
1084 | ctrl_err(ctrl, "Can't get irq %d for the hotplug " | 1074 | ctrl_err(ctrl, "Can't get irq %d for the hotplug " |
1085 | "controller\n", ctrl->pci_dev->irq); | 1075 | "controller\n", ctrl->pci_dev->irq); |
@@ -1092,18 +1082,6 @@ int shpc_init(struct controller *ctrl, struct pci_dev *pdev) | |||
1092 | shpc_get_cur_bus_speed(ctrl); | 1082 | shpc_get_cur_bus_speed(ctrl); |
1093 | 1083 | ||
1094 | /* | 1084 | /* |
1095 | * If this is the first controller to be initialized, | ||
1096 | * initialize the shpchpd work queue | ||
1097 | */ | ||
1098 | if (atomic_add_return(1, &shpchp_num_controllers) == 1) { | ||
1099 | shpchp_wq = create_singlethread_workqueue("shpchpd"); | ||
1100 | if (!shpchp_wq) { | ||
1101 | rc = -ENOMEM; | ||
1102 | goto abort_iounmap; | ||
1103 | } | ||
1104 | } | ||
1105 | |||
1106 | /* | ||
1107 | * Unmask all event interrupts of all slots | 1085 | * Unmask all event interrupts of all slots |
1108 | */ | 1086 | */ |
1109 | for (hp_slot = 0; hp_slot < ctrl->num_slots; hp_slot++) { | 1087 | for (hp_slot = 0; hp_slot < ctrl->num_slots; hp_slot++) { |