]> git.itanic.dy.fi Git - linux-stable/commit
dmaengine: at_xdmac: disable/enable clock directly on suspend/resume
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Tue, 14 Feb 2023 15:18:21 +0000 (17:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:17:35 +0000 (23:17 +0900)
commitcd6b8883027a8aae69de5ba7bc0bf6491c34b143
tree892e5080a7dabbcc5f1ad15d38be8b691bb45e52
parent37c0f448c5a26fde36d4bc485b967789b1f6fbc4
dmaengine: at_xdmac: disable/enable clock directly on suspend/resume

[ Upstream commit 2de5ddb5e68c94b781b3789bca1ce52000d7d0e0 ]

Runtime PM APIs for at_xdmac just plays with clk_enable()/clk_disable()
letting aside the clk_prepare()/clk_unprepare() that needs to be
executed as the clock is also prepared on probe. Thus instead of using
runtime PM force suspend/resume APIs use
clk_disable_unprepare() + pm_runtime_put_noidle() on suspend and
clk_prepare_enable() + pm_runtime_get_noresume() on resume. This
approach as been chosen instead of using runtime PM force suspend/resume
with clk_unprepare()/clk_prepare() as it looks simpler and the final
code is better.

While at it added the missing pm_runtime_mark_last_busy() on suspend before
decrementing the reference counter.

Fixes: 650b0e990cbd ("dmaengine: at_xdmac: add runtime pm support")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230214151827.1050280-2-claudiu.beznea@microchip.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/at_xdmac.c