Hi,

Please find attached a patch which fixes audio failure during the second voice 
call with runtime_pm.

Call the runtimepm_put function after resetting the in_use parameter and after 
writing
to the DMA registers. Otherwise, when releasing the first voice call the 
dma_runtime_idle can be called when the in_use is TRUE (channel not freed) and 
returns -EAGAIN. When Intel MID I2S requests the DMA channels for the 2nd voice 
call, the DMA is NOT resumed ==> No DMA interrupts ==> no audio.

Thanks,

Selma.

>From 7d5655f4e3b2aea5a9a9d592067fa253a97ca571 Mon Sep 17 00:00:00 2001
From: Selma Bensaid <[email protected]>
Date: Mon, 13 Dec 2010 18:24:38 +0100
Subject: [PATCH] Intel MID DMA: Fix the "no voice" during 2nd voice call when 
RUNTIME_PM ON

Call the runtimepm_put function after resetting the in_use parameter and after 
writing
to the DMA registers. Otherwise, the dma_runtime_idle can be called when 
in_use=true (channel not freed) and returns -EAGAIN.
When Intel MID I2S requests the DMA channels, the DMA is not resumed ==> No DMA
interrupts ==> no audio.

Signed-off-by: Selma Bensaid <[email protected]>
---
 drivers/dma/intel_mid_dma.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
index c96abd6..eafd27e 100644
--- a/drivers/dma/intel_mid_dma.c
+++ b/drivers/dma/intel_mid_dma.c
@@ -622,7 +622,7 @@ static void intel_mid_dma_free_chan_resources(struct 
dma_chan *chan)
                /*trying to free ch in use!!!!!*/
                pr_err("ERR_MDMA: trying to free ch in use\n");
        }
-       pm_runtime_put(&mid->pdev->dev);
+
        spin_lock_bh(&midc->lock);
        midc->descs_allocated = 0;
        list_for_each_entry_safe(desc, _desc, &midc->active_list, desc_node) {
@@ -638,11 +638,15 @@ static void intel_mid_dma_free_chan_resources(struct 
dma_chan *chan)
                pci_pool_free(mid->dma_pool, desc, desc->txd.phys);
        }
        spin_unlock_bh(&midc->lock);
+
        midc->in_use = false;
        midc->busy = false;
+
        /* Disable CH interrupts */
        iowrite32(MASK_INTR_REG(midc->ch_id), mid->dma_base + MASK_BLOCK);
        iowrite32(MASK_INTR_REG(midc->ch_id), mid->dma_base + MASK_ERR);
+
+       pm_runtime_put(&mid->pdev->dev);
 }
 
 /**
@@ -1135,8 +1139,10 @@ int dma_suspend(struct pci_dev *pci, pm_message_t state)
        pr_debug("MDMA: dma_suspend called\n");
 
        for (i = 0; i < device->max_chan; i++) {
-               if (device->ch[i].in_use)
+               if (device->ch[i].in_use) {
+                       pr_warn("MDMA: dma_suspend Channel%d in Use!\n", i);
                        return -EAGAIN;
+               }
        }
        device->state = SUSPENDED;
        pci_set_drvdata(pci, device);
@@ -1194,8 +1200,10 @@ static int dma_runtime_idle(struct device *dev)
        pr_debug("MDMA: runtime_idle called\n");
 
        for (i = 0; i < device->max_chan; i++) {
-               if (device->ch[i].in_use)
+               if (device->ch[i].in_use) {
+                       pr_warn("MDMA: dma_runtime_idle Channel%d in Use!\n", 
i);
                        return -EAGAIN;
+               }
        }
 
        return pm_schedule_suspend(dev, 0);
-- 
1.7.2.3

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Attachment: 0001-Intel-MID-DMA-Fix-the-no-voice-during-2nd-voice-call.patch
Description: 0001-Intel-MID-DMA-Fix-the-no-voice-during-2nd-voice-call.patch

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to