lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ed387a90-586d-5071-baa6-bc66d4e7f22f@broadcom.com>
Date:   Wed, 19 Jan 2022 13:36:43 +0100
From:   Arend van Spriel <arend.vanspriel@...adcom.com>
To:     Hector Martin <marcan@...can.st>,
        Kalle Valo <kvalo@...eaurora.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <lenb@...nel.org>,
        Arend van Spriel <aspriel@...il.com>,
        Franky Lin <franky.lin@...adcom.com>,
        Hante Meuleman <hante.meuleman@...adcom.com>,
        Chi-hsien Lin <chi-hsien.lin@...ineon.com>,
        Wright Feng <wright.feng@...ineon.com>,
        Dmitry Osipenko <digetx@...il.com>
Cc:     Sven Peter <sven@...npeter.dev>,
        Alyssa Rosenzweig <alyssa@...enzweig.io>,
        Mark Kettenis <kettenis@...nbsd.org>,
        Rafał Miłecki <zajec5@...il.com>,
        Pieter-Paul Giesberts <pieter-paul.giesberts@...adcom.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Hans de Goede <hdegoede@...hat.com>,
        "John W. Linville" <linville@...driver.com>,
        "brian m. carlson" <sandals@...stytoothpaste.net>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-acpi@...r.kernel.org, brcm80211-dev-list.pdl@...adcom.com,
        SHA-cyfmac-dev-list@...ineon.com
Subject: Re: [PATCH v2 22/35] brcmfmac: chip: Handle 1024-unit sizes for TCM
 blocks

On 1/4/2022 8:26 AM, Hector Martin wrote:
> BCM4387 has trailing odd-sized blocks as part of TCM which have
> their size described as a multiple of 1024 instead of 8192. Handle this
> so we can compute the TCM size properly.

Reviewed-by: Arend van Spriel <arend.vanspriel@...adcom.com>
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Hector Martin <marcan@...can.st>
> ---
>   .../wireless/broadcom/brcm80211/brcmfmac/chip.c | 17 ++++++++++++-----
>   1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
> index 713546cebd5a..cfa93e3ef1a1 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
> @@ -212,8 +212,8 @@ struct sbsocramregs {
>   #define	ARMCR4_TCBANB_MASK	0xf
>   #define	ARMCR4_TCBANB_SHIFT	0
>   
> -#define	ARMCR4_BSZ_MASK		0x3f
> -#define	ARMCR4_BSZ_MULT		8192
> +#define	ARMCR4_BSZ_MASK		0x7f
> +#define	ARMCR4_BLK_1K_MASK	0x200
>   
>   struct brcmf_core_priv {
>   	struct brcmf_core pub;
> @@ -675,7 +675,8 @@ static u32 brcmf_chip_sysmem_ramsize(struct brcmf_core_priv *sysmem)
>   }
>   
>   /** Return the TCM-RAM size of the ARMCR4 core. */
> -static u32 brcmf_chip_tcm_ramsize(struct brcmf_core_priv *cr4)
> +static u32 brcmf_chip_tcm_ramsize(struct brcmf_chip_priv *ci,
> +				  struct brcmf_core_priv *cr4)

Not sure why you add ci parameter here. It is not used below or am I 
overlooking something.

>   {
>   	u32 corecap;
>   	u32 memsize = 0;
> @@ -683,6 +684,7 @@ static u32 brcmf_chip_tcm_ramsize(struct brcmf_core_priv *cr4)
>   	u32 nbb;
>   	u32 totb;
>   	u32 bxinfo;
> +	u32 blksize;
>   	u32 idx;
>   
>   	corecap = brcmf_chip_core_read32(cr4, ARMCR4_CAP);
> @@ -694,7 +696,12 @@ static u32 brcmf_chip_tcm_ramsize(struct brcmf_core_priv *cr4)
>   	for (idx = 0; idx < totb; idx++) {
>   		brcmf_chip_core_write32(cr4, ARMCR4_BANKIDX, idx);
>   		bxinfo = brcmf_chip_core_read32(cr4, ARMCR4_BANKINFO);
> -		memsize += ((bxinfo & ARMCR4_BSZ_MASK) + 1) * ARMCR4_BSZ_MULT;
> +		if (bxinfo & ARMCR4_BLK_1K_MASK)
> +			blksize = 1024;
> +		else
> +			blksize = 8192;
> +
> +		memsize += ((bxinfo & ARMCR4_BSZ_MASK) + 1) * blksize;
>   	}
>   
>   	return memsize;

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4219 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ