diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-03-09 20:23:44 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-03-09 20:23:44 +0000 |
commit | 2e46190af5d52f20442ff0e4c13017d9fab98844 (patch) | |
tree | 19922c3b414fb1e070e930e928e9b26782bf2228 /sys/dev/pci | |
parent | 5677175d9961aa539ccb0c059b6c5885d88431d1 (diff) |
Print interrupt string *after* establishing it.
Requested by miod@ (since xbow(4) on sgi secretly modifies the string behind
out back when interrupts get established).
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/qla_pci.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/qle.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/qlw_pci.c | 16 |
3 files changed, 27 insertions, 15 deletions
diff --git a/sys/dev/pci/qla_pci.c b/sys/dev/pci/qla_pci.c index 0b720670f95..d3202f0dbc6 100644 --- a/sys/dev/pci/qla_pci.c +++ b/sys/dev/pci/qla_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qla_pci.c,v 1.6 2014/02/17 03:57:20 dlg Exp $ */ +/* $OpenBSD: qla_pci.c,v 1.7 2014/03/09 20:23:43 kettenis Exp $ */ /* * Copyright (c) 2011 David Gwynne <dlg@openbsd.org> @@ -90,6 +90,7 @@ qla_pci_attach(struct device *parent, struct device *self, void *aux) struct qla_softc *sc = &psc->psc_qla; struct pci_attach_args *pa = aux; pci_intr_handle_t ih; + const char *intrstr; u_int32_t pcictl; #ifdef __sparc64__ u_int64_t wwn; @@ -123,15 +124,19 @@ qla_pci_attach(struct device *parent, struct device *self, void *aux) printf(": unable to map interrupt\n"); goto unmap; } - printf(": %s\n", pci_intr_string(psc->psc_pc, ih)); - + intrstr = pci_intr_string(psc->psc_pc, ih); psc->psc_ih = pci_intr_establish(psc->psc_pc, ih, IPL_BIO, qla_intr, sc, DEVNAME(sc)); if (psc->psc_ih == NULL) { - printf("%s: unable to establish interrupt\n", DEVNAME(sc)); + printf(": unable to establish interrupt"); + if (intrstr != NULL) + printf(" at %s", intrstr); + printf("\n"); goto deintr; } + printf(": %s\n", intrstr); + pcictl = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); pcictl |= PCI_COMMAND_INVALIDATE_ENABLE | PCI_COMMAND_PARITY_ENABLE | PCI_COMMAND_SERR_ENABLE; diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c index 6c43d806a7b..c340bc3c463 100644 --- a/sys/dev/pci/qle.c +++ b/sys/dev/pci/qle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qle.c,v 1.14 2014/02/25 13:08:16 jmatthew Exp $ */ +/* $OpenBSD: qle.c,v 1.15 2014/03/09 20:23:43 kettenis Exp $ */ /* * Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org> @@ -345,6 +345,7 @@ qle_attach(struct device *parent, struct device *self, void *aux) struct qle_softc *sc = (void *)self; struct pci_attach_args *pa = aux; pci_intr_handle_t ih; + const char *intrstr; u_int32_t pcictl; struct scsibus_attach_args saa; struct qle_init_cb *icb; @@ -381,15 +382,19 @@ qle_attach(struct device *parent, struct device *self, void *aux) printf(": unable to map interrupt\n"); goto unmap; } - printf(": %s\n", pci_intr_string(sc->sc_pc, ih)); - + intrstr = pci_intr_string(sc->sc_pc, ih); sc->sc_ih = pci_intr_establish(sc->sc_pc, ih, IPL_BIO, qle_intr, sc, DEVNAME(sc)); if (sc->sc_ih == NULL) { - printf("%s: unable to establish interrupt\n", DEVNAME(sc)); + printf(": unable to establish interrupt"); + if (intrstr != NULL) + printf(" at %s", intrstr); + printf("\n"); goto deintr; } + printf(": %s\n", intrstr); + pcictl = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); pcictl |= PCI_COMMAND_INVALIDATE_ENABLE | PCI_COMMAND_PARITY_ENABLE | PCI_COMMAND_SERR_ENABLE; diff --git a/sys/dev/pci/qlw_pci.c b/sys/dev/pci/qlw_pci.c index 2adfcb5eb66..ab7fad86781 100644 --- a/sys/dev/pci/qlw_pci.c +++ b/sys/dev/pci/qlw_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qlw_pci.c,v 1.7 2014/03/08 15:13:12 kettenis Exp $ */ +/* $OpenBSD: qlw_pci.c,v 1.8 2014/03/09 20:23:43 kettenis Exp $ */ /* * Copyright (c) 2011 David Gwynne <dlg@openbsd.org> @@ -105,6 +105,7 @@ qlw_pci_attach(struct device *parent, struct device *self, void *aux) struct qlw_softc *sc = &psc->psc_qlw; struct pci_attach_args *pa = aux; pci_intr_handle_t ih; + const char *intrstr; u_int32_t pcictl; #ifdef __sparc64__ int node, initiator; @@ -137,21 +138,22 @@ qlw_pci_attach(struct device *parent, struct device *self, void *aux) printf(": unable to map interrupt\n"); goto unmap; } - printf(": %s\n", pci_intr_string(psc->psc_pc, ih)); - + intrstr = pci_intr_string(psc->psc_pc, ih); psc->psc_ih = pci_intr_establish(psc->psc_pc, ih, IPL_BIO, qlw_intr, sc, DEVNAME(sc)); if (psc->psc_ih == NULL) { - printf("%s: unable to establish interrupt\n", DEVNAME(sc)); + printf(": unable to establish interrupt"); + if (intrstr != NULL) + printf(" at %s", intrstr); + printf("\n"); goto deintr; } + printf(": %s\n", intrstr); + pcictl = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); pcictl |= PCI_COMMAND_INVALIDATE_ENABLE | PCI_COMMAND_PARITY_ENABLE | PCI_COMMAND_SERR_ENABLE; - /* fw manual says to enable bus master here, then disable it while - * resetting.. hm. - */ pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, pcictl); pcictl = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_BHLC_REG); |