From: gwl Date: Thu, 26 Jun 2014 07:55:05 +0000 (+0800) Subject: WiFi:bcmdhd: fix wifi driver endless loop when initialization fail. X-Git-Tag: firefly_0821_release~5037 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4cb292a95f94ac5a6b8adc6a637de63b9430092a;p=firefly-linux-kernel-4.4.55.git WiFi:bcmdhd: fix wifi driver endless loop when initialization fail. --- diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/aiutils.c b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/aiutils.c index ec3f537d6a31..b5b3cd171d43 100644 --- a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/aiutils.c +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/aiutils.c @@ -29,10 +29,11 @@ static uint32 get_erom_ent(si_t *sih, uint32 **eromptr, uint32 mask, uint32 match) { - uint32 ent; + uint32 ent = 0; uint inv = 0, nom = 0; + uint retry = 20; - while (TRUE) { + while (retry--) { ent = R_REG(si_osh(sih), *eromptr); (*eromptr)++; @@ -52,6 +53,8 @@ get_erom_ent(si_t *sih, uint32 **eromptr, uint32 mask, uint32 match) nom++; } + if (!retry) + SI_ERROR(("%s: WiFi read register fail, retry = %d.\n", __FUNCTION__, retry)); SI_VMSG(("%s: Returning ent 0x%08x\n", __FUNCTION__, ent)); if (inv + nom) {