DF-3596 / fix.diff
--- a/sys/dev/netif/bwn/bwn/if_bwn.c +++ b/sys/dev/netif/bwn/bwn/if_bwn.c @@ -5167,11 +5167,18 @@ static void bwn_intr_pmq(struct bwn_mac *mac) { uint32_t tmp; + int i; - while (1) { + for (i = 0; i < 1000; i++) { tmp = BWN_READ_4(mac, BWN_PS_STATUS); if (!(tmp & 0x00000008)) break; + DELAY(10); } + if (i >= 1000) + device_printf(mac->mac_sc->sc_dev, + "%s: PS_STATUS drain timed out\n", __func__); BWN_WRITE_2(mac, BWN_PS_STATUS, 0x0002); } @@ -2226,13 +2233,17 @@ static void bwn_core_start(struct bwn_mac *mac) { struct bwn_softc *sc = mac->mac_sc; uint32_t tmp; + int i; KASSERT(mac->mac_status == BWN_MAC_STATUS_INITED, ("%s:%d: fail", __func__, __LINE__)); if (siba_get_revid(sc->sc_dev) < 5) return; - while (1) { + for (i = 0; i < 1000; i++) { tmp = BWN_READ_4(mac, BWN_XMITSTAT_0); if (!(tmp & 0x00000001)) break; tmp = BWN_READ_4(mac, BWN_XMITSTAT_1); + DELAY(10); } bwn_mac_enable(mac); |