summaryrefslogtreecommitdiffstats
path: root/sys/pccard
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-08-24 17:29:42 +0000
committerimp <imp@FreeBSD.org>2001-08-24 17:29:42 +0000
commit7dc16b8484fc60eae3e0b14131479455119b79f9 (patch)
treecc2b0b15b67c4aff184470e1e231c51d79bf7aec /sys/pccard
parent3130e8ec52881235137955ef11711836b1e1efd5 (diff)
downloadFreeBSD-src-7dc16b8484fc60eae3e0b14131479455119b79f9.zip
FreeBSD-src-7dc16b8484fc60eae3e0b14131479455119b79f9.tar.gz
Explain what we're doing in pcic_pci_shutdown a little better. Try to
explain the subtle side effects that are going to happen and why we go ahead and ack the interrupt source. This stuff is tricky to get right. Also, emperical tests have shown that doing a shutdown in attach to be ineffectual, so remove it from there. Analysis of the code paths shows that nearly identical writes to these registers happen in later parts of the code. The hanging problem on thinkpads when we change the interrupt routing type is something else.
Diffstat (limited to 'sys/pccard')
-rw-r--r--sys/pccard/pcic_pci.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/sys/pccard/pcic_pci.c b/sys/pccard/pcic_pci.c
index 7627cc2..9c4c891 100644
--- a/sys/pccard/pcic_pci.c
+++ b/sys/pccard/pcic_pci.c
@@ -677,13 +677,26 @@ pcic_pci_shutdown(device_t dev)
sp = &sc->slots[0];
/*
- * Turn off the power to the slot before we do anything
- * with it.
+ * Turn off the power to the slot in an attempt to
+ * keep the system from hanging on reboot. We also turn off
+ * card interrupts in an attempt to control interrupt storms.
+ * on some (all?) this has the effect of also turning off
+ * card status change interrupts. A side effect of writing 0
+ * to INT_GEN is that the card is placed into "reset" mode
+ * where nothing happens until it is taken out of "reset"
+ * mode.
*/
sp->putb(sp, PCIC_INT_GEN, 0);
sp->putb(sp, PCIC_POWER, 0);
- /* Ack any pending interrupts */
+ /*
+ * Writing to INT_GEN can cause an interrupt, so we blindly
+ * ack all possible interrupts here. Reading the stat change
+ * shouldn't be necessary, but some TI chipsets need it in the
+ * normal course of operations, so we do it here too. We can't
+ * lose any interrupts after this point, so go ahead and ack
+ * everything. The bits in INT_GEN clear upon reading them.
+ */
bus_space_write_4(sp->bst, sp->bsh, 0, 0xffffffff);
sp->getb(sp, PCIC_STAT_CHG);
}
@@ -765,8 +778,6 @@ pcic_pci_attach(device_t dev)
sc->csc_route = pcic_intr_path;
sc->func_route = pcic_intr_path;
- pcic_pci_shutdown(dev);
-
if (itm && itm->init)
itm->init(dev);
else
OpenPOWER on IntegriCloud