Skip to contentSkip to conversation

brcmfmac: put chip into passive mode (when attaching) just once

PATCH In review Rafał Miłecki 3 participants 3 messages Feb 24, 2017 Broadcom BRCM80211 IEEE802.11 wireless drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmfmac: put chip into passive mode (when attaching) just once

From: Rafał Miłecki <[email protected]>

It avoids some unnecessary work. Most likely there wasn't much sense in doing this before bus reset anyway, as reset is supposed to put chip into default state. In PCIe code (only bus implementing reset) we e.g. use watchdog to perform a chip "reboot".

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +4 -6
index 05f22ff81d60..670f2f50f9e5 100644
@@ -967,16 +967,14 @@ static int brcmf_chip_recognition(struct brcmf_chip_priv *ci)
 	if (ret)
 		return ret;
 
-	/* assure chip is passive for core access */
-	brcmf_chip_set_passive(&ci->pub);
-
 	/* Call bus specific reset function now. Cores have been determined
 	 * but further access may require a chip specific reset at this point.
 	 */
-	if (ci->ops->reset) {
+	if (ci->ops->reset)
 		ci->ops->reset(ci->ctx, &ci->pub);
-		brcmf_chip_set_passive(&ci->pub);
-	}
+
+	/* assure chip is passive for core access */
+	brcmf_chip_set_passive(&ci->pub);
 
 	return brcmf_chip_get_raminfo(ci);
 }
Signature · 1 line
2.11.0
maintainer
#1 lore raw
Quoted 6 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

It avoids some unnecessary work. Most likely there wasn't much sense in doing this before bus reset anyway, as reset is supposed to put chip into default state. In PCIe code (only bus implementing reset) we e.g. use watchdog to perform a chip "reboot".

Sorry, but removing the fisrt passive call will cause chip lockups for sure on certain systems. We learned the hard way :-p

Regards,
Arend

Quoted 31 lines
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +4 -6
index 05f22ff81d60..670f2f50f9e5 100644
@@ -967,16 +967,14 @@ static int brcmf_chip_recognition(struct brcmf_chip_priv *ci)
 	if (ret)
 		return ret;
 
-	/* assure chip is passive for core access */
-	brcmf_chip_set_passive(&ci->pub);
-
 	/* Call bus specific reset function now. Cores have been determined
 	 * but further access may require a chip specific reset at this point.
 	 */
-	if (ci->ops->reset) {
+	if (ci->ops->reset)
 		ci->ops->reset(ci->ctx, &ci->pub);
-		brcmf_chip_set_passive(&ci->pub);
-	}
+
+	/* assure chip is passive for core access */
+	brcmf_chip_set_passive(&ci->pub);
 
 	return brcmf_chip_get_raminfo(ci);
 }
#2 lore raw
Quoted 10 lines · Arend Van Spriel
Quoted 6 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

It avoids some unnecessary work. Most likely there wasn't much sense in doing this before bus reset anyway, as reset is supposed to put chip into default state. In PCIe code (only bus implementing reset) we e.g. use watchdog to perform a chip "reboot".

Sorry, but removing the fisrt passive call will cause chip lockups for sure on certain systems. We learned the hard way :-p

OK, acknowledged! ;) I just tested it on my BCM43602 doing warm reboots (they were causing problems earlier) and it worked fine.

It also seems I don't use SDK recent enough as my reference :)

Kalle please drop this patch.