Thread (20 messages) flat view 20 messages, 3 authors, 2021-02-07

RE: [EXT] Re: [RESEND PATCH v8 net-next 03/15] net: mvpp2: add CM3 SRAM memory map

From: Stefan Chulski <hidden>
Date: 2021-02-07 16:53:09
Also in: linux-arm-kernel, lkml, netdev

quoted
+		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");
quoted
+			return -ENOMEM;
+		}
+		/* cm3_base allocated with offset zero into the SRAM since
mapping size
quoted
+		 * is equal to requested size.
+		 */
+		priv->cm3_base = (void __iomem *)gen_pool_alloc(priv-
sram_pool,
+
	MSS_SRAM_SIZE);
quoted
+		if (!priv->cm3_base)
+			return -ENOMEM;
+	}
For v2 i asked:
quoted
I'm wondering if using a pool even makes sense. The ACPI case just
ioremap() the memory region. Either this memory is dedicated, and then
there is no need to use a pool, or the memory is shared, and at some
point the ACPI code is going to run into problems when some other
driver also wants access.
There was never an answer to this.
Sorry probably missed this. Currently this memory not shared and I can just ioremap same way as in ACPI case.
In this case I can remove EPROBE_DEFER.

Thanks,
Stefan.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help