]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dmaengine: apple-admac: Avoid accessing registers in probe
authorSasha Finkelstein <fnkl.kernel@gmail.com>
Sun, 24 Nov 2024 15:48:28 +0000 (16:48 +0100)
committerVinod Koul <vkoul@kernel.org>
Wed, 4 Dec 2024 12:12:27 +0000 (17:42 +0530)
The ADMAC attached to the AOP has complex power sequencing, and is
power gated when the probe callback runs. Move the register reads
to other functions, where we can guarantee that the hardware is
switched on.

Fixes: 568aa6dd641f ("dmaengine: apple-admac: Allocate cache SRAM to channels")
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
Link: https://lore.kernel.org/r/20241124-admac-power-v1-1-58f2165a4d55@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/apple-admac.c

index c499173d80b20f8a3de1279b77aed21c159aca57..bd49f03742912198804a02a22e38da2c21093761 100644 (file)
@@ -153,6 +153,8 @@ static int admac_alloc_sram_carveout(struct admac_data *ad,
 {
        struct admac_sram *sram;
        int i, ret = 0, nblocks;
+       ad->txcache.size = readl_relaxed(ad->base + REG_TX_SRAM_SIZE);
+       ad->rxcache.size = readl_relaxed(ad->base + REG_RX_SRAM_SIZE);
 
        if (dir == DMA_MEM_TO_DEV)
                sram = &ad->txcache;
@@ -912,12 +914,7 @@ static int admac_probe(struct platform_device *pdev)
                goto free_irq;
        }
 
-       ad->txcache.size = readl_relaxed(ad->base + REG_TX_SRAM_SIZE);
-       ad->rxcache.size = readl_relaxed(ad->base + REG_RX_SRAM_SIZE);
-
        dev_info(&pdev->dev, "Audio DMA Controller\n");
-       dev_info(&pdev->dev, "imprint %x TX cache %u RX cache %u\n",
-                readl_relaxed(ad->base + REG_IMPRINT), ad->txcache.size, ad->rxcache.size);
 
        return 0;