From 7afbd60504ef1f0efdf248aa12e121c33b7fee0f Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 7 Jan 2019 05:59:58 +0000 Subject: [PATCH] Fix TI PCI1520 PCI Cardbus bridge, but others affected. On system with Celeron 1.5GHz CPU, sometimes when a PCMCIA to Compact Flash adapter containing a Compact Flash card is inserted in the cardbus slot the system hangs. This problem has not been observed in systems with a 2.8GHz XEON CPU or faster. Analysis of the cbb driver shows functional interrupts are routed to PCI BEFORE the interrupt handler for functional interrupts has been registered. Fix applied as described in the bug. PR: 128040 Submitted by: Arthur Hartwig --- sys/dev/pccbb/pccbb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index 11c68d7173b..c4fcd2af06e 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -275,6 +275,8 @@ cbb_enable_func_intr(struct cbb_softc *sc) reg = (exca_getb(&sc->exca[0], EXCA_INTR) & ~EXCA_INTR_IRQ_MASK) | EXCA_INTR_IRQ_NONE; exca_putb(&sc->exca[0], EXCA_INTR, reg); + PCI_MASK_CONFIG(sc->dev, CBBR_BRIDGECTRL, + & ~CBBM_BRIDGECTRL_INTR_IREQ_ISA_EN, 2); } int @@ -873,8 +875,6 @@ cbb_power(device_t brdev, int volts) reg_ctrl &= ~TOPIC97_REG_CTRL_CLKRUN_ENA; pci_write_config(sc->dev, TOPIC_REG_CTRL, reg_ctrl, 4); } - PCI_MASK_CONFIG(brdev, CBBR_BRIDGECTRL, - & ~CBBM_BRIDGECTRL_INTR_IREQ_ISA_EN, 2); retval = 1; done:; if (volts != 0 && sc->chipset == CB_O2MICRO)