diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-10-26 20:57:09 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-10-26 20:57:09 +0000 |
commit | 7d41be046b9e96106c664ba02451a7a3b5c954f6 (patch) | |
tree | bef84596bdb74f2338ba0c042096445dd3e7aed8 /sys/arch | |
parent | 5d26c2a62ef5a021ff14d9c55693b39494397394 (diff) |
Turns out that for devices that attach to cbus(4), it is better to disable
interrupts up-front and explicitly enabling them later than the other way
around.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc64/dev/cbus.c | 14 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/vcctty.c | 5 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/vdsk.c | 5 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/vdsp.c | 10 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/vldcp.c | 5 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/vnet.c | 10 |
6 files changed, 18 insertions, 31 deletions
diff --git a/sys/arch/sparc64/dev/cbus.c b/sys/arch/sparc64/dev/cbus.c index 999abfc4cbe..2716b44c7b8 100644 --- a/sys/arch/sparc64/dev/cbus.c +++ b/sys/arch/sparc64/dev/cbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cbus.c,v 1.8 2010/11/11 17:58:23 miod Exp $ */ +/* $OpenBSD: cbus.c,v 1.9 2012/10/26 20:57:07 kettenis Exp $ */ /* * Copyright (c) 2008 Mark Kettenis * @@ -177,6 +177,12 @@ cbus_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle, if (ih == NULL) return (NULL); + err = hv_vintr_setenabled(devhandle, devino, INTR_DISABLED); + if (err != H_EOK) { + printf("hv_vintr_setenabled: %d\n", err); + return (NULL); + } + intr_establish(ih->ih_pil, ih); ih->ih_ack = cbus_intr_ack; @@ -193,12 +199,6 @@ cbus_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle, return (NULL); } - err = hv_vintr_setenabled(devhandle, devino, INTR_ENABLED); - if (err != H_EOK) { - printf("hv_vintr_setenabled: %d\n", err); - return (NULL); - } - return (ih); } diff --git a/sys/arch/sparc64/dev/vcctty.c b/sys/arch/sparc64/dev/vcctty.c index 1f839962d58..f2484ebf18a 100644 --- a/sys/arch/sparc64/dev/vcctty.c +++ b/sys/arch/sparc64/dev/vcctty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vcctty.c,v 1.7 2012/10/20 12:00:33 miod Exp $ */ +/* $OpenBSD: vcctty.c,v 1.8 2012/10/26 20:57:08 kettenis Exp $ */ /* * Copyright (c) 2009 Mark Kettenis * @@ -154,6 +154,9 @@ vcctty_attach(struct device *parent, struct device *self, void *aux) if (err != H_EOK) printf("%d: hv_ldc_rx_qconf %d\n", __func__, err); + cbus_intr_setenabled(sc->sc_tx_sysino, INTR_ENABLED); + cbus_intr_setenabled(sc->sc_rx_sysino, INTR_ENABLED); + printf(" domain \"%s\"\n", ca->ca_name); return; diff --git a/sys/arch/sparc64/dev/vdsk.c b/sys/arch/sparc64/dev/vdsk.c index be7af5a9ef8..8d58cf77686 100644 --- a/sys/arch/sparc64/dev/vdsk.c +++ b/sys/arch/sparc64/dev/vdsk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsk.c,v 1.29 2011/07/17 22:46:47 matthew Exp $ */ +/* $OpenBSD: vdsk.c,v 1.30 2012/10/26 20:57:08 kettenis Exp $ */ /* * Copyright (c) 2009, 2011 Mark Kettenis * @@ -314,6 +314,9 @@ vdsk_attach(struct device *parent, struct device *self, void *aux) if (err != H_EOK) printf("hv_ldc_rx_qconf %d\n", err); + cbus_intr_setenabled(sysino[0], INTR_ENABLED); + cbus_intr_setenabled(sysino[1], INTR_ENABLED); + ldc_send_vers(lc); printf("\n"); diff --git a/sys/arch/sparc64/dev/vdsp.c b/sys/arch/sparc64/dev/vdsp.c index 6bcf6e75cd2..9db26fb9ad6 100644 --- a/sys/arch/sparc64/dev/vdsp.c +++ b/sys/arch/sparc64/dev/vdsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsp.c,v 1.12 2012/10/21 19:30:56 kettenis Exp $ */ +/* $OpenBSD: vdsp.c,v 1.13 2012/10/26 20:57:08 kettenis Exp $ */ /* * Copyright (c) 2009, 2011 Mark Kettenis * @@ -338,14 +338,6 @@ vdsp_attach(struct device *parent, struct device *self, void *aux) return; } - /* - * Disable interrupts while we have no queues allocated. - * Otherwise we may end up with an interrupt storm as soon as - * our peer places a packet in their transmit queue. - */ - cbus_intr_setenabled(sc->sc_tx_sysino, INTR_DISABLED); - cbus_intr_setenabled(sc->sc_rx_sysino, INTR_DISABLED); - lc = &sc->sc_lc; lc->lc_id = ca->ca_id; lc->lc_sc = sc; diff --git a/sys/arch/sparc64/dev/vldcp.c b/sys/arch/sparc64/dev/vldcp.c index e8973f348c7..34e9d8f1e66 100644 --- a/sys/arch/sparc64/dev/vldcp.c +++ b/sys/arch/sparc64/dev/vldcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vldcp.c,v 1.3 2012/10/21 17:30:38 kettenis Exp $ */ +/* $OpenBSD: vldcp.c,v 1.4 2012/10/26 20:57:08 kettenis Exp $ */ /* * Copyright (c) 2009, 2012 Mark Kettenis * @@ -137,9 +137,6 @@ vldcp_attach(struct device *parent, struct device *self, void *aux) return; } - cbus_intr_setenabled(sc->sc_tx_sysino, INTR_DISABLED); - cbus_intr_setenabled(sc->sc_rx_sysino, INTR_DISABLED); - lc = &sc->sc_lc; lc->lc_id = ca->ca_id; lc->lc_sc = sc; diff --git a/sys/arch/sparc64/dev/vnet.c b/sys/arch/sparc64/dev/vnet.c index bc1aa681d3f..1dccab20b1e 100644 --- a/sys/arch/sparc64/dev/vnet.c +++ b/sys/arch/sparc64/dev/vnet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vnet.c,v 1.25 2010/04/15 19:47:32 kettenis Exp $ */ +/* $OpenBSD: vnet.c,v 1.26 2012/10/26 20:57:08 kettenis Exp $ */ /* * Copyright (c) 2009 Mark Kettenis * @@ -279,14 +279,6 @@ vnet_attach(struct device *parent, struct device *self, void *aux) return; } - /* - * Disable interrupts while we have no queues allocated. - * Otherwise we may end up with an interrupt storm as soon as - * our peer places a packet in their transmit queue. - */ - cbus_intr_setenabled(sc->sc_tx_sysino, INTR_DISABLED); - cbus_intr_setenabled(sc->sc_rx_sysino, INTR_DISABLED); - lc = &sc->sc_lc; lc->lc_id = ca->ca_id; lc->lc_sc = sc; |