]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: tegra210-adma: Fix crash during probe
authorJon Hunter <jonathanh@nvidia.com>
Thu, 16 May 2019 15:53:52 +0000 (16:53 +0100)
committerVinod Koul <vkoul@kernel.org>
Tue, 21 May 2019 08:56:00 +0000 (14:26 +0530)
commit788a95c3bccc2f9659e20fd3795ef091ae318039
treea8c3729dcdb86846970758f3fd1bc9ede5779b81
parentd2d4933570efb92c0298273548143127c03e7dde
dmaengine: tegra210-adma: Fix crash during probe

Commit 1cf86342ed01 ("dmaengine: tegra210-adma: restore channel status")
added support to save and restore the DMA channel registers when runtime
suspending the ADMA. This change is causing the kernel to crash when
probing the ADMA, if the device is probed deferred when looking up the
channel interrupts. The crash occurs because not all of the channel base
addresses have been setup at this point and in the clean-up path of the
probe, pm_runtime_suspend() is called invoking its callback which
expects all the channel base addresses to be initialised.

Although this could be fixed by simply checking for a NULL address, on
further review of the driver it seems more appropriate that we only call
pm_runtime_get_sync() after all the channel interrupts and base
addresses have been configured. Therefore, fix this crash by moving the
calls to pm_runtime_enable(), pm_runtime_get_sync() and
tegra_adma_init() after the DMA channels have been initialised.

Fixes: 1cf86342ed01 ("dmaengine: tegra210-adma: restore channel status")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/tegra210-adma.c