Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129785
b: refs/heads/master
c: 1cf167f
h: refs/heads/master
i:
  129783: a604fcd
v: v3
  • Loading branch information
Eilon Greenstein authored and David S. Miller committed Jan 15, 2009
1 parent f2fd82f commit 64e6c60
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 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: c53a6ee88b0a91bd012ef1b7988c0b93dae6f24d
refs/heads/master: 1cf167f27ad2720af11ee8aa350009342f909e70
2 changes: 1 addition & 1 deletion trunk/drivers/net/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ struct bnx2x {
int pm_cap;
int pcie_cap;

struct work_struct sp_task;
struct delayed_work sp_task;
struct work_struct reset_task;

struct timer_list timer;
Expand Down
20 changes: 15 additions & 5 deletions trunk/drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ MODULE_PARM_DESC(debug, "default debug msglevel");
module_param(use_multi, int, 0);
MODULE_PARM_DESC(use_multi, "use per-CPU queues");
#endif
static struct workqueue_struct *bnx2x_wq;

enum bnx2x_board_type {
BCM57710 = 0,
Expand Down Expand Up @@ -671,7 +672,8 @@ static void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw)
synchronize_irq(bp->pdev->irq);

/* make sure sp_task is not running */
cancel_work_sync(&bp->sp_task);
cancel_delayed_work(&bp->sp_task);
flush_workqueue(bnx2x_wq);
}

/* fast path */
Expand Down Expand Up @@ -1660,7 +1662,7 @@ static irqreturn_t bnx2x_interrupt(int irq, void *dev_instance)


if (unlikely(status & 0x1)) {
schedule_work(&bp->sp_task);
queue_delayed_work(bnx2x_wq, &bp->sp_task, 0);

status &= ~0x1;
if (!status)
Expand Down Expand Up @@ -2820,7 +2822,7 @@ static void bnx2x_attn_int(struct bnx2x *bp)

static void bnx2x_sp_task(struct work_struct *work)
{
struct bnx2x *bp = container_of(work, struct bnx2x, sp_task);
struct bnx2x *bp = container_of(work, struct bnx2x, sp_task.work);
u16 status;


Expand Down Expand Up @@ -2875,7 +2877,7 @@ static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
return IRQ_HANDLED;
#endif

schedule_work(&bp->sp_task);
queue_delayed_work(bnx2x_wq, &bp->sp_task, 0);

return IRQ_HANDLED;
}
Expand Down Expand Up @@ -7501,7 +7503,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)

mutex_init(&bp->port.phy_mutex);

INIT_WORK(&bp->sp_task, bnx2x_sp_task);
INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task);
INIT_WORK(&bp->reset_task, bnx2x_reset_task);

rc = bnx2x_get_hwinfo(bp);
Expand Down Expand Up @@ -10519,12 +10521,20 @@ static struct pci_driver bnx2x_pci_driver = {

static int __init bnx2x_init(void)
{
bnx2x_wq = create_singlethread_workqueue("bnx2x");
if (bnx2x_wq == NULL) {
printk(KERN_ERR PFX "Cannot create workqueue\n");
return -ENOMEM;
}

return pci_register_driver(&bnx2x_pci_driver);
}

static void __exit bnx2x_cleanup(void)
{
pci_unregister_driver(&bnx2x_pci_driver);

destroy_workqueue(bnx2x_wq);
}

module_init(bnx2x_init);
Expand Down

0 comments on commit 64e6c60

Please sign in to comment.