Skip to contentSkip to conversation

brcmfmac: Fix brcmf_chip_ai_coredisable not applying reset bits to BCMA_IOCTL

PATCH In review Arend van Spriel 2 participants 3 messages Jun 6, 2014 – Jul 5, 2014 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmfmac: Fix brcmf_chip_ai_coredisable not applying reset bits to BCMA_IOCTL

From: Hans de Goede <[email protected]>

brcmfmac has been broken on my cubietruck with a BCM43362:

brcmfmac: brcmf_chip_recognition: found AXI chip: BCM43362, rev=1
brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0:

        Apr 22 2013 14:50:00 version 5.90.195.89.6 FWID 01-b30a427d

since commit 53036261033: "brcmfmac: update core reset and disable routines".

The problem is that since this commit brcmf_chip_ai_resetcore no longer sets BCMA_IOCTL itself before bringing the core out of reset, instead relying on brcmf_chip_ai_coredisable to do so. But brcmf_chip_ai_coredisable is a nop of the chip is already in reset. This patch modifies brcmf_chip_ai_coredisable to always set BCMA_IOCTL even if the core is already in reset.

This fixes brcmfmac hanging in firmware loading on my board.

upstream: 75691d9e4f4e156f71f3eaee69a5bd27b7b10384

---
 drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c +3 -2
index 82bf3c5..2de2736 100644
@@ -300,10 +300,10 @@ brcmf_sdio_ai_coredisable(struct brcmf_sdio_dev *sdiodev,
 
 	wrapbase = ci->c_inf[idx].wrapbase;
 
-	/* if core is already in reset, just return */
+	/* if core is already in reset, skip reset */
 	regdata = brcmf_sdiod_regrl(sdiodev, wrapbase + BCMA_RESET_CTL, NULL);
 	if ((regdata & BCMA_RESET_CTL_RESET) != 0)
-		return;
+		goto post_reset_config;
 
 	/* configure reset */
 	brcmf_sdiod_regwl(sdiodev, wrapbase + BCMA_IOCTL, pre_resetbits |
@@ -319,6 +319,7 @@ brcmf_sdio_ai_coredisable(struct brcmf_sdio_dev *sdiodev,
 	SPINWAIT(brcmf_sdiod_regrl(sdiodev, wrapbase + BCMA_RESET_CTL, NULL) !=
 		 BCMA_RESET_CTL_RESET, 300);
 
+post_reset_config:
 	/* post reset configure */
 	brcmf_sdiod_regwl(sdiodev, wrapbase + BCMA_IOCTL, pre_resetbits |
 			  BCMA_IOCTL_FGC | BCMA_IOCTL_CLK, NULL);
Signature · 1 line
1.9.1
#1 lore raw
Quoted 16 lines · Arend van Spriel

From: Hans de Goede <[email protected]>

brcmfmac has been broken on my cubietruck with a BCM43362:

brcmfmac: brcmf_chip_recognition: found AXI chip: BCM43362, rev=1
brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0:

        Apr 22 2013 14:50:00 version 5.90.195.89.6 FWID 01-b30a427d

since commit 53036261033: "brcmfmac: update core reset and disable routines".

The problem is that since this commit brcmf_chip_ai_resetcore no longer sets BCMA_IOCTL itself before bringing the core out of reset, instead relying on brcmf_chip_ai_coredisable to do so. But brcmf_chip_ai_coredisable is a nop of the chip is already in reset. This patch modifies brcmf_chip_ai_coredisable to always set BCMA_IOCTL even if the core is already in reset.

Quoted 3 lines

This fixes brcmfmac hanging in firmware loading on my board.

upstream: 75691d9e4f4e156f71f3eaee69a5bd27b7b10384

I see no such commit id in Linus's tree, are you sure this is the id you need?

thanks,

greg k-h

#2 lore raw
Quoted 17 lines · Greg KH
Quoted 16 lines · Arend van Spriel

From: Hans de Goede<[email protected]>

brcmfmac has been broken on my cubietruck with a BCM43362:

brcmfmac: brcmf_chip_recognition: found AXI chip: BCM43362, rev=1
brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0:

         Apr 22 2013 14:50:00 version 5.90.195.89.6 FWID 01-b30a427d

since commit 53036261033: "brcmfmac: update core reset and disable routines".

The problem is that since this commit brcmf_chip_ai_resetcore no longer sets BCMA_IOCTL itself before bringing the core out of reset, instead relying on brcmf_chip_ai_coredisable to do so. But brcmf_chip_ai_coredisable is a nop of the chip is already in reset. This patch modifies brcmf_chip_ai_coredisable to always set BCMA_IOCTL even if the core is already in reset.

Quoted 3 lines
Quoted 3 lines

This fixes brcmfmac hanging in firmware loading on my board.

upstream: 75691d9e4f4e156f71f3eaee69a5bd27b7b10384

Hi Greg,

I guess I did not swim far enough upstream ;-) Below the commit id as found in Linus's tree:

commit ffa216bb5eecfce0f01b0b2a95d5c320dde90005

Author: Hans de Goede <[email protected]>
Date:   Wed Apr 23 12:20:55 2014 +0200

brcmfmac: Fix brcmf_chip_ai_coredisable not applying reset bits to
BCMA_IOCT

Thanks for checking.

Regards,
Arend

Quoted 6 lines

I see no such commit id in Linus's tree, are you sure this is the id you need?

thanks,

greg k-h