Skip to content

Commit aa2381a

Browse files
WhatAmISupposedToPutHeregregkh
authored andcommitted
dmaengine: apple-admac: Avoid accessing registers in probe
commit 8d55e8a upstream. 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: 568aa6d ("dmaengine: apple-admac: Allocate cache SRAM to channels") Signed-off-by: Sasha Finkelstein <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 34d2c9c commit aa2381a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/dma/apple-admac.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ static int admac_alloc_sram_carveout(struct admac_data *ad,
153153
{
154154
struct admac_sram *sram;
155155
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);
156158

157159
if (dir == DMA_MEM_TO_DEV)
158160
sram = &ad->txcache;
@@ -912,12 +914,7 @@ static int admac_probe(struct platform_device *pdev)
912914
goto free_irq;
913915
}
914916

915-
ad->txcache.size = readl_relaxed(ad->base + REG_TX_SRAM_SIZE);
916-
ad->rxcache.size = readl_relaxed(ad->base + REG_RX_SRAM_SIZE);
917-
918917
dev_info(&pdev->dev, "Audio DMA Controller\n");
919-
dev_info(&pdev->dev, "imprint %x TX cache %u RX cache %u\n",
920-
readl_relaxed(ad->base + REG_IMPRINT), ad->txcache.size, ad->rxcache.size);
921918

922919
return 0;
923920

0 commit comments

Comments
 (0)