Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: apple-admac: Avoid accessing registers in probe

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>

authored by

Sasha Finkelstein and committed by
Vinod Koul
8d55e8a1 790fb995

+2 -5
+2 -5
drivers/dma/apple-admac.c
··· 153 153 { 154 154 struct admac_sram *sram; 155 155 int i, ret = 0, nblocks; 156 + ad->txcache.size = readl_relaxed(ad->base + REG_TX_SRAM_SIZE); 157 + ad->rxcache.size = readl_relaxed(ad->base + REG_RX_SRAM_SIZE); 156 158 157 159 if (dir == DMA_MEM_TO_DEV) 158 160 sram = &ad->txcache; ··· 914 912 goto free_irq; 915 913 } 916 914 917 - ad->txcache.size = readl_relaxed(ad->base + REG_TX_SRAM_SIZE); 918 - ad->rxcache.size = readl_relaxed(ad->base + REG_RX_SRAM_SIZE); 919 - 920 915 dev_info(&pdev->dev, "Audio DMA Controller\n"); 921 - dev_info(&pdev->dev, "imprint %x TX cache %u RX cache %u\n", 922 - readl_relaxed(ad->base + REG_IMPRINT), ad->txcache.size, ad->rxcache.size); 923 916 924 917 return 0; 925 918