diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2018-01-06 21:35:46 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2018-01-06 21:35:46 +0000 |
commit | 7f80d5805c4f4bd667df787ff0b8913b5d8bf4a2 (patch) | |
tree | 3ed4e8b915a6cebde398119a137dde0f69999fe0 /sys/arch/sparc64/dev | |
parent | d6fc9c931d87f5810e2779d8385422fc259e395b (diff) |
Fix an interrupt storm condition in vldcp(8) (sparc64).
If the Rx channel goes down with pending data on the ring, toss the pending
data to ensure that the firmware's rx ring head index matches the rx ring
tail index. Otherwise we trigger an interrupt storm since vldcpread() never
consumes pending data while the channel is down, and the firmware keeps
triggering the interrupt until all data on the ring is consumed.
Interrupt storm observed and fix tested on a T5220 (which can now run
ldom guests; without this fix starting ldomd would trigger the problem).
ok kettenis@
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r-- | sys/arch/sparc64/dev/vldcp.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/arch/sparc64/dev/vldcp.c b/sys/arch/sparc64/dev/vldcp.c index c51f2220459..f8ebc731089 100644 --- a/sys/arch/sparc64/dev/vldcp.c +++ b/sys/arch/sparc64/dev/vldcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vldcp.c,v 1.12 2015/02/10 22:04:00 miod Exp $ */ +/* $OpenBSD: vldcp.c,v 1.13 2018/01/06 21:35:45 stsp Exp $ */ /* * Copyright (c) 2009, 2012 Mark Kettenis * @@ -248,6 +248,14 @@ vldcp_rx_intr(void *arg) switch (rx_state) { case LDC_CHANNEL_DOWN: DPRINTF(("Rx link down\n")); + if (rx_head == rx_tail) + break; + /* Discard and ack pending I/O. */ + DPRINTF(("setting rx qhead to %lld\n", rx_tail)); + err = hv_ldc_rx_set_qhead(lc->lc_id, rx_tail); + if (err == H_EOK) + break; + printf("%s: hv_ldc_rx_set_qhead %d\n", __func__, err); break; case LDC_CHANNEL_UP: DPRINTF(("Rx link up\n")); |