mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] intel_mid_dma: fix runtime pm issues
@ 2011-03-31 18:02 kristen
  2011-04-01 11:21 ` Koul, Vinod
  0 siblings, 1 reply; 2+ messages in thread
From: kristen @ 2011-03-31 18:02 UTC (permalink / raw)
  To: vinod.koul; +Cc: linux-kernel, alan, Kristen Carlson Accardi

From: Kristen Carlson Accardi <kristen@linux.intel.com>

Use the correct api in probe to enable runtime pm for this driver.
Additionally, do not just call legacy suspend for runtime_suspend,
as this duplicates some work the pci core does for you.

Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
---
 drivers/dma/intel_mid_dma.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
index 798f46a..f153adf 100644
--- a/drivers/dma/intel_mid_dma.c
+++ b/drivers/dma/intel_mid_dma.c
@@ -1292,8 +1292,7 @@ static int __devinit intel_mid_dma_probe(struct pci_dev *pdev,
 	if (err)
 		goto err_dma;
 
-	pm_runtime_set_active(&pdev->dev);
-	pm_runtime_enable(&pdev->dev);
+	pm_runtime_put_noidle(&pdev->dev);
 	pm_runtime_allow(&pdev->dev);
 	return 0;
 
@@ -1322,6 +1321,9 @@ err_enable_device:
 static void __devexit intel_mid_dma_remove(struct pci_dev *pdev)
 {
 	struct middma_device *device = pci_get_drvdata(pdev);
+
+	pm_runtime_get_noresume(&pdev->dev);
+	pm_runtime_forbid(&pdev->dev);
 	middma_shutdown(pdev);
 	pci_dev_put(pdev);
 	kfree(device);
@@ -1385,13 +1387,20 @@ int dma_resume(struct pci_dev *pci)
 static int dma_runtime_suspend(struct device *dev)
 {
 	struct pci_dev *pci_dev = to_pci_dev(dev);
-	return dma_suspend(pci_dev, PMSG_SUSPEND);
+	struct middma_device *device = pci_get_drvdata(pci_dev);
+
+	device->state = SUSPENDED;
+	return 0;
 }
 
 static int dma_runtime_resume(struct device *dev)
 {
 	struct pci_dev *pci_dev = to_pci_dev(dev);
-	return dma_resume(pci_dev);
+	struct middma_device *device = pci_get_drvdata(pci_dev);
+
+	device->state = RUNNING;
+	iowrite32(REG_BIT0, device->dma_base + DMA_CFG);
+	return 0;
 }
 
 static int dma_runtime_idle(struct device *dev)
-- 
1.7.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] intel_mid_dma: fix runtime pm issues
  2011-03-31 18:02 [PATCH] intel_mid_dma: fix runtime pm issues kristen
@ 2011-04-01 11:21 ` Koul, Vinod
  0 siblings, 0 replies; 2+ messages in thread
From: Koul, Vinod @ 2011-04-01 11:21 UTC (permalink / raw)
  To: kristen; +Cc: linux-kernel, alan, Dan

On Thu, 2011-03-31 at 11:02 -0700, kristen@linux.intel.com wrote:
> From: Kristen Carlson Accardi <kristen@linux.intel.com>
> 
> Use the correct api in probe to enable runtime pm for this driver.
> Additionally, do not just call legacy suspend for runtime_suspend,
> as this duplicates some work the pci core does for you.
> 
> Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
> ---
>  drivers/dma/intel_mid_dma.c |   17 +++++++++++++----
>  1 files changed, 13 insertions(+), 4 deletions(-)
> 
Applied, Thanks

-- 
~Vinod


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-01 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-31 18:02 [PATCH] intel_mid_dma: fix runtime pm issues kristen
2011-04-01 11:21 ` Koul, Vinod

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome