[PATCH 5.10 33/52] soc: sunxi: sram: Actually claim SRAM regions
From: Greg Kroah-Hartman
Date: Mon Oct 03 2022 - 04:28:18 EST
From: Samuel Holland <samuel@xxxxxxxxxxxx>
[ Upstream commit fd362baad2e659ef0fb5652f023a606b248f1781 ]
sunxi_sram_claim() checks the sram_desc->claimed flag before updating
the register, with the intent that only one device can claim a region.
However, this was ineffective because the flag was never set.
Fixes: 4af34b572a85 ("drivers: soc: sunxi: Introduce SoC driver to map SRAMs")
Reviewed-by: Jernej Skrabec <jernej.skrabec@xxxxxxxxx>
Signed-off-by: Samuel Holland <samuel@xxxxxxxxxxxx>
Reviewed-by: Heiko Stuebner <heiko@xxxxxxxxx>
Tested-by: Heiko Stuebner <heiko@xxxxxxxxx>
Signed-off-by: Jernej Skrabec <jernej.skrabec@xxxxxxxxx>
Link: https://lore.kernel.org/r/20220815041248.53268-4-samuel@xxxxxxxxxxxx
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/soc/sunxi/sunxi_sram.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c
index d4c7bd59429e..5d1305483542 100644
--- a/drivers/soc/sunxi/sunxi_sram.c
+++ b/drivers/soc/sunxi/sunxi_sram.c
@@ -254,6 +254,7 @@ int sunxi_sram_claim(struct device *dev)
writel(val | ((device << sram_data->offset) & mask),
base + sram_data->reg);
+ sram_desc->claimed = true;
spin_unlock(&sram_lock);
return 0;
--
2.35.1