Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6682
b: refs/heads/master
c: 58c5900
h: refs/heads/master
v: v3
  • Loading branch information
Michael Ellerman authored and Jeff Garzik committed Sep 1, 2005
1 parent bd957c0 commit fd2f096
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 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: abfda4719c61550be4efaf277d4a904a7930d410
refs/heads/master: 58c5900bdaffbf76afd7ad5e053410cb95eb3169
25 changes: 23 additions & 2 deletions trunk/drivers/net/iseries_veth.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,14 @@ static void veth_take_monitor_ack(struct veth_lpar_connection *cnx,

spin_lock_irqsave(&cnx->lock, flags);
veth_debug("cnx %d: lost connection.\n", cnx->remote_lp);
cnx->state |= VETH_STATE_RESET;
veth_kick_statemachine(cnx);

/* Avoid kicking the statemachine once we're shutdown.
* It's unnecessary and it could break veth_stop_connection(). */

if (! (cnx->state & VETH_STATE_SHUTDOWN)) {
cnx->state |= VETH_STATE_RESET;
veth_kick_statemachine(cnx);
}
spin_unlock_irqrestore(&cnx->lock, flags);
}

Expand Down Expand Up @@ -483,6 +489,12 @@ static void veth_statemachine(void *p)

if (cnx->state & VETH_STATE_RESET)
goto restart;

/* Hack, wait for the other end to reset itself. */
if (! (cnx->state & VETH_STATE_SHUTDOWN)) {
schedule_delayed_work(&cnx->statemachine_wq, 5 * HZ);
goto out;
}
}

if (cnx->state & VETH_STATE_SHUTDOWN)
Expand Down Expand Up @@ -667,6 +679,15 @@ static void veth_stop_connection(u8 rlp)
veth_kick_statemachine(cnx);
spin_unlock_irq(&cnx->lock);

/* There's a slim chance the reset code has just queued the
* statemachine to run in five seconds. If so we need to cancel
* that and requeue the work to run now. */
if (cancel_delayed_work(&cnx->statemachine_wq)) {
spin_lock_irq(&cnx->lock);
veth_kick_statemachine(cnx);
spin_unlock_irq(&cnx->lock);
}

/* Wait for the state machine to run. */
flush_scheduled_work();

Expand Down

0 comments on commit fd2f096

Please sign in to comment.