Skip to content

Commit

Permalink
[SPARC64]: Handle LDC resets properly in domain-services driver.
Browse files Browse the repository at this point in the history
Reset the handshake and per-capability state so that when the
link comes back up we'll renegotiate the DS version and then
reregister all of the services.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jul 18, 2007
1 parent 6160f63 commit 8a2950c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions arch/sparc64/kernel/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,19 @@ static void ds_up(struct ds_info *dp)
dp->hs_state = DS_HS_START;
}

static void ds_reset(struct ds_info *dp)
{
int i;

dp->hs_state = 0;

for (i = 0; i < ARRAY_SIZE(ds_states); i++) {
struct ds_cap_state *cp = &ds_states[i];

cp->state = CAP_STATE_UNKNOWN;
}
}

static void ds_event(void *arg, int event)
{
struct ds_info *dp = arg;
Expand All @@ -1028,6 +1041,12 @@ static void ds_event(void *arg, int event)
return;
}

if (event == LDC_EVENT_RESET) {
ds_reset(dp);
spin_unlock_irqrestore(&ds_lock, flags);
return;
}

if (event != LDC_EVENT_DATA_READY) {
printk(KERN_WARNING PFX "Unexpected LDC event %d\n", event);
spin_unlock_irqrestore(&ds_lock, flags);
Expand Down

0 comments on commit 8a2950c

Please sign in to comment.