Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349006
b: refs/heads/master
c: c2be6f9
h: refs/heads/master
v: v3
  • Loading branch information
Yijing Wang authored and Bjorn Helgaas committed Jan 12, 2013
1 parent 089a0d1 commit 4faf5ce
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a82b6af37d20bfe6e99a4d890f1cf1d89059929f
refs/heads/master: c2be6f93b383c873a4f9d521afa49b1b67d06085
2 changes: 1 addition & 1 deletion trunk/drivers/pci/hotplug/pciehp.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ extern bool pciehp_poll_mode;
extern int pciehp_poll_time;
extern bool pciehp_debug;
extern bool pciehp_force;
extern struct workqueue_struct *pciehp_wq;

#define dbg(format, arg...) \
do { \
Expand Down Expand Up @@ -78,6 +77,7 @@ struct slot {
struct hotplug_slot *hotplug_slot;
struct delayed_work work; /* work for button event */
struct mutex lock;
struct workqueue_struct *wq;
};

struct event_info {
Expand Down
11 changes: 2 additions & 9 deletions trunk/drivers/pci/hotplug/pciehp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ bool pciehp_debug;
bool pciehp_poll_mode;
int pciehp_poll_time;
bool pciehp_force;
struct workqueue_struct *pciehp_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>"
Expand Down Expand Up @@ -340,26 +339,20 @@ static int __init pcied_init(void)
{
int retval = 0;

pciehp_wq = alloc_workqueue("pciehp", 0, 0);
if (!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_wq);
if (retval)
dbg("Failure to register service\n");
}

return retval;
}

static void __exit pcied_cleanup(void)
{
dbg("unload_pciehpd()\n");
pcie_port_service_unregister(&hpdriver_portdrv);
destroy_workqueue(pciehp_wq);
info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
}

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/pci/hotplug/pciehp_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static int queue_interrupt_event(struct slot *p_slot, u32 event_type)
info->p_slot = p_slot;
INIT_WORK(&info->work, interrupt_event_handler);

queue_work(pciehp_wq, &info->work);
queue_work(p_slot->wq, &info->work);

return 0;
}
Expand Down Expand Up @@ -344,7 +344,7 @@ void pciehp_queue_pushbutton_work(struct work_struct *work)
kfree(info);
goto out;
}
queue_work(pciehp_wq, &info->work);
queue_work(p_slot->wq, &info->work);
out:
mutex_unlock(&p_slot->lock);
}
Expand Down Expand Up @@ -377,7 +377,7 @@ static void handle_button_press_event(struct slot *p_slot)
if (ATTN_LED(ctrl))
pciehp_set_attention_status(p_slot, 0);

queue_delayed_work(pciehp_wq, &p_slot->work, 5*HZ);
queue_delayed_work(p_slot->wq, &p_slot->work, 5*HZ);
break;
case BLINKINGOFF_STATE:
case BLINKINGON_STATE:
Expand Down Expand Up @@ -439,7 +439,7 @@ static void handle_surprise_event(struct slot *p_slot)
else
p_slot->state = POWERON_STATE;

queue_work(pciehp_wq, &info->work);
queue_work(p_slot->wq, &info->work);
}

static void interrupt_event_handler(struct work_struct *work)
Expand Down
11 changes: 10 additions & 1 deletion trunk/drivers/pci/hotplug/pciehp_hpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,23 +773,32 @@ static void pcie_shutdown_notification(struct controller *ctrl)
static int pcie_init_slot(struct controller *ctrl)
{
struct slot *slot;
char name[32];

slot = kzalloc(sizeof(*slot), GFP_KERNEL);
if (!slot)
return -ENOMEM;

snprintf(name, sizeof(name), "pciehp-%u", PSN(ctrl));
slot->wq = alloc_workqueue(name, 0, 0);
if (!slot->wq)
goto abort;

slot->ctrl = ctrl;
mutex_init(&slot->lock);
INIT_DELAYED_WORK(&slot->work, pciehp_queue_pushbutton_work);
ctrl->slot = slot;
return 0;
abort:
kfree(slot);
return -ENOMEM;
}

static void pcie_cleanup_slot(struct controller *ctrl)
{
struct slot *slot = ctrl->slot;
cancel_delayed_work(&slot->work);
flush_workqueue(pciehp_wq);
destroy_workqueue(slot->wq);
kfree(slot);
}

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/pci/pcie/aer/aerdrv_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ static void aer_recover_work_func(struct work_struct *work)
continue;
}
do_recovery(pdev, entry.severity);
pci_dev_put(pdev);
}
}
#endif
Expand Down

0 comments on commit 4faf5ce

Please sign in to comment.