Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78728cd5 authored by Claudiu Beznea's avatar Claudiu Beznea Committed by Greg Kroah-Hartman
Browse files

dmaengine: at_xdmac: do not enable all cyclic channels



[ Upstream commit f8435befd81dd85b7b610598551fadf675849bc1 ]

Do not global enable all the cyclic channels in at_xdmac_resume(). Instead
save the global status in at_xdmac_suspend() and re-enable the cyclic
channel only if it was active before suspend.

Fixes: e1f7c9ee ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230214151827.1050280-6-claudiu.beznea@microchip.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 9b0d1ffb
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -223,6 +223,7 @@ struct at_xdmac {
	int			irq;
	struct clk		*clk;
	u32			save_gim;
	u32			save_gs;
	struct dma_pool		*at_xdmac_desc_pool;
	struct at_xdmac_chan	chan[0];
};
@@ -1878,6 +1879,7 @@ static int atmel_xdmac_suspend(struct device *dev)
		}
	}
	atxdmac->save_gim = at_xdmac_read(atxdmac, AT_XDMAC_GIM);
	atxdmac->save_gs = at_xdmac_read(atxdmac, AT_XDMAC_GS);

	at_xdmac_off(atxdmac);
	clk_disable_unprepare(atxdmac->clk);
@@ -1914,6 +1916,7 @@ static int atmel_xdmac_resume(struct device *dev)
			at_xdmac_chan_write(atchan, AT_XDMAC_CNDC, atchan->save_cndc);
			at_xdmac_chan_write(atchan, AT_XDMAC_CIE, atchan->save_cim);
			wmb();
			if (atxdmac->save_gs & atchan->mask)
				at_xdmac_write(atxdmac, AT_XDMAC_GE, atchan->mask);
		}
	}