lkml.org 
[lkml]   [2021]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 RFC net-next 03/18] net: mvpp2: add CM3 SRAM memory map
On Sun, Jan 24, 2021 at 01:43:52PM +0200, stefanc@marvell.com wrote:
> + priv->sram_pool = of_gen_pool_get(dn, "cm3-mem", 0);
> + if (!priv->sram_pool) {
> + if (!defer_once) {
> + defer_once = true;
> + /* Try defer once */
> + return -EPROBE_DEFER;
> + }
> + dev_warn(&pdev->dev, "DT is too old, Flow control not supported\n");
> + return -ENOMEM;
> + }
> + priv->cm3_base = (void __iomem *)gen_pool_alloc(priv->sram_pool,
> + MSS_SRAM_SIZE);
> + if (!priv->cm3_base)
> + return -ENOMEM;

This probably could do with a comment indicating that it is reliant on
this allocation happening at offset zero into the SRAM. The only reason
that is guaranteed _at the moment_ is because the SRAM mapping is 0x800
bytes in size, and you are requesting 0x800 bytes in this allocation,
so allocating the full size.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

\
 
 \ /
  Last update: 2021-01-24 13:47    [W:0.140 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site