From d224ede0da304f9531f385643f1255d4570a1ab3 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 15 Jul 2005 03:25:22 +0000 Subject: [PATCH] Move to using tsleeps in the cardbus reset case as well. This eliminates the last of the DELAYs in pccbb. --- sys/dev/pccbb/pccbb.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index 2614a2eae79b..65c5a9899939 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -893,17 +893,21 @@ cbb_cardbus_reset(device_t brdev) struct cbb_softc *sc = device_get_softc(brdev); int delay_us; - delay_us = sc->chipset == CB_RF5C47X ? 400*1000 : 20*1000; + /* + * 20ms is necessary for most bridges. For some reason, the Ricoh + * RF5C47x bridges need 400ms. + */ + delay = sc->chipset == CB_RF5C47X ? 400 : 20; PCI_MASK_CONFIG(brdev, CBBR_BRIDGECTRL, |CBBM_BRIDGECTRL_RESET, 2); - DELAY(delay_us); + tsleep(sc, PZERO, "cbbP3", hz * delay / 1000); /* If a card exists, unreset it! */ if (CBB_CARD_PRESENT(cbb_get(sc, CBB_SOCKET_STATE))) { PCI_MASK_CONFIG(brdev, CBBR_BRIDGECTRL, &~CBBM_BRIDGECTRL_RESET, 2); - DELAY(delay_us); + tsleep(sc, PZERO, "cbbP3", hz * delay / 1000); } }