diff mbox series

[1/4] brcmfmac: use different error value for invalid ram base address

Message ID 1627505434-9544-2-git-send-email-arend.vanspriel@broadcom.com
State New
Headers show
Series brcmfmac: prepare for new device support | expand

Commit Message

Arend van Spriel July 28, 2021, 8:50 p.m. UTC
The function brcmf_chip_tcm_rambase() returns 0 as invalid ram base
address. However, upcoming chips have ram base address starting at
zero so we have to find a more appropriate invalid value to return.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Kalle Valo Aug. 21, 2021, 3:49 p.m. UTC | #1
Arend van Spriel <arend.vanspriel@broadcom.com> wrote:

> The function brcmf_chip_tcm_rambase() returns 0 as invalid ram base

> address. However, upcoming chips have ram base address starting at

> zero so we have to find a more appropriate invalid value to return.

> 

> Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>

> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>

> Reviewed-by: Franky Lin <franky.lin@broadcom.com>

> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>


4 patches applied to wireless-drivers-next.git, thanks.

2c4fa29eceb3 brcmfmac: use different error value for invalid ram base address
8e73facb9b80 brcmfmac: increase core revision column aligning core list
a7dd0ac94544 brcmfmac: add xtlv support to firmware interface layer
1ce050c15952 brcmfmac: support chipsets with different core enumeration space

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/1627505434-9544-2-git-send-email-arend.vanspriel@broadcom.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
index 45037decba40..85653a95a60c 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
@@ -139,6 +139,8 @@  struct sbconfig {
 	u32 sbidhigh;	/* identification */
 };
 
+#define INVALID_RAMBASE			((u32)(~0))
+
 /* bankidx and bankinfo reg defines corerev >= 8 */
 #define SOCRAM_BANKINFO_RETNTRAM_MASK	0x00010000
 #define SOCRAM_BANKINFO_SZMASK		0x0000007f
@@ -731,7 +733,7 @@  static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci)
 		brcmf_err("unknown chip: %s\n", ci->pub.name);
 		break;
 	}
-	return 0;
+	return INVALID_RAMBASE;
 }
 
 int brcmf_chip_get_raminfo(struct brcmf_chip *pub)
@@ -746,7 +748,7 @@  int brcmf_chip_get_raminfo(struct brcmf_chip *pub)
 		mem_core = container_of(mem, struct brcmf_core_priv, pub);
 		ci->pub.ramsize = brcmf_chip_tcm_ramsize(mem_core);
 		ci->pub.rambase = brcmf_chip_tcm_rambase(ci);
-		if (!ci->pub.rambase) {
+		if (ci->pub.rambase == INVALID_RAMBASE) {
 			brcmf_err("RAM base not provided with ARM CR4 core\n");
 			return -EINVAL;
 		}
@@ -757,7 +759,7 @@  int brcmf_chip_get_raminfo(struct brcmf_chip *pub)
 						pub);
 			ci->pub.ramsize = brcmf_chip_sysmem_ramsize(mem_core);
 			ci->pub.rambase = brcmf_chip_tcm_rambase(ci);
-			if (!ci->pub.rambase) {
+			if (ci->pub.rambase == INVALID_RAMBASE) {
 				brcmf_err("RAM base not provided with ARM CA7 core\n");
 				return -EINVAL;
 			}