Skip to contentSkip to conversation

remoteproc: meson-mx-ao-arc: fix a bit test

PATCH Applied Dan Carpenter 3 participants 3 messages Oct 4, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remoteproc: meson-mx-ao-arc: fix a bit test

The MESON_AO_RPROC_SRAM_USABLE_BITS macro is used like this:

        if (priv->sram_pa & ~MESON_AO_RPROC_SRAM_USABLE_BITS) {
                dev_err(dev, "SRAM address contains unusable bits\n");

The problem is that "->sram_pa" is type phys_addr_t which is potentially 64 bits. That means the MESON_AO_RPROC_SRAM_USABLE_BITS macro needs to be a 64 bit type as well to ensure that high 32 bits are cleared.

Fixes 6cb58ea897dd ("remoteproc: meson-mx-ao-arc: Add a driver for the AO ARC remote procesor")
---
 drivers/remoteproc/meson_mx_ao_arc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/meson_mx_ao_arc.c +1 -1
index 3d8f927ae448..462cddab6518 100644
@@ -39,7 +39,7 @@
 #define AO_SECURE_REG0_AHB_SRAM_BITS_19_12			GENMASK(15, 8)
 
 /* Only bits [31:20] and [17:14] are usable, all other bits must be zero */
-#define MESON_AO_RPROC_SRAM_USABLE_BITS				0xfff3c000
+#define MESON_AO_RPROC_SRAM_USABLE_BITS				0xfff3c000ULL
 
 #define MESON_AO_RPROC_MEMORY_OFFSET				0x10000000
 
Signature · 1 line
2.20.1
#1 lore raw

Re: (subset) [PATCH] remoteproc: meson-mx-ao-arc: fix a bit test

Quoted 10 lines · Dan Carpenter

The MESON_AO_RPROC_SRAM_USABLE_BITS macro is used like this:

        if (priv->sram_pa & ~MESON_AO_RPROC_SRAM_USABLE_BITS) {
                dev_err(dev, "SRAM address contains unusable bits\n");

The problem is that "->sram_pa" is type phys_addr_t which is potentially 64 bits. That means the MESON_AO_RPROC_SRAM_USABLE_BITS macro needs to be a 64 bit type as well to ensure that high 32 bits are cleared.

[...]

Applied, thanks!

[1/1] remoteproc: meson-mx-ao-arc: fix a bit test

      commit: faf88ed1c083017d1f4478f45c4f375e7a3f8bdc

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>
reviewer Tested-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter

Hi Dan,

thank you for this patch!

Quoted 6 lines · Dan Carpenter

The MESON_AO_RPROC_SRAM_USABLE_BITS macro is used like this:

        if (priv->sram_pa & ~MESON_AO_RPROC_SRAM_USABLE_BITS) {
                dev_err(dev, "SRAM address contains unusable bits\n");
Quoted 6 lines

The problem is that "->sram_pa" is type phys_addr_t which is potentially 64 bits. That means the MESON_AO_RPROC_SRAM_USABLE_BITS macro needs to be a 64 bit type as well to ensure that high 32 bits are cleared.

Fixes 6cb58ea897dd ("remoteproc: meson-mx-ao-arc: Add a driver for the AO ARC remote procesor")

even though it's already applied, here's my:

Best regards,
Martin