aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSinan Kaya <okaya@codeaurora.org>2017-03-25 19:04:03 -0400
committerVinod Koul <vinod.koul@intel.com>2017-03-27 01:13:38 -0400
commitdc7c733acb04307563da357af6118b12948c3f50 (patch)
treee16491c76c66c05c07ac0e46c4d70e679baefef9
parentc3a4528788cf09d709217f21be4b0fc38ada17d0 (diff)
dmaengine: qcom_hidma: pause the channel on shutdown
We need to ensure that all DMAs and interrupts are cleared during shutdown operation in order for kexec to start the next kernel clearly. Otherwise, HW could be performing a DMA into random addresses in the middle of second kernel start. Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/qcom/hidma.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
index 3c982c96b4b7..5072a7d306d4 100644
--- a/drivers/dma/qcom/hidma.c
+++ b/drivers/dma/qcom/hidma.c
@@ -865,6 +865,20 @@ bailout:
865 return rc; 865 return rc;
866} 866}
867 867
868static void hidma_shutdown(struct platform_device *pdev)
869{
870 struct hidma_dev *dmadev = platform_get_drvdata(pdev);
871
872 dev_info(dmadev->ddev.dev, "HI-DMA engine shutdown\n");
873
874 pm_runtime_get_sync(dmadev->ddev.dev);
875 if (hidma_ll_disable(dmadev->lldev))
876 dev_warn(dmadev->ddev.dev, "channel did not stop\n");
877 pm_runtime_mark_last_busy(dmadev->ddev.dev);
878 pm_runtime_put_autosuspend(dmadev->ddev.dev);
879
880}
881
868static int hidma_remove(struct platform_device *pdev) 882static int hidma_remove(struct platform_device *pdev)
869{ 883{
870 struct hidma_dev *dmadev = platform_get_drvdata(pdev); 884 struct hidma_dev *dmadev = platform_get_drvdata(pdev);
@@ -908,6 +922,7 @@ MODULE_DEVICE_TABLE(of, hidma_match);
908static struct platform_driver hidma_driver = { 922static struct platform_driver hidma_driver = {
909 .probe = hidma_probe, 923 .probe = hidma_probe,
910 .remove = hidma_remove, 924 .remove = hidma_remove,
925 .shutdown = hidma_shutdown,
911 .driver = { 926 .driver = {
912 .name = "hidma", 927 .name = "hidma",
913 .of_match_table = hidma_match, 928 .of_match_table = hidma_match,