Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1284274

[PATCH v3 7/9] dmaengine: dw: platform: power on device on shutdown

From Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH v3 7/9] dmaengine: dw: platform: power on device on shutdown
Date 2015-12-04 23:00 +0100
Message-ID <qC6yv-8fV-41@gated-at.bofh.it> (permalink)
References <qC6oO-8cc-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


We have to call dw_dma_disable() to stop any ongoing transfer. On some
platforms we can't do that since DMA device is powered off. Moreover we have no
possibility at that point to check if the platform is affected or not. That's
why we call pm_runtime_get_sync() / pm_runtime_put() unconditionally. On the
other hand we can't use pm_runtime_suspended() because runtime PM framework is
not fully used by the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/dma/dw/platform.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
index 68a4815..d0734e9 100644
--- a/drivers/dma/dw/platform.c
+++ b/drivers/dma/dw/platform.c
@@ -239,7 +239,19 @@ static void dw_shutdown(struct platform_device *pdev)
 {
 	struct dw_dma_chip *chip = platform_get_drvdata(pdev);
 
+	/*
+	 * We have to call dw_dma_disable() to stop any ongoing transfer. On
+	 * some platforms we can't do that since DMA device is powered off.
+	 * Moreover we have no possibility to check if the platform is affected
+	 * or not. That's why we call pm_runtime_get_sync() / pm_runtime_put()
+	 * unconditionally. On the other hand we can't use
+	 * pm_runtime_suspended() because runtime PM framework is not fully
+	 * used by the driver.
+	 */
+	pm_runtime_get_sync(chip->dev);
 	dw_dma_disable(chip);
+	pm_runtime_put_sync_suspend(chip->dev);
+
 	clk_disable_unprepare(chip->clk);
 }
 
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/9] ACPI / LPSS: fix system hangup on BYT/BSW/CHT Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-12-04 23:00 +0100
  [PATCH v3 6/9] ACPI / LPSS: override power state for LPSS DMA device Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-12-04 23:00 +0100
  [PATCH v3 4/9] ACPI / LPSS: power on when probe() and otherwise when remove() Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-12-04 23:00 +0100
  [PATCH v3 7/9] dmaengine: dw: platform: power on device on shutdown Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-12-04 23:00 +0100
    Re: [PATCH v3 7/9] dmaengine: dw: platform: power on device on  shutdown Vinod Koul <vinod.koul@intel.com> - 2015-12-08 18:30 +0100
  Re: [PATCH v3 0/9] ACPI / LPSS: fix system hangup on BYT/BSW/CHT "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-12-04 23:40 +0100
    Re: [PATCH v3 0/9] ACPI / LPSS: fix system hangup on BYT/BSW/CHT Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-12-05 00:20 +0100
      Re: [PATCH v3 0/9] ACPI / LPSS: fix system hangup on BYT/BSW/CHT "Rafael J. Wysocki" <rafael@kernel.org> - 2015-12-05 01:10 +0100
        Re: [PATCH v3 0/9] ACPI / LPSS: fix system hangup on BYT/BSW/CHT Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-08 05:40 +0100

csiph-web