diff options
author | Alexander Yurchenko <grange@cvs.openbsd.org> | 2006-01-15 10:06:07 +0000 |
---|---|---|
committer | Alexander Yurchenko <grange@cvs.openbsd.org> | 2006-01-15 10:06:07 +0000 |
commit | 7cb21437ce6acbba8ec9be80f0347045282fe62d (patch) | |
tree | d850fc4cbc438b7d98a2c9b7521f3a5d13427a8f /sys/dev/pci/ichiic.c | |
parent | 77a8838c1081e34154d1e3d4b213f141e56644a2 (diff) |
Sync with piixpm: allow driver to continue to work in polling mode
if it failed to install interrupt handler.
Diffstat (limited to 'sys/dev/pci/ichiic.c')
-rw-r--r-- | sys/dev/pci/ichiic.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/sys/dev/pci/ichiic.c b/sys/dev/pci/ichiic.c index 8dccbdfbb37..4cdc1066008 100644 --- a/sys/dev/pci/ichiic.c +++ b/sys/dev/pci/ichiic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ichiic.c,v 1.10 2006/01/05 10:43:15 grange Exp $ */ +/* $OpenBSD: ichiic.c,v 1.11 2006/01/15 10:06:06 grange Exp $ */ /* * Copyright (c) 2005, 2006 Alexander Yurchenko <grange@openbsd.org> @@ -132,26 +132,23 @@ ichiic_attach(struct device *parent, struct device *self, void *aux) return; } + sc->sc_poll = 1; if (conf & ICH_SMB_HOSTC_SMIEN) { + /* No PCI IRQ */ printf(": SMI"); - sc->sc_poll = 1; } else { /* Install interrupt handler */ - if (pci_intr_map(pa, &ih)) { - printf(": can't map interrupt\n"); - goto fail; + if (pci_intr_map(pa, &ih) == 0) { + intrstr = pci_intr_string(pa->pa_pc, ih); + sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO, + ichiic_intr, sc, sc->sc_dev.dv_xname); + if (sc->sc_ih != NULL) { + printf(": %s", intrstr); + sc->sc_poll = 0; + } } - intrstr = pci_intr_string(pa->pa_pc, ih); - sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO, - ichiic_intr, sc, sc->sc_dev.dv_xname); - if (sc->sc_ih == NULL) { - printf(": can't establish interrupt"); - if (intrstr != NULL) - printf(" at %s", intrstr); - printf("\n"); - goto fail; - } - printf(": %s", intrstr); + if (sc->sc_poll) + printf(": polling"); } printf("\n"); @@ -169,9 +166,6 @@ ichiic_attach(struct device *parent, struct device *self, void *aux) config_found(self, &iba, iicbus_print); return; - -fail: - bus_space_unmap(sc->sc_iot, sc->sc_ioh, iosize); } int |